From c581638e004a2e9e0019da8e7a7c0790da343d5f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 13 Dec 2020 14:27:04 +0200 Subject: [PATCH 001/421] refer_patient_screen 'not finshed' --- lib/config/localized_values.dart | 1 + lib/landing_page.dart | 4 +- .../profile/refer_patient_screen.dart | 191 ++++++++++-------- lib/util/translations_delegate_base.dart | 2 + lib/widgets/doctor/my_schedule_widget.dart | 59 ++++-- 5 files changed, 155 insertions(+), 102 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 78e85967..03306e37 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -248,4 +248,5 @@ const Map> localizedValues = { }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, + 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, }; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index c79d29d9..f802ddb8 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -40,9 +40,7 @@ class _LandingPageState extends State { appBar: AppBar( elevation: 0, backgroundColor: Hexcolor('#515B5D'), - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white)), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: Text(getText(currentTab).toUpperCase()), leading: Builder( builder: (BuildContext context) { diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index e12a9240..22ed20b5 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -69,7 +69,7 @@ class _ReferPatientState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).myReferralPatient, + appBarTitle: TranslationBase.of(context).referralPatient, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -91,7 +91,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -106,6 +106,7 @@ class _ReferPatientState extends State { Expanded( // add Expanded to have your dropdown button fill remaining space child: DropdownButton( + //hint: Text('Select Clinnic'), isExpanded: true, value: _selectedClinic, iconSize: 40, @@ -176,7 +177,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -197,21 +198,37 @@ class _ReferPatientState extends State { elevation: 16, selectedItemBuilder: (BuildContext context) { - return patientsProv - .getDoctorNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); + return _selectedDoctor == '' + ? [ + Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + "eeeee", + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ) + ] + : patientsProv + .getDoctorNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); }, onChanged: (newValue) => { setState(() { @@ -262,13 +279,6 @@ class _ReferPatientState extends State { onChanged: (value) => {}, ), ), - AppText( - TranslationBase.of(context).priority, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), priorityBar(context), @@ -290,7 +300,7 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 30, + raduis: 10, borderColor: Color(0xff707070), width: double.infinity, child: Padding( @@ -391,7 +401,7 @@ class _ReferPatientState extends State { ), AppButton( title: TranslationBase.of(context).send, - color: Color(PRIMARY_COLOR), + color: (Hexcolor("#B8382B")), onPressed: () => {referToDoctor(context)}, ) ], @@ -404,67 +414,78 @@ class _ReferPatientState extends State { Widget priorityBar(BuildContext _context) { List _priorities = [ - TranslationBase.of(context).veryUrgent, - TranslationBase.of(context).urgent, - TranslationBase.of(context).routine, + TranslationBase.of(context).veryUrgent.toUpperCase(), + TranslationBase.of(context).urgent.toUpperCase(), + TranslationBase.of(context).routine.toUpperCase(), ]; - return Container( - height: MediaQuery.of(context).size.height * 0.065, - width: SizeConfig.screenWidth * 0.9, - margin: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: 40, - width: 90, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(50), - color: _isActive ? Hexcolor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - // backgroundColor:_isActive - // ? Hexcolor("#B8382B") - // : Colors.white,//sideColor, - - fontWeight: FontWeight.bold, + return Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.061999, + width: SizeConfig.screenWidth * 0.90, + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(10), + border: Border.all(width: 0.3), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = + _priorities[_activePriority] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.0559, + width: SizeConfig.screenWidth * 0.297, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(8.0), + bottomLeft: Radius.circular(8.0), + topRight: Radius.circular(10.0), + bottomRight: Radius.circular(10.0), ), + color: _isActive ? Hexcolor("#B8382B") : Colors.white, ), - )), - ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - alignment: Alignment.center, - height: 3, - width: 90, - ) - : Container() - ]); - }).toList(), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + // backgroundColor:_isActive + // ? Hexcolor("#B8382B") + // : Colors.white,//sideColor, + + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + alignment: Alignment.center, + height: 3, + width: 90, + ) + : Container() + ]); + }).toList(), + ), ), ); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1ea3be74..313012fb 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -275,6 +275,8 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; + String get referralPatient => + localizedValues['referralPatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 68194a31..8011e6dc 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -13,19 +13,27 @@ class MyScheduleWidget extends StatelessWidget { @override Widget build(BuildContext context) { - List workingHours = Helpers.getWorkingHours(workingHoursTable.workingHours); + List workingHours = + Helpers.getWorkingHours(workingHoursTable.workingHours); return CardWithBgWidgetNew( widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Column( + children: [Text('${workingHoursTable.date.day}')], + ), Row( children: [ - AppText(workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier), AppText( - ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', - fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,), + workingHoursTable.dayName, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), + AppText( + ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ), ], ), SizedBox( @@ -44,27 +52,50 @@ class MyScheduleWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText('From',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), - SizedBox(height: 5,), - AppText(work.from,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) + AppText( + 'From', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + work.from, + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) ], ), ), - Container(height: SizeConfig.realScreenWidth * 0.1 ,width: 0.8,color: Colors.grey, - margin: EdgeInsets.only(left: 15,right: 15),), + Container( + height: SizeConfig.realScreenWidth * 0.1, + width: 0.8, + color: Colors.grey, + margin: EdgeInsets.only(left: 15, right: 15), + ), Expanded( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText('To',fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.bold,), - SizedBox(height: 5,), - AppText(work.to,fontSize: 2.2 * SizeConfig.textMultiplier,fontWeight: FontWeight.w300,) + AppText( + 'To', + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + SizedBox( + height: 5, + ), + AppText( + work.to, + fontSize: 2.2 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) ], ), ), ], ) - ], ), ); From ac747e7519bf4af63d1136c768dba70f477c645d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 14 Dec 2020 10:27:24 +0300 Subject: [PATCH 002/421] dashboard --- lib/config/config.dart | 1 + lib/config/shared_pref_kay.dart | 1 + lib/providers/auth_provider.dart | 25 +++++++++++++++++++++---- lib/widgets/auth/verfiy_account.dart | 14 ++++++++++---- pubspec.yaml | 6 +++--- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6549ada5..4dcc13dc 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -77,6 +77,7 @@ const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; +const GET_DASHBOARD = 'DoctorApplication.svc/REST/GetDoctorDashboardKPI'; var selectedPatientType = 1; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 18b58c28..b4c4c374 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -8,3 +8,4 @@ final APP_Language = 'language'; final DOCTOR_PROFILE = 'doctorProfile'; final LIVE_CARE_PATIENT = 'livecare-patient-profile'; final LOGGED_IN_USER = 'loggedUser'; +final DASHBOARD_DATA = 'dashboard-data'; diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index eaca545d..67dc45e6 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -17,17 +17,16 @@ class AuthProvider with ChangeNotifier { bool isLoading = true; DoctorProfileModel doctorProfile; BaseAppClient baseAppClient = BaseAppClient(); - setDoctorProfile(DoctorProfileModel profileModel){ + setDoctorProfile(DoctorProfileModel profileModel) { doctorProfile = profileModel; notifyListeners(); } - AuthProvider() { getUserAuthentication(); } - getUserAuthentication() async { + getUserAuthentication() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); if (profile != null) { doctorProfile = new DoctorProfileModel.fromJson(profile); @@ -154,7 +153,8 @@ class AuthProvider with ChangeNotifier { await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { localRes = response; - doctorProfile = DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); + doctorProfile = + DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); selectedClinicName = response['DoctorProfileList'][0]['ClinicDescription']; }, onFailure: (String error, int statusCode) { @@ -167,4 +167,21 @@ class AuthProvider with ChangeNotifier { throw error; } } + + Future getDashboard(docInfo) async { + try { + dynamic localRes; + await baseAppClient.post(GET_DASHBOARD, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: {"DoctorID": docInfo.doctorID}); + notifyListeners(); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 8a43a42f..461ea5bc 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -363,7 +363,7 @@ class _VerifyAccountState extends State { "IsSilentLogIN": false }; - authProv.memberCheckActivationCodeNew(model).then((res) async{ + authProv.memberCheckActivationCodeNew(model).then((res) async { if (res['MessageStatus'] == 1) { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { @@ -394,12 +394,18 @@ class _VerifyAccountState extends State { */ loginProcessCompleted( Map profile, Function changeLoadingStata) { - var doctor = DoctorProfileModel.fromJson(profile); - authProv.setDoctorProfile(doctor); + var doctor = DoctorProfileModel.fromJson(profile); + authProv.setDoctorProfile(doctor); + this.getDashboard(doctor, changeLoadingStata); + } + getDashboard(doctor, Function changeLoadingStata) { + // authProv.getDashboard(doctor).then((value) { + // print(value); changeLoadingStata(false); - sharedPref.setObj(DOCTOR_PROFILE, profile); + // sharedPref.setObj(DASHBOARD_DATA, value); Navigator.of(context).pushReplacementNamed(HOME); + // }); } Future _asyncSimpleDialog( diff --git a/pubspec.yaml b/pubspec.yaml index bdda7810..038ad335 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -14,7 +14,7 @@ description: A new Flutter project. version: 1.0.0+1 environment: - sdk: ">=2.6.0 <3.0.0" + sdk: ">=2.8.0 <3.0.0" dependencies: flutter: @@ -50,7 +50,7 @@ dependencies: cupertino_icons: ^0.1.2 # SVG #flutter_svg: ^0.17.4 - percent_indicator: "^2.1.1" + percent_indicator: ^2.1.1 #Dependency Injection get_it: ^4.0.2 @@ -80,7 +80,7 @@ flutter: assets: - assets/images/ - assets/images/dashboard/ - # - images/a_dot_ham.jpeg + # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From cbb8937b1d591099151cbdf07cca35f2973e4c46 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 14 Dec 2020 14:19:04 +0200 Subject: [PATCH 003/421] '12/14' --- lib/config/localized_values.dart | 6 +- lib/landing_page.dart | 4 +- .../profile/refer_patient_screen.dart | 623 +++++++++--------- pubspec.lock | 28 +- 4 files changed, 310 insertions(+), 351 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 84d2a7c7..4c6cd6f6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -242,7 +242,6 @@ const Map> localizedValues = { 'ar': 'لا يوجد اي نتائج' }, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' @@ -250,8 +249,5 @@ const Map> localizedValues = { 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, - 'replySuccessfully': { - 'en': 'Reply Successfully', - 'ar': 'تم الرد بنجاح' - }, + 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, }; diff --git a/lib/landing_page.dart b/lib/landing_page.dart index f67957d3..9461e3a3 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -40,9 +40,7 @@ class _LandingPageState extends State { appBar: AppBar( elevation: 0, backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme( - headline6: - TextStyle(color: Colors.white)), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), title: Text(getText(currentTab).toUpperCase()), leading: Builder( builder: (BuildContext context) { diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index dfb61d95..faa22ffe 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -76,324 +76,294 @@ class _ReferPatientState extends State { RoundedContainer( margin: 10, showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedClinic, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = null; - _selectedClinic = newValue; - var clinicInfo = model - .clinicsList - .where((i) => - i['ClinicDescription'] - .toString() - .contains( - _selectedClinic)) - .toList(); + raduis: 10, + borderColor: Color(0xff707070), + 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: DropdownButton( + isExpanded: true, + value: _selectedClinic, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getClinicNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = null; + _selectedClinic = newValue; + var clinicInfo = model.clinicsList + .where((i) => i['ClinicDescription'] + .toString() + .contains(_selectedClinic)) + .toList(); - clinicId = clinicInfo[0]['ClinicID'] - .toString(); + clinicId = + clinicInfo[0]['ClinicID'].toString(); - model.getDoctorsList(clinicId); - }) - }, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + model.getDoctorsList(clinicId); + }) + }, + items: model.getClinicNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), - //--------------------------------------------------------------------// - AppText( - TranslationBase.of(context).doctor, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + ], + ), + ), + ), + //--------------------------------------------------------------------// + AppText( + TranslationBase.of(context).doctor, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedDoctor, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getDoctorNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = newValue; - doctorsList = - model.doctorsList; + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 10, + borderColor: Color(0xff707070), + 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: DropdownButton( + isExpanded: true, + value: _selectedDoctor, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model.getDoctorNameList().map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedDoctor = newValue; + doctorsList = model.doctorsList; - var doctorInfo = doctorsList - .where((i) => i['DoctorName'] - .toString() - .contains(_selectedDoctor)) - .toList(); - doctorId = doctorInfo[0]['DoctorID'] - .toString(); - }) - }, - items: model - .getDoctorNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + var doctorInfo = doctorsList + .where((i) => i['DoctorName'] + .toString() + .contains(_selectedDoctor)) + .toList(); + doctorId = + doctorInfo[0]['DoctorID'].toString(); + }) + }, + items: model.getDoctorNameList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), //-----------------------------/// - AppText( - TranslationBase.of(context).ext, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).ext, - controller: _extController, - inputFormatter: ONLY_NUMBERS, - textInputType: TextInputType.number, - onChanged: (value) => {}, - ), - ), - AppText( - TranslationBase.of(context).priority, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + ], + ), + ), + ), //-----------------------------/// + AppText( + TranslationBase.of(context).ext, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: TranslationBase.of(context).ext, + controller: _extController, + inputFormatter: ONLY_NUMBERS, + textInputType: TextInputType.number, + onChanged: (value) => {}, + ), + ), + AppText( + TranslationBase.of(context).priority, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - priorityBar(context), + priorityBar(context), - AppText( - TranslationBase.of(context).referralFrequency + - getPriority(), - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), + AppText( + TranslationBase.of(context).referralFrequency + + getPriority(), + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), - AppText( - TranslationBase.of(context).referralFrequency, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 10, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedReferralFrequancy, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getReferralNamesList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedReferralFrequancy = newValue; - var freqInfo = model - .referalFrequancyList - .singleWhere((i) => i[ - 'Description'] - .toString() - .contains( - _selectedReferralFrequancy)); - freqId = freqInfo['ParameterCode'] - .toString(); - myFocusNode.requestFocus(); - }) - }, - items: model - .getReferralNamesList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), + AppText( + TranslationBase.of(context).referralFrequency, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + RoundedContainer( + margin: 10, + showBorder: true, + raduis: 10, + borderColor: Color(0xff707070), + 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: DropdownButton( + isExpanded: true, + value: _selectedReferralFrequancy, + iconSize: 40, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return model + .getReferralNamesList() + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + _selectedReferralFrequancy = newValue; + var freqInfo = model.referalFrequancyList + .singleWhere((i) => i['Description'] + .toString() + .contains( + _selectedReferralFrequancy)); + freqId = + freqInfo['ParameterCode'].toString(); + myFocusNode.requestFocus(); + }) + }, + items: model.getReferralNamesList().map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: TextAlign.end, ), - ), - ], + ); + }).toList(), ), ), - ), - AppText( - TranslationBase.of(context).clinicDetailsandRemarks, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).remarks, - focusNode: myFocusNode, - controller: _remarksController, - inputFormatter: ONLY_LETTERS, - textInputType: TextInputType.text, - onChanged: (value) => {}, + ], + ), + ), + ), + AppText( + TranslationBase.of(context).clinicDetailsandRemarks, + fontSize: 18, + fontWeight: FontWeight.bold, + marginLeft: 15, + marginTop: 15, + ), + Padding( + padding: const EdgeInsets.all(10.0), + child: AppTextFormField( + hintText: TranslationBase.of(context).remarks, + focusNode: myFocusNode, + controller: _remarksController, + inputFormatter: ONLY_LETTERS, + textInputType: TextInputType.text, + onChanged: (value) => {}, + ), + ), + Padding( + padding: const EdgeInsets.all(20.0), + child: Column( + children: [ + AppText( + TranslationBase.of(context).pleaseFill, + color: Colors.red, + fontWeight: FontWeight.bold, + margin: 10, + visibility: isValid == null ? false : !isValid, ), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - children: [ - AppText( - TranslationBase.of(context).pleaseFill, - color: Colors.red, - fontWeight: FontWeight.bold, - margin: 10, - visibility: - isValid == null ? false : !isValid, - ), - // TODO replace AppButton with secondary button and add loading - AppButton( - title: TranslationBase - .of(context) - .send, - color: Color(PRIMARY_COLOR), - onPressed: () => - { - referToDoctor(context, model) - }, - title: TranslationBase.of(context).send, - color: (Hexcolor("#B8382B")), - onPressed: () => {referToDoctor(context)}, - ) - ], - )) - ], + // TODO replace AppButton with secondary button and add loading + AppButton( + title: TranslationBase.of(context).send, + color: Color(PRIMARY_COLOR), + onPressed: () => {referToDoctor(context, model)}, + ) + ], + )) + ], + ), ), - ), - ),); + ), + ); } Widget priorityBar(BuildContext _context) { @@ -436,30 +406,29 @@ class _ReferPatientState extends State { // ? Hexcolor("#B8382B") // : Colors.white,//sideColor, - fontWeight: FontWeight.bold, - ), + fontWeight: FontWeight.bold, ), - )), - ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - alignment: Alignment.center, - height: 3, - width: 90, - ) - : Container() - ]); - }).toList(), - ), + ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + alignment: Alignment.center, + height: 3, + width: 90, + ) + : Container() + ]); + }).toList(), ), ); } @@ -488,10 +457,7 @@ class _ReferPatientState extends State { return; } - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; try { @@ -508,8 +474,7 @@ class _ReferPatientState extends State { selectedDoctorID: doctorId.toString(), projectID: patient.projectId); // TODO: Add Translation - DrAppToastMsg.showSuccesToast( - 'Reply Successfully'); + DrAppToastMsg.showSuccesToast('Reply Successfully'); Navigator.pop(context); } catch (e) { DrAppToastMsg.showErrorToast(e); diff --git a/pubspec.lock b/pubspec.lock index ae4f6a70..23540004 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "12.0.0" + version: "14.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.40.6" + version: "0.41.1" archive: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: build_config url: "https://pub.dartlang.org" source: hosted - version: "0.4.4" + version: "0.4.5" build_daemon: dependency: transitive description: @@ -84,7 +84,7 @@ packages: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.1" + version: "3.0.2" build_resolvers: dependency: transitive description: @@ -98,21 +98,21 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.7" + version: "1.10.9" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.2" + version: "6.1.4" build_web_compilers: dependency: "direct dev" description: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.12.2" + version: "2.15.3" built_collection: dependency: transitive description: @@ -161,7 +161,7 @@ packages: name: checked_yaml url: "https://pub.dartlang.org" source: hosted - version: "1.0.2" + version: "1.0.4" cli_util: dependency: transitive description: @@ -426,7 +426,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -468,7 +468,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -622,7 +622,7 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.5" + version: "0.1.7" quiver: dependency: transitive description: @@ -725,7 +725,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -767,7 +767,7 @@ packages: name: timing url: "https://pub.dartlang.org" source: hosted - version: "0.1.1+2" + version: "0.1.1+3" typed_data: dependency: transitive description: @@ -860,5 +860,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.11.0-162.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From cc1a63786f9918d5ebff8be06d7283ee2208f021 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 14 Dec 2020 17:58:19 +0300 Subject: [PATCH 004/421] sick leave --- assets/images/sick_leaves_icons.png | Bin 0 -> 3073 bytes lib/config/localized_values.dart | 12 +- lib/routes.dart | 5 +- lib/screens/sick-leave/sick_leave.dart | 286 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 11 +- lib/widgets/auth/verfiy_account.dart | 1 + .../profile/profile_medical_info_widget.dart | 8 + lib/widgets/shared/app_text_form_field.dart | 86 +++--- 8 files changed, 364 insertions(+), 45 deletions(-) create mode 100644 assets/images/sick_leaves_icons.png create mode 100644 lib/screens/sick-leave/sick_leave.dart diff --git a/assets/images/sick_leaves_icons.png b/assets/images/sick_leaves_icons.png new file mode 100644 index 0000000000000000000000000000000000000000..67a9c93796a11a9856362cff6ce3b1394e401da0 GIT binary patch literal 3073 zcmV+c4F200YiZU{S8ih#;gocko(@1KGl7ED_xd28MST=DwKcl5-*?tdTaG``64d8k6G@k=-J~!`TKm{#*g^_a; zL!Z3jA^w5xthS%<4DikLM zseMZF&#I7fdqK_ZHIfREP|j3DNB3dluSo!Q@p}1rRLn{{mUNM0K*BCF$z=Yc=J+sk z-JCIv0ihG<;*d8Q$EW86nhl^^6oEV-%ky?MMgwETFc`1)YnkV_auw#|WFMR`KMHZJ znE0KvOn3e32}a_BnY8OLNK&|yLfqp{+V=83x(ZHhC`G!mE2c8(Vf=+ z6y<25TrKq8%Sa{p;rogUT*+F-0r)Yu7XtVrO<4AZGswmJp^EX*01nnj*S|5(%JRZc zT2(dUL)kVSql}rZS*!wgq3IvWG)PaL;H>QC7`)w)0FH_3#si=?$LSNpy>3=}@=6a% z{UD4~d)bZ*Yd;8Nzxxh1S6Qk{0DPNqRh*Ex@9SJ0GR`BMbeI6#Vz7$+(%kDjAs+Kq zb>c5V=5rb&$gO#8#Ltr7j{~(Pht$W03=S*^eyQ&DTfg%w6=mHN#&a0-H8E4#!<(&% zVY!Nfc{0m5QVZ>$FhD;_^I9Un3H*I8BWvg7ULn&dDM_|Ql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A~zvp@PJneJ84wod5OA?UFPXaZpE!bK>nyseyldlSr z!v?|ed|30C?pdaIC*#X7-&B(kNi`3bP$?6sAj{P5WkIEpimd0mm0KBX?qH_{su>y8>+ql~%!@ z<;+67sO%0Fa2_DLvYq#d75V(0+a9!#^T;9$C6im0W1E57FZXf3dXis2u#uLW*mvC) z;v1F4(j>T)rWxsDlimnX;D-a|v0^#G+skqmrz6E>`L0J%RBTJo7Xbbb+gfe%c}Q4o P00000NkvXXu0mjfS3urD literal 0 HcmV?d00001 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0b176b65..b33d8268 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -242,15 +242,17 @@ const Map> localizedValues = { 'ar': 'لا يوجد اي نتائج' }, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, - 'replySuccessfully': { - 'en': 'Reply Successfully', - 'ar': 'تم الرد بنجاح' - }, + 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, + "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"}, + "submit": {"en": "Submit", "ar": "ارسال"}, + "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, + "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, + "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, + "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."} }; diff --git a/lib/routes.dart b/lib/routes.dart index dff02129..b7da4d2b 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; @@ -74,6 +75,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; +const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), @@ -109,5 +111,6 @@ var routes = { IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), - // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() + // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(), + PATIENT_SICKLEAVE: (_) => SickLeaveScreen() }; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart new file mode 100644 index 00000000..acf9c7a7 --- /dev/null +++ b/lib/screens/sick-leave/sick_leave.dart @@ -0,0 +1,286 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +Helpers helpers = Helpers(); + +class SickLeaveScreen extends StatefulWidget { + @override + _SickLeaveScreenState createState() => _SickLeaveScreenState(); +} + +class _SickLeaveScreenState extends State { + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + TextEditingController _toDateController = new TextEditingController(); + String _selectedClinic; + Map profile = {}; + void _presentDatePicker(id) { + showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2019), + lastDate: DateTime.now(), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + var selectedDate = DateFormat.yMd().format(pickedDate); + _toDateController.text = selectedDate; + }); + }); + } + + @override + void initState() { + getProfile(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getClinicsList(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: Center( + child: Container( + margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).sickLeaveDays, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ]), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).sickLeaveDate, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onSaved: (value) {}), + ], + )), + RoundedContainer( + // margin: 10, + showBorder: true, + // raduis: 30, + borderColor: HexColor("#CCCCCC"), + 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: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinicName, + fontSize: 10, + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName(model), + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).doctorName, + fontSize: 10, + ), + AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ], + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ], + ), + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).submit, + onPressed: () { + // _validateInputs(); + }, + ), + ], + ), + ) + ], + ), + ), + ), + ), + )); + } + + getProfile() async { + Map p = await sharedPref.getObj(DOCTOR_PROFILE); + setState(() { + this.profile = p; + }); + } + + getClinicName(model) { + var clinicInfo = model.clinicsList + .where((i) => i['ClinicID'] == this.profile['ClinicID']) + .toList(); + print(clinicInfo); + return clinicInfo[0]['ClinicDescription']; + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1eabaea8..73e6f11d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -33,7 +33,8 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; @@ -277,6 +278,14 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; + String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String get submit => localizedValues['submit'][locale.languageCode]; + String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String get sickLeaveDate => + localizedValues['sick-leave-date'][locale.languageCode]; + String get sickLeaveDays => + localizedValues['sick-leave-days'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 1f64aa5b..bd66d511 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -396,6 +396,7 @@ class _VerifyAccountState extends State { Map profile, Function changeLoadingStata) { var doctor = DoctorProfileModel.fromJson(profile); authProv.setDoctorProfile(doctor); + sharedPref.setObj(DOCTOR_PROFILE, profile); this.getDashboard(doctor, changeLoadingStata); } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 092edb02..3b9d4f48 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -82,6 +82,14 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PATIENT_ORDERS, name: TranslationBase.of(context).orders, icon: 'radiology-1.png')), + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5, + child: PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_SICKLEAVE, + name: TranslationBase.of(context).sickleave, + icon: 'sick_leaves_icons.png')), ]); } } diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index a0e91748..15a3941a 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -24,6 +24,7 @@ class AppTextFormField extends FormField { ValueChanged onFieldSubmitted, IconButton prefix, String labelText, + bool readOnly = false, borderColor}) : super( onSaved: onSaved, @@ -33,44 +34,53 @@ class AppTextFormField extends FormField { return Column( children: [ SizedBox( - height: 40.0, - child: TextFormField( - focusNode: focusNode, - keyboardType: textInputType, - inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)), - ],onChanged: onChanged?? (value){ - state.didChange(value); - }, - textInputAction: textInputAction, - onFieldSubmitted: onFieldSubmitted, - decoration: InputDecoration( - hintText: hintText, - suffixIcon: prefix, - hintStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.8,), - contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - labelText: labelText, - labelStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7,), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide( - color: borderColor != null ? borderColor : HexColor( - "#CCCCCC")), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: borderColor != null ? borderColor : HexColor( - "#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6)), - ) - //BorderRadius.all(Radius.circular(20)); - ), - onTap: onTap, - controller: controller, - ), - ), - state.hasError + height: 40.0, + child: TextFormField( + readOnly: readOnly, + focusNode: focusNode, + keyboardType: textInputType, + inputFormatters: [ + WhitelistingTextInputFormatter(RegExp(inputFormatter)), + ], + onChanged: onChanged ?? + (value) { + state.didChange(value); + }, + textInputAction: textInputAction, + onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( + hintText: hintText, + suffixIcon: prefix, + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.8, + ), + contentPadding: + EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + labelText: labelText, + labelStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(6)), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6)), + ) + //BorderRadius.all(Radius.circular(20)); + ), + onTap: onTap, + controller: controller, + ), + ), + state.hasError ? Text( state.errorText, style: TextStyle(color: Colors.red), From 76e10459e0d8c76cdb84c9cd32dd4c1a37007c7d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 15 Dec 2020 07:47:11 +0300 Subject: [PATCH 005/421] sick leave --- lib/screens/sick-leave/sick_leave.dart | 3 ++- .../profile/profile_medical_info_widget.dart | 17 +++++++++++------ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index acf9c7a7..c43bd77f 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -149,7 +149,8 @@ class _SickLeaveScreenState extends State { ignoring: true, child: DropdownButton( isExpanded: true, - value: getClinicName(model), + value: getClinicName(model) ?? + "", iconSize: 40, elevation: 16, selectedItemBuilder: diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 23d68ae5..d72d0c5a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -97,7 +97,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: PATIENT_SICKLEAVE, - name: TranslationBase.of(context).sickleave, + nameLine1: TranslationBase.of(context).sickleave, + nameLine2: "", icon: 'sick_leaves_icons.png')), ]); } @@ -160,7 +161,12 @@ class PatientProfileButton extends StatelessWidget { final PatiantInformtion patient; final String url = "assets/images/"; PatientProfileButton( - {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) + {Key key, + this.patient, + this.nameLine1, + this.nameLine2, + this.icon, + this.route}) : super(key: key); @override Widget build(BuildContext context) { @@ -174,18 +180,17 @@ class PatientProfileButton extends StatelessWidget { Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), - child: - Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( + AppText( this.nameLine1, color: Color(0xFFB9382C), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 2, ), - AppText( + AppText( this.nameLine2, color: Colors.black, fontWeight: FontWeight.w600, From 900264bc26e308431dde6383a725bd3476007c79 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 15 Dec 2020 09:05:05 +0300 Subject: [PATCH 006/421] sick leave --- lib/core/service/patient_service.dart | 48 ++-- lib/core/viewModel/auth_view_model.dart | 17 -- lib/core/viewModel/patient_view_model.dart | 25 +- lib/screens/dashboard_screen.dart | 280 ++++++++------------- 4 files changed, 159 insertions(+), 211 deletions(-) diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index b16753f5..82cb9a60 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -276,7 +276,7 @@ class PatientService extends BaseService { ); } - Future getPatientInsuranceApprovals(patient) async { + Future getPatientInsuranceApprovals(patient) async { hasError = false; await baseAppClient.post( @@ -293,7 +293,7 @@ class PatientService extends BaseService { ); } - Future getPatientProgressNote(patient) async { + Future getPatientProgressNote(patient) async { hasError = false; await baseAppClient.post( @@ -310,7 +310,6 @@ class PatientService extends BaseService { ); } - Future getClinicsList() async { hasError = false; @@ -328,7 +327,6 @@ class PatientService extends BaseService { ); } - Future getReferralFrequancyList() async { hasError = false; @@ -363,19 +361,19 @@ class PatientService extends BaseService { ); } - // TODO send the total model insted of each parameter - Future referToDoctor({String selectedDoctorID, - String selectedClinicID, - int admissionNo, - String extension, - String priority, - String frequency, - String referringDoctorRemarks, - int patientID, - int patientTypeID, - String roomID, - int projectID}) async { + Future referToDoctor( + {String selectedDoctorID, + String selectedClinicID, + int admissionNo, + String extension, + String priority, + String frequency, + String referringDoctorRemarks, + int patientID, + int patientTypeID, + String roomID, + int projectID}) async { hasError = false; // TODO Change it to use it when we implement authentication user Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -409,4 +407,22 @@ class PatientService extends BaseService { body: _referToDoctorRequest.toJson(), ); } + + Future getDashboard() async { + try { + dynamic localRes; + hasError = false; + await baseAppClient.post(GET_DASHBOARD, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: {}); + // notifyListeners(); + return Future.value(localRes); + } catch (error) { + hasError = true; + super.error = error; + } + } } diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index d4c00ca3..26dc78d8 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -167,21 +167,4 @@ class AuthViewModel with ChangeNotifier { throw error; } } - - Future getDashboard(docInfo) async { - try { - dynamic localRes; - await baseAppClient.post(GET_DASHBOARD, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: {"DoctorID": docInfo.doctorID}); - notifyListeners(); - return Future.value(localRes); - } catch (error) { - print(error); - throw error; - } - } } diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index f39a3d48..c1339fd0 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -48,7 +48,7 @@ class PatientViewModel extends BaseViewModel { get referalFrequancyList => _patientService.referalFrequancyList; Future getPatientList(PatientModel patient, patientType, {bool isBusyLocal = false}) async { - if(isBusyLocal) { + if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); @@ -56,11 +56,23 @@ class PatientViewModel extends BaseViewModel { return _patientService.getPatientList(patient, patientType); if (_patientService.hasError) { error = _patientService.error; - if(isBusyLocal) { + if (isBusyLocal) { setState(ViewState.ErrorLocal); } else { setState(ViewState.Error); - } } else + } + } else + setState(ViewState.Idle); + } + + Future getDashboard() async { + setState(ViewState.Busy); + await _patientService.getDashboard(); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.Idle); + //setState(ViewState.Error); + } else setState(ViewState.Idle); } @@ -167,6 +179,7 @@ class PatientViewModel extends BaseViewModel { } } } + Future getDoctorsList(String clinicId) async { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); @@ -182,8 +195,9 @@ class PatientViewModel extends BaseViewModel { } List getDoctorNameList() { - var doctorNamelist = - _patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList(); + var doctorNamelist = _patientService.doctorsList + .map((value) => value['DoctorName'].toString()) + .toList(); return doctorNamelist; } @@ -193,6 +207,7 @@ class PatientViewModel extends BaseViewModel { .toList(); return clinicsNameslist; } + Future getReferralFrequancyList() async { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 80697352..e9c6341f 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; 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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -69,9 +71,10 @@ class _DashboardScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - return SafeArea( - bottom: true, - child: AppScaffold( + return BaseView( + onModelReady: (model) => model.getDashboard(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, isShowAppBar: false, isLoading: isLoading, body: ListView(children: [ @@ -96,9 +99,7 @@ class _DashboardScreenState extends State { Row( children: [ AppText( - TranslationBase - .of(context) - .welcome, + TranslationBase.of(context).welcome, fontSize: SizeConfig.textMultiplier * 1.7, color: Colors.white, ) @@ -123,8 +124,8 @@ class _DashboardScreenState extends State { showCupertinoPicker( decKey: '', context: context, - actionList: projectsProvider - .doctorClinicsList); + actionList: + projectsProvider.doctorClinicsList); }, child: Row( mainAxisAlignment: @@ -134,11 +135,12 @@ class _DashboardScreenState extends State { child: AppText( authProvider.selectedClinicName != null - ? authProvider.selectedClinicName + ? authProvider + .selectedClinicName : authProvider.doctorProfile .clinicDescription, fontSize: - SizeConfig.textMultiplier * 1.7, + SizeConfig.textMultiplier * 1.7, color: Colors.white, textAlign: TextAlign.center, ), @@ -148,27 +150,29 @@ class _DashboardScreenState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, mainAxisSize: MainAxisSize.max, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ InkWell( - child: Container( margin: EdgeInsets.only( left: 5, top: projectsProvider - .isArabic ? 0 : 5, + .isArabic + ? 0 + : 5, right: 10, bottom: projectsProvider - .isArabic ? 15 : 7), + .isArabic + ? 15 + : 7), child: Icon( DoctorApp.sync_icon, - color: Colors.white, size: SizeConfig - .textMultiplier * + .textMultiplier * 1.8, )), ), @@ -176,20 +180,16 @@ class _DashboardScreenState extends State { ), ]), ), - ], ), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, - children: [ Container( decoration: BoxDecoration( - color: Theme - .of(context) - .backgroundColor, + color: Theme.of(context).backgroundColor, borderRadius: BorderRadius.all( Radius.circular(10.0), ), @@ -197,8 +197,7 @@ class _DashboardScreenState extends State { height: 50, width: 60, child: Image.network( - authProvider.doctorProfile - .doctorImageURL, + authProvider.doctorProfile.doctorImageURL, // fit: BoxFit.fill, ), ), @@ -246,18 +245,18 @@ class _DashboardScreenState extends State { center: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText("38", - fontSize: - SizeConfig.textMultiplier * 3.7, + AppText( + "38", + fontSize: SizeConfig.textMultiplier * 3.7, color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold,), - AppText(TranslationBase - .of(context) - .outPatients, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.4, - color: HexColor('#5D4C35'), - ), + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).outPatients, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 1.4, + color: HexColor('#5D4C35'), + ), ], ), circularStrokeCap: CircularStrokeCap.butt, @@ -418,15 +417,12 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .labResult, + TranslationBase.of(context).labResult, color: Colors.white, ) ], ), ), - ], ), imageName: '1.png', @@ -446,7 +442,6 @@ class _DashboardScreenState extends State { ), Container( margin: EdgeInsets.only(bottom: 10), - child: Column( children: [ AppText( @@ -455,15 +450,12 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .radiology, + TranslationBase.of(context).radiology, color: Colors.white, ) ], ), ), - ], ), imageName: '2.png', @@ -481,10 +473,8 @@ class _DashboardScreenState extends State { color: Colors.white, ), ), - Container( margin: EdgeInsets.only(bottom: 10), - child: Column( children: [ AppText( @@ -493,20 +483,16 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .referral, + TranslationBase.of(context).referral, color: Colors.white, ) ], ), ), - ], ), imageName: '3.png', opacity: 0.9, - ), ], ), @@ -522,7 +508,7 @@ class _DashboardScreenState extends State { padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( children: [ @@ -542,9 +528,7 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .inPatient, + TranslationBase.of(context).inPatient, color: Colors.white, ) ], @@ -555,28 +539,18 @@ class _DashboardScreenState extends State { imageName: '4.png', color: HexColor('#B8382C'), hasBorder: false, - width: MediaQuery - .of(context) - .size - .width * 0.44, - height: MediaQuery - .of(context) - .orientation == Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * 0.13: - MediaQuery - .of(context) - .size - .height * 0.25, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.13 + : MediaQuery.of(context).size.height * 0.25, ), DashboardItem( child: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( children: [ @@ -596,9 +570,7 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .operations, + TranslationBase.of(context).operations, color: Colors.white, ) ], @@ -609,21 +581,11 @@ class _DashboardScreenState extends State { imageName: '5.png', color: HexColor('#B8382C'), hasBorder: false, - width: MediaQuery - .of(context) - .size - .width * 0.44, - height: MediaQuery - .of(context) - .orientation == Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * 0.13: - MediaQuery - .of(context) - .size - .height * 0.25, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.13 + : MediaQuery.of(context).size.height * 0.25, ), ], ), @@ -633,9 +595,7 @@ class _DashboardScreenState extends State { Row( children: [ AppText( - TranslationBase - .of(context) - .patientServices, + TranslationBase.of(context).patientServices, fontSize: SizeConfig.textMultiplier * 3, ), ], @@ -691,16 +651,12 @@ class _DashboardScreenState extends State { Column( children: [ AppText( - TranslationBase - .of(context) - .theDoctor, + TranslationBase.of(context).theDoctor, textAlign: TextAlign.center, color: Colors.black, ), AppText( - TranslationBase - .of(context) - .reply, + TranslationBase.of(context).reply, textAlign: TextAlign.center, color: Colors.black, ), @@ -713,8 +669,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - DoctorReplyScreen(), + builder: (context) => DoctorReplyScreen(), ), ); }, @@ -729,9 +684,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .searchMedicine, + TranslationBase.of(context).searchMedicine, color: Colors.black, textAlign: TextAlign.center, ) @@ -742,8 +695,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MedicineSearchScreen(), + builder: (context) => MedicineSearchScreen(), ), ); }, @@ -777,12 +729,8 @@ class _DashboardScreenState extends State { ), AppText( projectsProvider.isArabic - ? TranslationBase - .of(context) - .qr - : TranslationBase - .of(context) - .reader, + ? TranslationBase.of(context).qr + : TranslationBase.of(context).reader, color: Colors.black, textAlign: TextAlign.center, ), @@ -806,9 +754,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .myReferralPatient, + TranslationBase.of(context).myReferralPatient, textAlign: TextAlign.center, color: Colors.black, ) @@ -819,8 +765,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MyReferralPatient(), + builder: (context) => MyReferralPatient(), ), ); }, @@ -835,9 +780,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .myReferredPatient, + TranslationBase.of(context).myReferredPatient, color: Colors.black, textAlign: TextAlign.center, ) @@ -848,8 +791,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MyReferredPatient(), + builder: (context) => MyReferredPatient(), ), ); }, @@ -890,21 +832,17 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: AppText(TranslationBase - .of(context) - .cancel - // style: TextStyle(context) - ), + child: AppText(TranslationBase.of(context).cancel + // style: TextStyle(context) + ), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( - child: AppText(TranslationBase - .of(context) - .done - // style: textStyle(context), - ), + child: AppText(TranslationBase.of(context).done + // style: textStyle(context), + ), onPressed: () { Navigator.pop(context); // onSelectFun(cupertinoPickerIndex); @@ -927,8 +865,7 @@ class _DashboardScreenState extends State { child: AppText( e.clinicName, fontSize: - SizeConfig.textMultiplier * - 1.9, + SizeConfig.textMultiplier * 1.9, )), ), )) @@ -969,19 +906,20 @@ class _DashboardScreenState extends State { }); } } + // TODO Move to it file class DashboardItem extends StatelessWidget { - const DashboardItem({ - this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4 - }) : super(key: key); + const DashboardItem( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4}) + : super(key: key); final bool hasBorder; final String imageName; final Widget child; @@ -996,38 +934,34 @@ class DashboardItem extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: width != null ? width : MediaQuery - .of(context) - .size - .width * 0.29, - height: height != null ? height : MediaQuery - .of(context) - .orientation == Orientation.portrait ? MediaQuery - .of(context) - .size - .height * 0.19 : MediaQuery - .of(context) - .size - .height * 0.35, - + width: width != null ? width : MediaQuery.of(context).size.width * 0.29, + height: height != null + ? height + : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( - color: !hasBorder ? color != null ? color : HexColor('#050705') - .withOpacity(opacity) : Colors - .white, + color: !hasBorder + ? color != null + ? color + : HexColor('#050705').withOpacity(opacity) + : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder ? Border.all( - width: 1.0, color: const Color(0xffcccccc)) : Border.all( - width: 0.0, color: Colors.transparent), - image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/${imageName}'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - - ) : null, - + border: hasBorder + ? Border.all(width: 1.0, color: const Color(0xffcccccc)) + : Border.all(width: 0.0, color: Colors.transparent), + image: imageName != null + ? DecorationImage( + image: AssetImage('assets/images/dashboard/${imageName}'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) + : null, + ), + child: Center( + child: child, ), - child: Center(child: child,), ), ); } From bb1f101e947f36a4b59040cbc1fa02b693975341 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 15 Dec 2020 10:39:27 +0200 Subject: [PATCH 007/421] finish re-design refer-patient screen --- lib/config/localized_values.dart | 4 + lib/core/viewModel/patient_view_model.dart | 7 +- .../profile/refer_patient_screen.dart | 683 ++++++++---------- lib/util/translations_delegate_base.dart | 8 +- .../profile/patient_profile_widget.dart | 136 ++-- lib/widgets/shared/app_text_form_field.dart | 2 +- .../shared/dialogs/dailog-list-select.dart | 89 +++ 7 files changed, 470 insertions(+), 459 deletions(-) create mode 100644 lib/widgets/shared/dialogs/dailog-list-select.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0dee26b9..2b84f389 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -201,6 +201,7 @@ const Map> localizedValues = { 'routine': {'en': 'Routine', 'ar': 'روتيني'}, 'send': {'en': 'Send', 'ar': 'ارسال'}, 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, + 'selectReferralFrequency': {'en': 'Select Referral Frequency:', 'ar': 'اختار تواتر الحالة:'}, 'clinicalDetailsAndRemarks': { 'en': 'Clinical Details and Remarks', 'ar': 'التفاصيل السرسرية والملاحظات' @@ -229,6 +230,7 @@ const Map> localizedValues = { 'beingBad': {'en': 'being bad', 'ar': 'سيء'}, 'beingGreat': {'en': 'being great', 'ar': 'رائع'}, 'cancel': {'en': 'CANCEL', 'ar': 'الغاء'}, + 'ok': {'en': 'OK', 'ar': 'موافق'}, 'done': {'en': 'DONE', 'ar': 'تأكيد'}, 'resumecall': {'en': 'Resume call', 'ar': 'استئناف المكالمة'}, 'endcallwithcharge': {'en': 'End with charge', 'ar': 'ينتهي مع الشحن'}, @@ -273,4 +275,6 @@ const Map> localizedValues = { 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, + 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, + 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, }; diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index f39a3d48..6fdbde32 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -42,10 +42,10 @@ class PatientViewModel extends BaseViewModel { get patientProgressNoteList => _patientService.patientProgressNoteList; - get clinicsList => _patientService.clinicsList; - get doctorsList => _patientService.doctorsList; + List get clinicsList => _patientService.clinicsList; + List get doctorsList => _patientService.doctorsList; + List get referralFrequencyList => _patientService.referalFrequancyList; - get referalFrequancyList => _patientService.referalFrequancyList; Future getPatientList(PatientModel patient, patientType, {bool isBusyLocal = false}) async { if(isBusyLocal) { @@ -167,6 +167,7 @@ class PatientViewModel extends BaseViewModel { } } } + Future getDoctorsList(String clinicId) async { setState(ViewState.BusyLocal); await _patientService.getDoctorsList(clinicId); diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index ffef05e6..79d2789d 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -6,9 +6,11 @@ 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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -34,26 +36,18 @@ class ReferPatientScreen extends StatefulWidget { } class _ReferPatientState extends State { - var doctorsList; - final _remarksController = TextEditingController(); + dynamic _selectedClinic; + dynamic _selectedDoctor; final _extController = TextEditingController(); - var _isInit = true; - bool isValid; - - var clinicId; - var doctorId; - var freqId; - - String _selectedClinic; - String _selectedDoctor; - String _selectedReferralFrequancy; - int _activePriority = 1; - - FocusNode myFocusNode = FocusNode(); + dynamic _selectedFrequency; + final _remarksController = TextEditingController(); + bool isValid; @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => AppScaffold( @@ -62,399 +56,255 @@ class _ReferPatientState extends State { body: model.clinicsList == null ? DrAppEmbeddedError(error: 'Something Wrong!') : SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinic, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedClinic, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = null; - _selectedClinic = newValue; - var clinicInfo = model - .clinicsList - .where((i) => - i['ClinicDescription'] - .toString() - .contains( - _selectedClinic)) - .toList(); - - clinicId = clinicInfo[0]['ClinicID'] - .toString(); - - model.getDoctorsList(clinicId); - }) - }, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), - ), - ), - ], - ), - ), - ), - //--------------------------------------------------------------------// - AppText( - TranslationBase.of(context).doctor, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedDoctor, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getDoctorNameList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedDoctor = newValue; - doctorsList = - model.doctorsList; - - var doctorInfo = doctorsList - .where((i) => i['DoctorName'] - .toString() - .contains(_selectedDoctor)) - .toList(); - doctorId = doctorInfo[0]['DoctorID'] - .toString(); - }) - }, - items: model - .getDoctorNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), - ), - ), - ], - ), - ), - ), //-----------------------------/// - AppText( - TranslationBase.of(context).ext, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).ext, - controller: _extController, - inputFormatter: ONLY_NUMBERS, - textInputType: TextInputType.number, - onChanged: (value) => {}, - ), - ), - AppText( - TranslationBase.of(context).priority, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - - priorityBar(context), - - AppText( - TranslationBase.of(context).referralFrequency + - getPriority(), - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, + child: Container( + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.clinicsList != null && + model.clinicsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.clinicsList, + attributeName: 'ClinicDescription', + attributeValueId: 'ClinicID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = null; + _selectedClinic = selectedValue; + model.getDoctorsList( + _selectedClinic['ClinicID'] + .toString()); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).clinicSelect, + _selectedClinic != null + ? _selectedClinic['ClinicDescription'] + : null, + true), + enabled: false, ), - - AppText( - TranslationBase.of(context).referralFrequency, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doctorSelect, + _selectedDoctor != null + ? _selectedDoctor['DoctorName'] + : null, + true), + enabled: false, ), - RoundedContainer( - margin: 10, - showBorder: true, - raduis: 30, - borderColor: Color(0xff707070), - 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: DropdownButton( - isExpanded: true, - value: _selectedReferralFrequancy, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getReferralNamesList() - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - _selectedReferralFrequancy = newValue; - var freqInfo = model - .referalFrequancyList - .singleWhere((i) => i[ - 'Description'] - .toString() - .contains( - _selectedReferralFrequancy)); - freqId = freqInfo['ParameterCode'] - .toString(); - myFocusNode.requestFocus(); - }) - }, - items: model - .getReferralNamesList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: TextAlign.end, - ), - ); - }).toList(), - ), - ), - ], - ), - ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).ext, null, false), + enabled: true, + controller: _extController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + priorityBar(context, screenSize), + SizedBox( + height: 20, + ), + AppText( + "${TranslationBase.of(context).referralFrequency} ${getPriority()}", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 20, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.referralFrequencyList != null && + model.referralFrequencyList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.referralFrequencyList, + attributeName: 'Description', + attributeValueId: 'ParameterCode', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedFrequency = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .selectReferralFrequency, + _selectedFrequency != null + ? _selectedFrequency['Description'] + : null, + true), + enabled: false, ), - AppText( + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: textFieldSelectorDecoration( TranslationBase.of(context).clinicDetailsandRemarks, - fontSize: 18, - fontWeight: FontWeight.bold, - marginLeft: 15, - marginTop: 15, - ), - Padding( - padding: const EdgeInsets.all(10.0), - child: AppTextFormField( - hintText: TranslationBase.of(context).remarks, - focusNode: myFocusNode, - controller: _remarksController, - inputFormatter: ONLY_LETTERS, - textInputType: TextInputType.text, - onChanged: (value) => {}, + null, + false), + enabled: true, + controller: _remarksController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_LETTERS)) + ], + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + child: Column( + children: [ + AppText( + TranslationBase.of(context).pleaseFill, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + margin: 10, + visibility: isValid == null ? false : !isValid, ), - ), - Padding( - padding: const EdgeInsets.all(20.0), - child: Column( - children: [ - AppText( - TranslationBase.of(context).pleaseFill, - color: Colors.red, - fontWeight: FontWeight.bold, - margin: 10, - visibility: - isValid == null ? false : !isValid, - ), - // TODO replace AppButton with secondary button and add loading - AppButton( - title: TranslationBase - .of(context) - .send, - color: Color(PRIMARY_COLOR), - onPressed: () => - { - referToDoctor(context, model) - }, - ) - ], - )) - ], + // TODO replace AppButton with secondary button and add loading + AppButton( + title: TranslationBase.of(context).send, + color: HexColor("#B8382B"), + onPressed: () => {referToDoctor(context, model)}, + ) + ], + ), + ), + ], + ), + ), ), - ), - ),); + ), + ); } - Widget priorityBar(BuildContext _context) { + Widget priorityBar(BuildContext _context, Size screenSize) { List _priorities = [ TranslationBase.of(context).veryUrgent, TranslationBase.of(context).urgent, TranslationBase.of(context).routine, ]; return Container( - height: MediaQuery.of(context).size.height * 0.065, - width: SizeConfig.screenWidth * 0.9, - margin: EdgeInsets.only(top: 10), - decoration: BoxDecoration( - color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)), + height: screenSize.height * 0.070, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: _priorities.map((item) { bool _isActive = _priorities[_activePriority] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Container( - height: 40, - width: 90, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(50), - color: _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - // backgroundColor:_isActive - // ? Hexcolor("#B8382B") - // : Colors.white,//sideColor, - - fontWeight: FontWeight.bold, - ), + return Expanded( + child: InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + fontWeight: FontWeight.bold, ), - )), - ), - onTap: () { - print(_priorities.indexOf(item)); - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - alignment: Alignment.center, - height: 3, - width: 90, - ) - : Container() - ]); + ), + )), + ), + onTap: () { + print(_priorities.indexOf(item)); + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }, + ), + ); }).toList(), ), ); @@ -484,10 +334,7 @@ class _ReferPatientState extends State { return; } - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; try { @@ -495,17 +342,16 @@ class _ReferPatientState extends State { extension: _extController.value.text, admissionNo: int.parse(patient.admissionNo), referringDoctorRemarks: _remarksController.value.text, - frequency: freqId, + frequency: _selectedFrequency['ParameterCode'].toString(), patientID: patient.patientId, patientTypeID: patient.patientType, priority: (_activePriority + 1).toString(), roomID: patient.roomId, - selectedClinicID: clinicId.toString(), - selectedDoctorID: doctorId.toString(), + selectedClinicID: _selectedClinic['ClinicID'].toString(), + selectedDoctorID: _selectedDoctor['DoctorID'].toString(), projectID: patient.projectId); // TODO: Add Translation - DrAppToastMsg.showSuccesToast( - 'Reply Successfully'); + DrAppToastMsg.showSuccesToast('Reply Successfully'); Navigator.pop(context); } catch (e) { DrAppToastMsg.showErrorToast(e); @@ -516,10 +362,47 @@ class _ReferPatientState extends State { setState(() { isValid = !_extController.value.text.isNullOrEmpty() && !_remarksController.value.text.isNullOrEmpty() && - freqId != null && - clinicId != null && - doctorId != null; + _selectedClinic != null && + _selectedDoctor != null && + _selectedFrequency != null; }); return isValid; } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 2.0, + )), + ); + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3bea8990..b520fd6f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -106,6 +106,8 @@ class TranslationBase { String get profile => localizedValues['profile'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; String get errorMessage => @@ -220,8 +222,8 @@ class TranslationBase { String get urgent => localizedValues['urgent'][locale.languageCode]; String get routine => localizedValues['routine'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => - localizedValues['referralFrequency'][locale.languageCode]; + String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; + String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -252,6 +254,8 @@ class TranslationBase { String get cancel => localizedValues['cancel'][locale.languageCode]; + String get ok => localizedValues['ok'][locale.languageCode]; + String get done => localizedValues['done'][locale.languageCode]; String get searchMedicineImageCaption => diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 5fefcc1f..ac6c7f0f 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -33,17 +33,13 @@ class PatientProfileWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 10.0, - spreadRadius: 0, - offset: Offset(0, 10) - ), - ], - color: Colors.white - ), + decoration: BoxDecoration(boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 0, + offset: Offset(0, 10)), + ], color: Colors.white), child: Column(children: [ Padding( padding: const EdgeInsets.all(8.0), @@ -102,7 +98,8 @@ class PatientProfileWidget extends StatelessWidget { children: [ Expanded( child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -129,7 +126,8 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -156,7 +154,8 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -221,25 +220,25 @@ class PatientProfileWidget extends StatelessWidget { Row( children: [ Container( - width: 14 * SizeConfig.textMultiplier, + width: + 14 * SizeConfig.textMultiplier, child: AppText( - TranslationBase.of(context).dateTime, + TranslationBase.of(context) + .dateTime, color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, ), ), AppText( patient.admissionDate != null - ? "${DateUtils - .convertDateFromServerFormat( - patient.admissionDate, - 'EEEE dd, MMMM yyyy hh:mm a')}" + ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" : "", color: Colors.black, fontWeight: FontWeight.normal, fontSize: - 1.6 * SizeConfig.textMultiplier, + 1.6 * SizeConfig.textMultiplier, ), ], ), @@ -249,12 +248,15 @@ class PatientProfileWidget extends StatelessWidget { Row( children: [ Container( - width: 14 * SizeConfig.textMultiplier, + width: + 14 * SizeConfig.textMultiplier, child: AppText( - TranslationBase.of(context).admissionNo, + TranslationBase.of(context) + .admissionNo, color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, ), ), AppText( @@ -263,8 +265,8 @@ class PatientProfileWidget extends StatelessWidget { : '', color: Colors.black, fontWeight: FontWeight.normal, - fontSize: 1.6 * - SizeConfig.textMultiplier, + fontSize: + 1.6 * SizeConfig.textMultiplier, ), ], ), @@ -274,24 +276,26 @@ class PatientProfileWidget extends StatelessWidget { Row( children: [ Container( - width: 14 * SizeConfig.textMultiplier, + width: + 14 * SizeConfig.textMultiplier, child: AppText( TranslationBase.of(context).losNo, color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, ), ), AppText( patient.admissionDate != null ? DateUtils - .differenceBetweenServerDateAndCurrent( - patient.admissionDate) + .differenceBetweenServerDateAndCurrent( + patient.admissionDate) : "", color: Colors.black, fontWeight: FontWeight.normal, - fontSize: 1.6 * - SizeConfig.textMultiplier, + fontSize: + 1.6 * SizeConfig.textMultiplier, ), ], ), @@ -311,14 +315,18 @@ class PatientProfileWidget extends StatelessWidget { children: [ Expanded( child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).area, + TranslationBase.of(context) + .area, fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, ), SizedBox( height: 4, @@ -326,7 +334,8 @@ class PatientProfileWidget extends StatelessWidget { AppText( patient.clinicDescription, fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontSize: 1.6 * + SizeConfig.textMultiplier, ), ], ), @@ -338,27 +347,39 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: Padding( - padding: const EdgeInsets.fromLTRB(16.0, 8.0, 8.0, 8.0), + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, children: [ Expanded( child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).room, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + TranslationBase.of( + context) + .room, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, ), SizedBox( width: 4, ), AppText( "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: FontWeight.normal, - fontSize: 1.4 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, ), ], ), @@ -368,20 +389,29 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).bed, - fontWeight: FontWeight.bold, - fontSize: 1.6 * SizeConfig.textMultiplier, + TranslationBase.of( + context) + .bed, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, ), SizedBox( width: 4, ), AppText( "${patient.bedId}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, ), ], ), diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index a0e91748..b9dd3fc2 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -37,7 +37,7 @@ class AppTextFormField extends FormField { child: TextFormField( focusNode: focusNode, keyboardType: textInputType, - inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)), + inputFormatters: [FilteringTextInputFormatter.allow(RegExp(inputFormatter)), ],onChanged: onChanged?? (value){ state.didChange(value); }, diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart new file mode 100644 index 00000000..9e17d53b --- /dev/null +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -0,0 +1,89 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class ListSelectDialog extends StatefulWidget { + final List list; + final String attributeName; + final String attributeValueId; + final okText; + final Function(dynamic) okFunction; + dynamic selectedValue; + + ListSelectDialog( + {@required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction}); + + @override + _ListSelectDialogState createState() => _ListSelectDialogState(); +} + +class _ListSelectDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.list[0]; + } + + @override + Widget build(BuildContext context) { + return showAlertDialog(context); + } + + showAlertDialog(BuildContext context) { + // set up the buttons + Widget cancelButton = FlatButton( + child: Text(TranslationBase.of(context).cancel), + onPressed: () { + Navigator.of(context).pop(); + }); + Widget continueButton = FlatButton( + child: Text(this.widget.okText), + onPressed: () { + this.widget.okFunction(widget.selectedValue); + Navigator.of(context).pop(); + }); +// set up the AlertDialog + AlertDialog alert = AlertDialog( + // title: Text(widget.title), + content: createDialogList(), + actions: [ + cancelButton, + continueButton, + ], + ); + return alert; + } + + Widget createDialogList() { + return Container( + height: MediaQuery.of(context).size.height * 0.5, + child: SingleChildScrollView( + child: Column( + children: [ + ...widget.list + .map((item) => RadioListTile( + title: Text("${item[widget.attributeName].toString()}"), + groupValue: widget.selectedValue[widget.attributeValueId].toString(), + value: item[widget.attributeValueId].toString(), + activeColor: Colors.blue.shade700, + selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), + ); + } + + static closeAlertDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} From 4eee5cd9d88e05ac34454dc0e454b3b77584b99e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 15 Dec 2020 16:57:59 +0200 Subject: [PATCH 008/421] new login type --- lib/config/config.dart | 3 + lib/core/viewModel/auth_view_model.dart | 17 ++++ lib/core/viewModel/project_view_model.dart | 2 +- .../auth/activation_Code_req_model.dart | 48 ++++++++++ .../auth/verification_methods_screen.dart | 5 + lib/widgets/auth/login_form.dart | 8 +- lib/widgets/auth/verification_methods.dart | 96 ++++++++++++++----- 7 files changed, 149 insertions(+), 30 deletions(-) create mode 100644 lib/models/auth/activation_Code_req_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..43e516d3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -71,6 +71,9 @@ const SELECT_DEVICE_IMEI = const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Services/Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; +const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; + const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 9b656d31..fc76fbc3 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -119,6 +120,22 @@ class AuthViewModel with ChangeNotifier { } } + Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { + try { + var localRes; + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel.toJson()); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + Future memberCheckActivationCodeNew(activationCodeModel) async { try { dynamic localRes; diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index a12846c7..9286c64b 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -69,7 +69,7 @@ class ProjectProvider with ChangeNotifier { sharedPref.setString(APP_Language, 'ar'); } else if (lan != "ar" && currentLanguage != lan) { _appLocale = Locale("en"); - _isArabic = false; + _isArabic = false; currentLanguage = 'en'; sharedPref.setString(APP_Language, 'en'); } diff --git a/lib/models/auth/activation_Code_req_model.dart b/lib/models/auth/activation_Code_req_model.dart new file mode 100644 index 00000000..f8f48cd8 --- /dev/null +++ b/lib/models/auth/activation_Code_req_model.dart @@ -0,0 +1,48 @@ +class ActivationCodeModel { + String mobileNumber; + String zipCode; + int channel; + int languageID; + double versionID; + int memberID; + String password; + int facilityId; + String generalid; + + ActivationCodeModel( + {this.mobileNumber, + this.zipCode, + this.channel, + this.languageID, + this.versionID, + this.memberID, + this.password, + this.facilityId, + this.generalid}); + + ActivationCodeModel.fromJson(Map json) { + mobileNumber = json['MobileNumber']; + zipCode = json['ZipCode']; + channel = json['Channel']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + memberID = json['MemberID']; + password = json['Password']; + facilityId = json['facilityId']; + generalid = json['generalid']; + } + + Map toJson() { + final Map data = new Map(); + data['MobileNumber'] = this.mobileNumber; + data['ZipCode'] = this.zipCode; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['MemberID'] = this.memberID; + data['Password'] = this.password; + data['facilityId'] = this.facilityId; + data['generalid'] = this.generalid; + return data; + } +} diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index d5ab66ad..2b411dc0 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -13,9 +13,13 @@ import '../../widgets/auth/verification_methods.dart'; *@desc: Verification Methods screen */ class VerificationMethodsScreen extends StatefulWidget { + const VerificationMethodsScreen({Key key, this.password}) : super(key: key); + @override _VerificationMethodsScreenState createState() => _VerificationMethodsScreenState(); + + final password; } class _VerificationMethodsScreenState extends State { @@ -47,6 +51,7 @@ class _VerificationMethodsScreenState extends State { children: [ AuthHeader(loginType.verificationMethods), VerificationMethods( + password: widget.password, changeLoadingStata: changeLoadingStata, ), ], diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 8cf5f3d4..d7eaeeb6 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; +import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -240,8 +241,8 @@ class _LoginFormState extends State { saveObjToString(LOGGED_IN_USER, res); sharedPref.setString(TOKEN, res['LogInTokenID']); print("token" + res['LogInTokenID']); - - Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS); + Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); + // Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS); } else { // handel error // widget.showCenterShortLoadingToast("watting"); @@ -279,7 +280,8 @@ class _LoginFormState extends State { if (res['MessageStatus'] == 1) { setSharedPref('platformImei', _platformImei); saveObjToString(LOGGED_IN_USER, preRes); - Navigator.of(context).pushNamed(VERIFICATION_METHODS); + Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); + // save imei on shared preferance } else { // handel error diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 2102a125..cb6cb62e 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -1,6 +1,9 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; +import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -11,7 +14,6 @@ import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/helpers.dart'; import '../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -24,8 +26,11 @@ Helpers helpers = Helpers(); *@desc: Verification Methods widget */ class VerificationMethods extends StatefulWidget { - VerificationMethods({this.changeLoadingStata}); + VerificationMethods({this.changeLoadingStata, this.password}); + + final password; final Function changeLoadingStata; + @override _VerificationMethodsState createState() => _VerificationMethodsState(); } @@ -267,40 +272,79 @@ class _VerificationMethodsState extends State { if (oTPSendType == 1 || oTPSendType == 2) { widget.changeLoadingStata(true); + ActivationCodeModel activationCodeModel = ActivationCodeModel( + facilityId: 15, + generalid: "Cs2020@2016\$2958", + memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], + zipCode: _loggedUser['ZipCode'], + mobileNumber: _loggedUser['MobileNumber'], + password: widget.password); + Map model = { - "LogInTokenID": _loggedUser['LogInTokenID'], - "Channel": 9, - "MobileNumber": _loggedUser['MobileNumber'], - "IPAdress": "11.11.11.11", - "LanguageID": 2, - "ProjectID": 15, //TODO : this should become daynamci - "ZipCode": _loggedUser['ZipCode'], - "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], + "OTP_SendType": oTPSendType }; - authProv.sendActivationCodeByOtpNotificationType(model).then((res) { - widget.changeLoadingStata(false); - if (res['MessageStatus'] == 1) { - Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, - arguments: {'model': model}); - } else { - print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); - } - }).catchError((err) { - print('$err'); - widget.changeLoadingStata(false); + try { + authProv + .sendActivationCodeForDoctorApp(activationCodeModel) + .then((res) { + widget.changeLoadingStata(false); + + if (res['MessageStatus'] == 1) { + Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, + arguments: {'model': model}); + } else { + print(res['ErrorEndUserMessage']); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }) + .catchError((err) { + print('$err'); + widget.changeLoadingStata(false); - helpers.showErrorToast(); - }); + helpers.showErrorToast(); + }); + } catch (e) {} + + // Map model = { + // "LogInTokenID": _loggedUser['LogInTokenID'], + // "Channel": 9, + // "MobileNumber": _loggedUser['MobileNumber'], + // "IPAdress": "11.11.11.11", + // "LanguageID": 2, + // "ProjectID": 15, //TODO : this should become daynamci + // "ZipCode": _loggedUser['ZipCode'], + // "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], + // "OTP_SendType": oTPSendType + // }; + // authProv.sendActivationCodeByOtpNotificationType(model).then((res) { + // widget.changeLoadingStata(false); + // + // if (res['MessageStatus'] == 1) { + // Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, + // arguments: {'model': model}); + // } else { + // print(res['ErrorEndUserMessage']); + // helpers.showErrorToast(res['ErrorEndUserMessage']); + // } + // }).catchError((err) { + // print('$err'); + // widget.changeLoadingStata(false); + // + // helpers.showErrorToast(); + // }); } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) { helpers.showErrorToast('Your device not support this feature'); } else { - Navigator.of(context).pushNamed(VERIFICATION_METHODS, - arguments: {'verificationMethod': oTPSendType}); + Navigator.of(context).push(MaterialPageRoute( + builder: (BuildContext context) => + VerificationMethodsScreen(password: widget.password,))); + + // Navigator.of(context).pushNamed(VERIFICATION_METHODS, + // arguments: {'verificationMethod': oTPSendType}); } } } From ba2697c917d902e61a2ffb6631013a513540814f Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 16 Dec 2020 18:29:12 +0300 Subject: [PATCH 009/421] sick leave --- lib/client/base_app_client.dart | 10 +- lib/config/config.dart | 7 +- lib/config/localized_values.dart | 8 +- lib/core/service/dasboard_service.dart | 28 ++ lib/core/service/patient_service.dart | 35 +- lib/core/service/sickleave_service.dart | 23 + lib/core/viewModel/dashboard_view_model.dart | 21 + lib/core/viewModel/patient_view_model.dart | 21 +- lib/core/viewModel/sick_leave_view_model.dart | 31 ++ lib/locator.dart | 8 + lib/models/dashboard/dashboard_model.dart | 70 +++ lib/routes.dart | 5 +- lib/screens/dashboard_screen.dart | 16 +- lib/screens/sick-leave/add-sickleave.dart | 27 ++ lib/screens/sick-leave/sick_leave.dart | 422 +++++++++--------- lib/util/translations_delegate_base.dart | 5 + .../profile/profile_medical_info_widget.dart | 6 +- 17 files changed, 500 insertions(+), 243 deletions(-) create mode 100644 lib/core/service/dasboard_service.dart create mode 100644 lib/core/service/sickleave_service.dart create mode 100644 lib/core/viewModel/dashboard_view_model.dart create mode 100644 lib/core/viewModel/sick_leave_view_model.dart create mode 100644 lib/models/dashboard/dashboard_model.dart create mode 100644 lib/screens/sick-leave/add-sickleave.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..d831d5ac 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -30,7 +30,7 @@ Helpers helpers = new Helpers(); * */ class BaseAppClient { //TODO change the post fun to nun static when you change all service - post( + post( String endPoint, { Map body, Function(dynamic response, int statusCode) onSuccess, @@ -43,6 +43,11 @@ class BaseAppClient { if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + // body["VidaAuthTokenID"] = + // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzUyODk5MGItZjFhYS00NmUyLWE0MWMtMTIwMjZmMTk5YzJkIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91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OVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgxMTIyMzYsImV4cCI6MTYwODk3NjIzNiwiaWF0IjoxNjA4MTEyMjM2fQ.Bp84aDpkoZQsZ0cbSPYL9mhqqmvyxydoOirSlnc2Qz8"; + // body["VidaRefreshTokenID"] = + // "I0bL3kx07yjX/msZLKeb48Niug1QxylYtyWp9tkRkYWAKwabgszKF/fJy0DHwZavpZXWCb8fMw4NvRBZbk0MqA=="; + body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; @@ -80,7 +85,8 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - await helpers.logout(); + //need to uncomment + // await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian'); } else if (parsed['MessageStatus'] == 1) { diff --git a/lib/config/config.dart b/lib/config/config.dart index 017b46ec..17e23187 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -77,7 +77,12 @@ const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; -const GET_DASHBOARD = 'DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_DASHBOARD = + 'Services/DoctorApplication.svc/REST/GetDoctorDashboardKPI'; +const GET_SICKLEAVE_STATISTIC = + 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; +const ARRIVED_PATIENT_URL = + 'Services/DoctorApplication.svc/REST/PatientArrivalList​'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 21830385..7c476549 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -261,7 +261,9 @@ const Map> localizedValues = { }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, - "sick-leaves": {"en": "Sick Leaves", "ar": "الاجازات المرضية"}, + "sick-leaves": {"en": "Patient Sick", "ar": "الاجازات المرضية"}, + "patient-sick": {"en": "Patient Sick", "ar": "المرضية"}, + "leave": {"en": "Leave", "ar": "غادر"}, "submit": {"en": "Submit", "ar": "ارسال"}, "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, @@ -275,4 +277,8 @@ const Map> localizedValues = { 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, + "prevoius-sickleave-issed": { + "en": "Total previous sick leave issued by the doctor", + "ar": "مجموع الإجازات المرضية السابقة التي أصدرها الطبيب" + } }; diff --git a/lib/core/service/dasboard_service.dart b/lib/core/service/dasboard_service.dart new file mode 100644 index 00000000..cabcbf7c --- /dev/null +++ b/lib/core/service/dasboard_service.dart @@ -0,0 +1,28 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; + +class DashboardService extends BaseService { + var _dashboardItemsList = []; + get dashboardItemsList => _dashboardItemsList; + + // DashboardModel _dashboard = DashboardModel(); + + Future getDashboard() async { + await baseAppClient.post( + GET_DASHBOARD, + onSuccess: (dynamic response, int statusCode) { + _dashboardItemsList.clear(); + _dashboardItemsList = response['listDoctorDashboarKPI']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.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VEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgwMjg0NzQsImV4cCI6MTYwODg5MjQ3NCwiaWF0IjoxNjA4MDI4NDc0fQ.8OJcy6vUuPnNTi_qSjip8YCrFdaRLtJKbNKXcMtnQxk" + }, + ); + } +} diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index 82cb9a60..8642014e 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -62,6 +62,10 @@ class PatientService extends BaseService { // TODO: replace var with model var _doctorsList = []; + var _arrivedList = []; + + get arrivedList => _arrivedList; + get doctorsList => _doctorsList; // TODO: replace var with model @@ -408,21 +412,20 @@ class PatientService extends BaseService { ); } - Future getDashboard() async { - try { - dynamic localRes; - hasError = false; - await baseAppClient.post(GET_DASHBOARD, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: {}); - // notifyListeners(); - return Future.value(localRes); - } catch (error) { - hasError = true; - super.error = error; - } + Future getArrivedList() async { + hasError = false; + + await baseAppClient.post( + ARRIVED_PATIENT_URL, + onSuccess: (dynamic response, int statusCode) { + _arrivedList = []; + _arrivedList = response['"patientArrivalList": ']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _doctorsByClinicIdRequest.toJson(), + ); } } diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart new file mode 100644 index 00000000..9f47c38c --- /dev/null +++ b/lib/core/service/sickleave_service.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; + +class SickLeaveService extends BaseService { + var _statistics = {}; + get sickLeavestatisitics => _statistics; + + Future getStatistics() async { + await baseAppClient.post( + GET_SICKLEAVE_STATISTIC, + onSuccess: (dynamic response, int statusCode) { + print(response); + _statistics = response['SickLeaveStatistics']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {"PatientMRN": 3120737, "AppointmentNo": 2016055008}, + ); + } +} diff --git a/lib/core/viewModel/dashboard_view_model.dart b/lib/core/viewModel/dashboard_view_model.dart new file mode 100644 index 00000000..9eb3c0fc --- /dev/null +++ b/lib/core/viewModel/dashboard_view_model.dart @@ -0,0 +1,21 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/service/medicine_service.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class DashboardViewModel extends BaseViewModel { + DashboardService _dashboardService = locator(); + get dashboardItemsList => _dashboardService.dashboardItemsList; + + Future getDashboard() async { + setState(ViewState.Busy); + await _dashboardService.getDashboard(); + if (_dashboardService.hasError) { + error = _dashboardService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index c1339fd0..c46183a5 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -65,17 +65,6 @@ class PatientViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getDashboard() async { - setState(ViewState.Busy); - await _patientService.getDashboard(); - if (_patientService.hasError) { - error = _patientService.error; - setState(ViewState.Idle); - //setState(ViewState.Error); - } else - setState(ViewState.Idle); - } - Future getPatientVitalSign(patient) async { setState(ViewState.Busy); await _patientService.getPatientVitalSign(patient); @@ -256,4 +245,14 @@ class PatientViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getArrivedList() async { + setState(ViewState.Busy); + await _patientService.getArrivedList(); + if (_patientService.hasError) { + error = _patientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart new file mode 100644 index 00000000..eecee46d --- /dev/null +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -0,0 +1,31 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; +import 'package:doctor_app_flutter/core/service/medicine_service.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class SickLeaveViewModel extends BaseViewModel { + SickLeaveService _sickLeaveService = locator(); + get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; + + // Future getDashboard() async { + // setState(ViewState.Busy); + // await _dashboardService.getDashboard(); + // if (_dashboardService.hasError) { + // error = _dashboardService.error; + // setState(ViewState.Error); + // } else + // setState(ViewState.Idle); + // } + + Future preSickLeaveStatistics() async { + setState(ViewState.Busy); + await _sickLeaveService.getStatistics(); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..e0536f23 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,5 +1,9 @@ +import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart'; +import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.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:get_it/get_it.dart'; import 'core/service/doctor_reply_service.dart'; @@ -24,6 +28,8 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => DashboardService()); + locator.registerLazySingleton(() => SickLeaveService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +38,6 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => DashboardViewModel()); + locator.registerFactory(() => SickLeaveViewModel()); } diff --git a/lib/models/dashboard/dashboard_model.dart b/lib/models/dashboard/dashboard_model.dart new file mode 100644 index 00000000..0e03e899 --- /dev/null +++ b/lib/models/dashboard/dashboard_model.dart @@ -0,0 +1,70 @@ +class DashboardModel { + String kPIName; + int displaySequence; + List summaryoptions; + + DashboardModel({this.kPIName, this.displaySequence, this.summaryoptions}); + + DashboardModel.fromJson(Map json) { + kPIName = json['KPIName']; + displaySequence = json['displaySequence']; + if (json['summaryoptions'] != null) { + summaryoptions = new List(); + json['summaryoptions'].forEach((v) { + summaryoptions.add(new Summaryoptions.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['KPIName'] = this.kPIName; + data['displaySequence'] = this.displaySequence; + if (this.summaryoptions != null) { + data['summaryoptions'] = + this.summaryoptions.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Summaryoptions { + String kPIParameter; + String captionColor; + bool isCaptionBold; + bool isValueBold; + int order; + int value; + String valueColor; + + Summaryoptions( + {this.kPIParameter, + this.captionColor, + this.isCaptionBold, + this.isValueBold, + this.order, + this.value, + this.valueColor}); + + Summaryoptions.fromJson(Map json) { + kPIParameter = json['KPIParameter']; + captionColor = json['captionColor']; + isCaptionBold = json['isCaptionBold']; + isValueBold = json['isValueBold']; + order = json['order']; + value = json['value']; + valueColor = json['valueColor']; + } + + Map toJson() { + final Map data = new Map(); + data['KPIParameter'] = this.kPIParameter; + data['captionColor'] = this.captionColor; + data['isCaptionBold'] = this.isCaptionBold; + data['isValueBold'] = this.isValueBold; + data['order'] = this.order; + data['value'] = this.value; + data['valueColor'] = this.valueColor; + return data; + } +} diff --git a/lib/routes.dart b/lib/routes.dart index b7da4d2b..7dcf5e01 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import './screens/QR_reader_screen.dart'; @@ -76,6 +77,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; +const String ADD_SICKLEAVE = 'add-sickleave'; var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), @@ -112,5 +114,6 @@ var routes = { // VIDEO_CALL: (_) => VideoCallPage(patientData: null), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), // LIVECARE_END_DIALOG: (_) => EndCallDialogBox(), - PATIENT_SICKLEAVE: (_) => SickLeaveScreen() + PATIENT_SICKLEAVE: (_) => SickLeaveScreen(), + ADD_SICKLEAVE: (_) => AddSickLeavScreen() }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index e9c6341f..ce5776ac 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; @@ -71,7 +72,7 @@ class _DashboardScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } - return BaseView( + return BaseView( onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( baseViewModel: model, @@ -285,11 +286,14 @@ class _DashboardScreenState extends State { child: Center( child: Column( children: [ - AppText( - TranslationBase.of(context).arrived, - fontSize: - SizeConfig.textMultiplier * 1.5, - color: HexColor('#5D4C35'), + InkWell( + child: AppText( + TranslationBase.of(context).arrived, + fontSize: + SizeConfig.textMultiplier * 1.5, + color: HexColor('#5D4C35'), + ), + onTap: () {}, ), AppText( "23", diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart new file mode 100644 index 00000000..77af8dc4 --- /dev/null +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -0,0 +1,27 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class AddSickLeavScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: TranslationBase.of(context).sickleave, + body: Center( + child: Column( + children: [ + Container( + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + border: Border.all( + color: Colors.red[500], + ), + borderRadius: BorderRadius.all(Radius.circular(20))), + child: IconButton(icon: Icon(Icons.add), onPressed: null), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index c43bd77f..d4592be1 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -2,10 +2,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; 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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.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_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -55,219 +57,236 @@ class _SickLeaveScreenState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getClinicsList(), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).sickleave, - body: Center( - child: Container( - margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).sickLeaveDays, - fontSize: 10, - ), - AppTextFormField( - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ]), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).sickLeaveDate, - fontSize: 10, - ), - AppTextFormField( - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) {}), - ], - )), - RoundedContainer( - // margin: 10, - showBorder: true, - // raduis: 30, - borderColor: HexColor("#CCCCCC"), - 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), + builder: (_, model, w) => BaseView( + onModelReady: (model2) => model2.preSickLeaveStatistics(), + builder: (_, model2, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: Center( + child: Container( + margin: + EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).sickLeaveDays, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ]), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).sickLeaveDate, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onSaved: (value) {}), + ], + )), + RoundedContainer( + // margin: 10, + showBorder: true, + // raduis: 30, + borderColor: HexColor("#CCCCCC"), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).clinicName, + fontSize: 10, + ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).clinicName, + TranslationBase.of(context).doctorName, fontSize: 10, ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName(model) ?? - "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) + AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) ], ), - )), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorName, - fontSize: 10, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks, + fontSize: 10, + ), + AppTextFormField( + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ], ), - AppTextFormField( - readOnly: true, - hintText: profile['DoctorName'], - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks, - fontSize: 10, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).submit, + onPressed: () { + // _validateInputs(); + }, + ), + ], ), - AppTextFormField( - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ], - ), + ), + Column( + children: [ + Texts(TranslationBase.of(context) + .previousSickLeaveIssue + + ' ') + ], + ) + ], ), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).submit, - onPressed: () { - // _validateInputs(); - }, - ), - ], - ), - ) - ], + ), ), ), - ), - ), - )); + ))); } getProfile() async { @@ -281,7 +300,6 @@ class _SickLeaveScreenState extends State { var clinicInfo = model.clinicsList .where((i) => i['ClinicID'] == this.profile['ClinicID']) .toList(); - print(clinicInfo); - return clinicInfo[0]['ClinicDescription']; + return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2386c0d6..b85488cb 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -292,6 +292,9 @@ class TranslationBase { String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String get patientSick => + localizedValues['patient-sick'][locale.languageCode]; + String get leave => localizedValues['leave'][locale.languageCode]; String get submit => localizedValues['submit'][locale.languageCode]; String get doctorName => localizedValues['doc-name'][locale.languageCode]; String get clinicName => localizedValues['clinicname'][locale.languageCode]; @@ -307,6 +310,8 @@ class TranslationBase { String get area => localizedValues['area'][locale.languageCode]; String get room => localizedValues['room'][locale.languageCode]; String get bed => localizedValues['bed'][locale.languageCode]; + String get previousSickLeaveIssue => + localizedValues['prevoius-sickleave-issed'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d72d0c5a..9258650f 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -96,9 +96,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: PatientProfileButton( key: key, patient: patient, - route: PATIENT_SICKLEAVE, - nameLine1: TranslationBase.of(context).sickleave, - nameLine2: "", + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png')), ]); } From 46cdd9482c17e732014d00f2db6e9cc901149e39 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 16 Dec 2020 20:08:51 +0200 Subject: [PATCH 010/421] First step from SOAP --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 5 + lib/config/localized_values.dart | 4 +- lib/core/service/SOAP_service.dart | 25 + lib/core/viewModel/SOAP_view_model.dart | 23 + lib/core/viewModel/project_view_model.dart | 4 +- lib/main.dart | 6 +- lib/models/SOAP/Allergy_model.dart | 60 +++ .../SOAP/get_Allergies_request_model.dart | 32 ++ lib/routes.dart | 4 + lib/screens/dashboard_screen.dart | 4 +- .../medicine/pharmacies_list_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- lib/screens/patients/patients_screen.dart | 2 +- lib/screens/settings/settings_screen.dart | 2 +- lib/util/translations_delegate_base.dart | 2 + .../dashboard_item_texts_widget.dart | 2 +- .../patients/profile/SOAP/add_SOAP_index.dart | 171 +++++++ .../profile/SOAP/assessment_page.dart | 36 ++ .../patients/profile/SOAP/objective_page.dart | 36 ++ .../patients/profile/SOAP/plan_page.dart | 36 ++ .../patients/profile/SOAP/steps_widget.dart | 447 ++++++++++++++++++ .../profile/SOAP/subjective_page.dart | 36 ++ .../profile/profile_medical_info_widget.dart | 8 +- lib/widgets/shared/app_scaffold_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 26 files changed, 938 insertions(+), 17 deletions(-) create mode 100644 lib/core/service/SOAP_service.dart create mode 100644 lib/core/viewModel/SOAP_view_model.dart create mode 100644 lib/models/SOAP/Allergy_model.dart create mode 100644 lib/models/SOAP/get_Allergies_request_model.dart create mode 100644 lib/widgets/patients/profile/SOAP/add_SOAP_index.dart create mode 100644 lib/widgets/patients/profile/SOAP/assessment_page.dart create mode 100644 lib/widgets/patients/profile/SOAP/objective_page.dart create mode 100644 lib/widgets/patients/profile/SOAP/plan_page.dart create mode 100644 lib/widgets/patients/profile/SOAP/steps_widget.dart create mode 100644 lib/widgets/patients/profile/SOAP/subjective_page.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..b2b76709 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,7 +50,7 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; - + body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZWE0M2QxOTEtMWY1OS00ZWY1LThmYTYtM2ExYzBkNjQyNjc5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNI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BTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgxMDYwOTgsImV4cCI6MTYwODk3MDA5OCwiaWF0IjoxNjA4MTA2MDk4fQ.EJ_QwlrHPQncnU_CP0HpnERPidpIl5nFQzqB2VNFbNs"; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..a7165953 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -78,6 +78,11 @@ const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; + +// SOAP + +const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0dee26b9..4cbf8455 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,4 +1,4 @@ -const Map> localizedValues = { +const Map> localizedValues = { 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, @@ -273,4 +273,6 @@ const Map> localizedValues = { 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, + 'next': {'en': 'Next', 'ar': 'التالي'}, + 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, }; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart new file mode 100644 index 00000000..3ab75c27 --- /dev/null +++ b/lib/core/service/SOAP_service.dart @@ -0,0 +1,25 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; + +class SOAPService extends BaseService { + + List get listOfAllergies => _listOfAllergies; + List _listOfAllergies = []; + + + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { + await baseAppClient.post(GET_ALLERGIES, + onSuccess: (dynamic response, int statusCode) { + _listOfAllergies.clear(); + response['List_Allergies']['entityList'].forEach((v) { + _listOfAllergies + .add(AllergyModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getAllergiesRequestModel.toJson(),); + } +} diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart new file mode 100644 index 00000000..a68f3991 --- /dev/null +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class SOAPViewModel extends BaseViewModel { + SOAPService _SOAPService = locator(); + + List get listOfAllergies => _SOAPService.listOfAllergies; + + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getAllergies(getAllergiesRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index a12846c7..c751ab33 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -15,7 +15,7 @@ import 'package:provider/provider.dart'; Helpers helpers = Helpers(); -class ProjectProvider with ChangeNotifier { +class ProjectViewModel with ChangeNotifier { DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); Locale _appLocale; String currentLanguage = 'ar'; @@ -31,7 +31,7 @@ class ProjectProvider with ChangeNotifier { bool get isArabic => _isArabic; StreamSubscription subscription; - ProjectProvider() { + ProjectViewModel() { loadSharedPrefLanguage(); subscription = Connectivity() diff --git a/lib/main.dart b/lib/main.dart index 06d0ecfa..d7459f12 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -33,14 +33,14 @@ class MyApp extends StatelessWidget { create: (context) => AuthViewModel()), ChangeNotifierProvider( create: (context) => HospitalViewModel()), - ChangeNotifierProvider( - create: (context) => ProjectProvider(), + ChangeNotifierProvider( + create: (context) => ProjectViewModel(), ), ChangeNotifierProvider( create: (context) => LiveCareViewModel(), ), ], - child: Consumer( + child: Consumer( builder: (context,projectProvider,child) => MaterialApp( showSemanticsDebugger: false, title: 'Flutter Demo', diff --git a/lib/models/SOAP/Allergy_model.dart b/lib/models/SOAP/Allergy_model.dart new file mode 100644 index 00000000..c3493832 --- /dev/null +++ b/lib/models/SOAP/Allergy_model.dart @@ -0,0 +1,60 @@ +class AllergyModel { + int allergyDiseaseId; + String allergyDiseaseName; + int allergyDiseaseType; + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + int episodeID; + bool isChecked; + bool isUpdatedByNurse; + int severity; + String severityName; + + AllergyModel( + {this.allergyDiseaseId, + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); + + AllergyModel.fromJson(Map json) { + allergyDiseaseId = json['allergyDiseaseId']; + allergyDiseaseName = json['allergyDiseaseName']; + allergyDiseaseType = json['allergyDiseaseType']; + appointmentNo = json['appointmentNo']; + createdBy = json['createdBy']; + createdByName = json['createdByName']; + createdOn = json['createdOn']; + episodeID = json['episodeID']; + isChecked = json['isChecked']; + isUpdatedByNurse = json['isUpdatedByNurse']; + severity = json['severity']; + severityName = json['severityName']; + } + + Map toJson() { + final Map data = new Map(); + data['allergyDiseaseId'] = this.allergyDiseaseId; + data['allergyDiseaseName'] = this.allergyDiseaseName; + data['allergyDiseaseType'] = this.allergyDiseaseType; + data['appointmentNo'] = this.appointmentNo; + data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; + data['createdOn'] = this.createdOn; + data['episodeID'] = this.episodeID; + data['isChecked'] = this.isChecked; + data['isUpdatedByNurse'] = this.isUpdatedByNurse; + data['severity'] = this.severity; + data['severityName'] = this.severityName; + return data; + } +} diff --git a/lib/models/SOAP/get_Allergies_request_model.dart b/lib/models/SOAP/get_Allergies_request_model.dart new file mode 100644 index 00000000..7676d530 --- /dev/null +++ b/lib/models/SOAP/get_Allergies_request_model.dart @@ -0,0 +1,32 @@ +class GetAllergiesRequestModel { + String vidaAuthTokenID; + int patientMRN; + int appointmentNo; + int episodeId; + String doctorID; + + GetAllergiesRequestModel( + {this.vidaAuthTokenID, + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID}); + + GetAllergiesRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeId = json['EpisodeId']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeId'] = this.episodeId; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/routes.dart b/lib/routes.dart index dff02129..ce090676 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/add_SOAP_index.dart'; import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; @@ -69,6 +70,8 @@ const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; +const String CREATE_EPISODE = 'patients/create-episode'; + const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; @@ -105,6 +108,7 @@ var routes = { PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + CREATE_EPISODE:(_)=>AddSOAPIndex(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 80697352..22d58540 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -41,14 +41,14 @@ class _DashboardScreenState extends State { HospitalViewModel hospitalProvider; AuthViewModel authProvider; bool isLoading = false; - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; var _isInit = true; DoctorProfileModel profile; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { - projectsProvider = Provider.of(context); + projectsProvider = Provider.of(context); projectsProvider.getDoctorClinicsList(); } _isInit = false; diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 6057bf23..2433487f 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -34,7 +34,7 @@ class PharmaciesListScreen extends StatefulWidget { class _PharmaciesListState extends State { var _data; Helpers helpers = new Helpers(); - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; bool _isInit = true; //bool _isOutOfStuck = false; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 204d2336..ab352ce0 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -39,7 +39,7 @@ class _PatientSearchScreenState extends State { String _selectedType = '1'; String _selectedLocation = '1'; String error = ''; - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; String itemText = ''; String itemText2 = ''; final GlobalKey _formKey = GlobalKey(); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4ca3e587..1c0c0638 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -60,7 +60,7 @@ class _PatientsScreenState extends State { bool _isError = false; String error = ""; - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; final _controller = TextEditingController(); diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 79cd827e..7d41d662 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -8,7 +8,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class SettingsScreen extends StatelessWidget { - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3bea8990..f8638c86 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -293,6 +293,8 @@ class TranslationBase { String get area => localizedValues['area'][locale.languageCode]; String get room => localizedValues['room'][locale.languageCode]; String get bed => localizedValues['bed'][locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; + String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index c3e4986d..80b0aa17 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -26,7 +26,7 @@ class DashboardItemTexts extends StatefulWidget { } class _DashboardItemTextsState extends State { - ProjectProvider projectsProvider; + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart new file mode 100644 index 00000000..a74e5c51 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -0,0 +1,171 @@ +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective_page.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../patient_profile_widget.dart'; +import 'steps_widget.dart'; + +class AddSOAPIndex extends StatefulWidget { + @override + _AddSOAPIndexState createState() => _AddSOAPIndexState(); +} + +class _AddSOAPIndexState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + void initState() { + // TODO: implement initState + _controller = new PageController(); + + super.initState(); + } + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).healthRecordInformation, + body: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: + BoxDecoration(boxShadow: [], color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + width: 20, + ), + FractionallySizedBox( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.75, + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + left: + MediaQuery.of(context).size.width * 0.05, + right: + MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + SubjectivePage(changePageViewIndex: changePageViewIndex,), + ObjectivePage(changePageViewIndex: changePageViewIndex,), + AssessmentPage(changePageViewIndex: changePageViewIndex,), + PlanPage(changePageViewIndex: changePageViewIndex,) + ], + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart new file mode 100644 index 00000000..7649ac46 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class AssessmentPage extends StatelessWidget { + final Function changePageViewIndex; + + AssessmentPage({Key key, this.changePageViewIndex}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, +// baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppButton( + title: TranslationBase.of(context).next, + onPressed: () { + changePageViewIndex(3); + }, + ), + ], + ), + ), + ), + )); + } +} diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart new file mode 100644 index 00000000..8960a8dc --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class ObjectivePage extends StatelessWidget { + final Function changePageViewIndex; + + ObjectivePage({Key key, this.changePageViewIndex}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, +// baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppButton( + title: TranslationBase.of(context).next, + onPressed: () { + changePageViewIndex(2); + }, + ), + ], + ), + ), + ), + )); + } +} diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart new file mode 100644 index 00000000..5054647c --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class PlanPage extends StatelessWidget { + final Function changePageViewIndex; + + PlanPage({Key key, this.changePageViewIndex}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, +// baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppButton( + title: TranslationBase.of(context).next, + onPressed: () { + changePageViewIndex(4); + }, + ), + ], + ), + ), + ), + )); + } +} diff --git a/lib/widgets/patients/profile/SOAP/steps_widget.dart b/lib/widgets/patients/profile/SOAP/steps_widget.dart new file mode 100644 index 00000000..863da3a9 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/steps_widget.dart @@ -0,0 +1,447 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class StepsWidget extends StatelessWidget { + final int index; + final Function changeCurrentTab; + + StepsWidget({Key key, this.index, this.changeCurrentTab}); + + // TODO : Add translation to name + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return !projectViewModel.isArabic + ? Stack( + children: [ + Container( + height: 120, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: index == 0 ? 15 : 30, + left: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 0 ? 70 : 50, + height: index == 0 ? 70 : 50, + decoration: BoxDecoration( + border: index == 0 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 0 + ? null + : Border.all( + color: Colors.black, width: 0.75), + shape: BoxShape.circle, + color: index == 0 + ? Colors.white + : index > 0 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '1', + variant: index == 0 ? "heading2" : "", + bold: true, + color: index == 0 + ? Colors.black + : index > 0 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 0 ? 5 : 10, + ), + Texts('SUBJECTIVE', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + Positioned( + top: index == 1 ? 15 : 30, + left: MediaQuery.of(context).size.width * 0.28, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 1 ? 70 : 50, + height: index == 1 ? 70 : 50, + decoration: BoxDecoration( + border: index == 1 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 1 + ? Colors.white + : index > 1 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '2', + variant: index == 1 ? "heading2" : '', + bold: true, + color: index == 1 + ? Colors.black + : index > 1 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 1 ? 5 : 10, + ), + Texts('OBJECTIVE', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + Positioned( + top: index == 2 ? 15 : 30, + left: MediaQuery.of(context).size.width * 0.52, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(3) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 2 ? 70 : 50, + height: index == 2 ? 70 : 50, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Colors.white + : index > 2 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '3', + variant: index == 2 ? "heading2" : '', + bold: true, + color: index == 2 + ? Colors.black + : index > 2 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 2 ? 5 : 10, + ), + Texts('ASSESSMENT', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + Positioned( + top: index == 3 ? 15 : 30, + right: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 3 ? 70 : 50, + height: index == 3 ? 70 : 50, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Colors.white + : index > 3 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '4', + variant: index == 3 ? "heading2" : '', + bold: true, + color: index == 3 + ? Colors.black + : index > 3 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 3 ? 5 : 10, + ), + Texts('PLAN', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + ], + ) + : Stack( + children: [ + Container( + height: 120, + width: MediaQuery.of(context).size.width, + color: Colors.transparent, + child: Center( + child: Divider( + color: Colors.grey, + height: 0.75, + thickness: 0.75, + ), + ), + ), + Positioned( + top: index == 0 ? 15 : 30, + right: 0, + child: InkWell( + onTap: () => changeCurrentTab(0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 0 ? 70 : 50, + height: index == 0 ? 70 : 50, + decoration: BoxDecoration( + border: index == 0 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 0 + ? null + : Border.all( + color: Colors.black, width: 0.75), + shape: BoxShape.circle, + color: index == 0 + ? Colors.white + : index > 0 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '1', + variant: index == 0 ? "heading2" : "", + bold: true, + color: index == 0 + ? Colors.black + : index > 0 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 0 ? 5 : 10, + ), + Texts('SUBJECTIVE', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + Positioned( + top: index == 1 ? 15 : 30, + right: MediaQuery.of(context).size.width * 0.28, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(1) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 1 ? 70 : 50, + height: index == 1 ? 70 : 50, + decoration: BoxDecoration( + border: index == 1 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 1 + ? Colors.white + : index > 1 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '2', + variant: index == 1 ? "heading2" : '', + bold: true, + color: index == 1 + ? Colors.black + : index > 1 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 1 ? 5 : 10, + ), + Texts('OBJECTIVE', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + Positioned( + top: index == 2 ? 15 : 30, + right: MediaQuery.of(context).size.width * 0.52, + child: InkWell( + onTap: () => index >= 2 ? changeCurrentTab(3) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 2 ? 70 : 50, + height: index == 2 ? 70 : 50, + decoration: BoxDecoration( + border: index == 2 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 2 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 2 + ? Colors.white + : index > 2 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '3', + variant: index == 2 ? "heading2" : '', + bold: true, + color: index == 2 + ? Colors.black + : index > 2 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 2 ? 5 : 10, + ), + Padding( + + padding: const EdgeInsets.only(right: 2), + child: Texts('ASSESSMENT', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ], + ), + ), + ), + Positioned( + top: index == 3 ? 15 : 30, + left: 0, + child: InkWell( + onTap: () => index >= 3 ? changeCurrentTab(4) : null, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: index == 3 ? 70 : 50, + height: index == 3 ? 70 : 50, + decoration: BoxDecoration( + border: index == 3 + ? Border.all(color: Color(0xFFB9382C), width: 2) + : index > 3 + ? null + : Border.all( + color: Color(0xFFCCCCCC), width: 0.75), + shape: BoxShape.circle, + color: index == 3 + ? Colors.white + : index > 3 + ? Color(0xFFB9382C) + : Color(0xFFCCCCCC), + ), + child: Center( + child: Texts( + '4', + variant: index == 3 ? "heading2" : '', + bold: true, + color: index == 3 + ? Colors.black + : index > 3 + ? Colors.white + : Colors.grey, + ), + ), + ), + SizedBox( + height: index == 3 ? 5 : 10, + ), + Texts('PLAN', + variant: "bodyText", + bold: true, + color: Colors.black), + ], + ), + ), + ), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/SOAP/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective_page.dart new file mode 100644 index 00000000..87aa62d7 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/subjective_page.dart @@ -0,0 +1,36 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class SubjectivePage extends StatelessWidget { + final Function changePageViewIndex; + + SubjectivePage({Key key, this.changePageViewIndex}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, +// baseViewModel: widget.model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppButton( + title: TranslationBase.of(context).next, + onPressed: () { + changePageViewIndex(1); + }, + ), + ], + ), + ), + ), + )); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b8136026..a710cfc3 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -26,7 +26,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { mainAxisSpacing: 20, crossAxisCount: 2, childAspectRatio: 1.5, - children: [ + children: [ PatientProfileButton( + key: key, + patient: patient, + nameLine1: "Create New", + nameLine2: "Episode", + route: CREATE_EPISODE, + icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index eb61ce30..4ddd7873 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -27,7 +27,7 @@ class AppScaffold extends StatelessWidget { @override Widget build(BuildContext context) { AppGlobal.CONTEX = context; - ProjectProvider projectProvider = Provider.of(context); + ProjectViewModel projectProvider = Provider.of(context); return Scaffold( backgroundColor: Colors.white, appBar: isShowAppBar diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index e3110cde..f7fd3637 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -18,7 +18,7 @@ class CardWithBgWidget extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectProvider projectProvider = Provider.of(context); + ProjectViewModel projectProvider = Provider.of(context); return Container( margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, From af77d35ce31b0e4392a5a6d205fd5859a80f96c1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 10:37:53 +0200 Subject: [PATCH 011/421] ass some changes to SOAP --- .../profile/SOAP/subjective_page.dart | 19 +++++++++++++++++++ pubspec.lock | 7 +++++++ pubspec.yaml | 6 ++++++ 3 files changed, 32 insertions(+) diff --git a/lib/widgets/patients/profile/SOAP/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective_page.dart index 87aa62d7..fb95fc78 100644 --- a/lib/widgets/patients/profile/SOAP/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective_page.dart @@ -1,7 +1,10 @@ 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_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class SubjectivePage extends StatelessWidget { final Function changePageViewIndex; @@ -21,6 +24,22 @@ class SubjectivePage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox(height: 30,), + Row(children: [ + Row( + children: [ + Texts('ASSESSMENT', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon(FontAwesomeIcons.asterisk, color: Color(0xFFB9382C), + size: 12, + ) + ], + ), + Icon(EvaIcons.plus) + ],), + AppButton( title: TranslationBase.of(context).next, onPressed: () { diff --git a/pubspec.lock b/pubspec.lock index ae4f6a70..5c109b95 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -343,6 +343,13 @@ packages: description: flutter source: sdk version: "0.0.0" + font_awesome_flutter: + dependency: "direct main" + description: + name: font_awesome_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "8.11.0" get_it: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index bdda7810..5e8563cd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,7 +36,11 @@ dependencies: maps_launcher: ^1.2.0 url_launcher: ^5.4.5 charts_flutter: ^0.9.0 + #Icons eva_icons_flutter: ^2.0.0 + font_awesome_flutter: ^8.11.0 + + expandable: ^4.1.4 # Qr code Scanner @@ -56,6 +60,8 @@ dependencies: get_it: ^4.0.2 + + #speech to text speech_to_text: path: speech_to_text From 81352c2b0e9cb6babc8b198b8c672b6ffa3568ba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 10:47:17 +0200 Subject: [PATCH 012/421] small fix. --- lib/config/config.dart | 3 +++ lib/widgets/patients/profile/SOAP/subjective_page.dart | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a7165953..0ee1eb0d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; @@ -142,4 +144,5 @@ const TIMER_MIN = 10; class AppGlobal { static var CONTEX; + static Color appPrimaryColor =Color(0xFFB9382C); } diff --git a/lib/widgets/patients/profile/SOAP/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective_page.dart index fb95fc78..fd6a6e50 100644 --- a/lib/widgets/patients/profile/SOAP/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective_page.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.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_buttons_widget.dart'; @@ -32,7 +33,7 @@ class SubjectivePage extends StatelessWidget { variant: "bodyText", bold: true, color: Colors.black), - Icon(FontAwesomeIcons.asterisk, color: Color(0xFFB9382C), + Icon(FontAwesomeIcons.asterisk, color: AppGlobal.appPrimaryColor, size: 12, ) ], From 4f96cff5856536ce8b71aaf84fba7b88cb48c014 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 17 Dec 2020 13:20:34 +0300 Subject: [PATCH 013/421] sick leave --- lib/client/base_app_client.dart | 10 +- lib/config/localized_values.dart | 7 + lib/core/service/dasboard_service.dart | 5 +- lib/core/service/sickleave_service.dart | 7 +- lib/lookups/patient_lookup.dart | 1 + lib/screens/sick-leave/add-sickleave.dart | 61 ++- lib/screens/sick-leave/sick_leave.dart | 436 +++++++++++----------- lib/util/translations_delegate_base.dart | 18 +- 8 files changed, 296 insertions(+), 249 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d831d5ac..94c732a5 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -42,12 +42,10 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctor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Q9AdTDaahtyhoVvAiDCXIGz4F-FuQ"; + body["VidaRefreshTokenID"] = + "hapR/0V/AljCVq/j49o4T7Bnee7hN295Xks54jo3ATEKZMqa8k9pXmbwDGycnz0Do6jk1W7YWFl6oy6aKfIjDA=="; body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a19ef3f0..dddccfa2 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -288,4 +288,11 @@ const Map> localizedValues = { }, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, + 'no-sickleve-applied': { + 'en': "No sick leave applied", + 'ar': 'لم تطبق إجازة مرضية' + }, + 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, + 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, + 'add': {'en': "Add", 'ar': 'أضف'}, }; diff --git a/lib/core/service/dasboard_service.dart b/lib/core/service/dasboard_service.dart index cabcbf7c..8ad8aa4f 100644 --- a/lib/core/service/dasboard_service.dart +++ b/lib/core/service/dasboard_service.dart @@ -9,6 +9,7 @@ class DashboardService extends BaseService { // DashboardModel _dashboard = DashboardModel(); Future getDashboard() async { + return Future.value(null); await baseAppClient.post( GET_DASHBOARD, onSuccess: (dynamic response, int statusCode) { @@ -20,8 +21,8 @@ class DashboardService extends BaseService { super.error = error; }, body: { - "VidaAuthTokenID": - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZDYxZmM5MTQtZWFhYy00YjQ4LTgyMmEtMmE3OTNlZDMzZGYwIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhB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RURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgwMjg0NzQsImV4cCI6MTYwODg5MjQ3NCwiaWF0IjoxNjA4MDI4NDc0fQ.8OJcy6vUuPnNTi_qSjip8YCrFdaRLtJKbNKXcMtnQxk" }, ); } diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 9f47c38c..7e9de230 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -3,14 +3,15 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; // import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; class SickLeaveService extends BaseService { - var _statistics = {}; - get sickLeavestatisitics => _statistics; - + Map get sickLeavestatisitics => _statistics; + Map _statistics = {}; Future getStatistics() async { + hasError = false; await baseAppClient.post( GET_SICKLEAVE_STATISTIC, onSuccess: (dynamic response, int statusCode) { print(response); + _statistics = {}; _statistics = response['SickLeaveStatistics']; }, onFailure: (String error, int statusCode) { diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 189535ce..d8db7945 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -10,6 +10,7 @@ const PATIENT_TYPE = const [ }, {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, + {"text": "Arrived", "text_ar": "وصل", "val": "7"}, ]; const LOCATIONS = const [ diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 77af8dc4..57960ec2 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,27 +1,58 @@ +import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class AddSickLeavScreen extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( appBarTitle: TranslationBase.of(context).sickleave, - body: Center( - child: Column( - children: [ - Container( - padding: EdgeInsets.all(20), - decoration: BoxDecoration( - border: Border.all( - color: Colors.red[500], - ), - borderRadius: BorderRadius.all(Radius.circular(20))), - child: IconButton(icon: Icon(Icons.add), onPressed: null), - ) - ], - ), - ), + body: new Builder(builder: (context) { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: Border.all(color: HexColor('#B8382C'), width: 4), + borderRadius: BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + openSickLeave(context); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).noSickLeaveApplied, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) + ], + ), + ); + }), ); } + + openSickLeave(BuildContext context) { + showModalBottomSheet( + context: context, + builder: (context) { + return new Container(child: SickLeaveScreen()); + }); + } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index d4592be1..1eac90c3 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -58,235 +58,233 @@ class _SickLeaveScreenState extends State { return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics(), - builder: (_, model2, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).sickleave, - body: Center( - child: Container( - margin: - EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).sickLeaveDays, - fontSize: 10, - ), - AppTextFormField( - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ]), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).sickLeaveDate, - fontSize: 10, - ), - AppTextFormField( - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) {}), - ], - )), - RoundedContainer( - // margin: 10, - showBorder: true, - // raduis: 30, - borderColor: HexColor("#CCCCCC"), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).clinicName, - fontSize: 10, - ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) - ], - ), - )), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorName, - fontSize: 10, - ), - AppTextFormField( - readOnly: true, - hintText: profile['DoctorName'], - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ], - ), - ), - SizedBox( - height: 10, + onModelReady: (model2) => model2.preSickLeaveStatistics(), + builder: (_, model2, w) => Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Padding( + child: AppText( + TranslationBase.of(context).addSickLeave, + fontWeight: FontWeight.bold, ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), + padding: EdgeInsets.all(10)), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + borderColor: Colors.white, + onSaved: (value) {}, + hintText: TranslationBase.of(context) + .sickLeaveDays, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ]), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).sickLeaveDate, + // fontSize: 10, + // ), + AppTextFormField( + hintText: TranslationBase.of(context) + .sickLeaveDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onSaved: (value) {}), + ], + )), + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + 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: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context).remarks, - fontSize: 10, - ), - AppTextFormField( - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) + // AppText( + // TranslationBase.of(context).clinicName, + // fontSize: 10, + // ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName(model) ?? + "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) ], ), - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).submit, - onPressed: () { - // _validateInputs(); - }, - ), - ], + )), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).doctorName, + // fontSize: 10, + // ), + AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ], + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).remarks, + // fontSize: 10, + // ), + AppTextFormField( + borderColor: Colors.white, + hintText: TranslationBase.of(context).remarks, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ], + ), + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).add, + onPressed: () { + // _validateInputs(); + }, ), - ), - Column( - children: [ - Texts(TranslationBase.of(context) - .previousSickLeaveIssue + - ' ') - ], - ) - ], + ], + ), ), - ), + Column( + children: [ + Texts(TranslationBase.of(context) + .previousSickLeaveIssue + + ' ') + ], + ) + ], ), ), - ))); + ), + ), + )); } getProfile() async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a8c1ae2a..5290e933 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -108,8 +108,10 @@ class TranslationBase { String get profile => localizedValues['profile'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; String get errorMessage => @@ -227,8 +229,10 @@ class TranslationBase { String get urgent => localizedValues['urgent'][locale.languageCode]; String get routine => localizedValues['routine'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; - String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; + String get selectReferralFrequency => + localizedValues['selectReferralFrequency'][locale.languageCode]; String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -316,6 +320,12 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get noSickLeaveApplied => + localizedValues['no-sickleve-applied'][locale.languageCode]; + String get applyNow => localizedValues['applynow'][locale.languageCode]; + String get addSickLeave => + localizedValues['add-sickleave'][locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 9c018d3c55fa5e006f911f63274e1c5ecee06347 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 12:45:37 +0200 Subject: [PATCH 014/421] first step from patient arrival --- lib/client/base_app_client.dart | 1 + lib/config/config.dart | 12 ++++-- lib/core/service/patient_service.dart | 4 +- lib/core/viewModel/patient_view_model.dart | 2 +- lib/lookups/patient_lookup.dart | 1 + ...et_patient_arrival_list_request_model.dart | 40 +++++++++++++++++++ .../patients/patient_search_screen.dart | 13 +----- lib/screens/patients/patients_screen.dart | 31 ++++++++------ 8 files changed, 73 insertions(+), 31 deletions(-) create mode 100644 lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..ee4e9882 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,6 +50,7 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; + body['VidaAuthTokenID'] = ""; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..17a3ae44 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -88,7 +88,8 @@ var SERVICES_PATIANT = [ "GtMyReferredPatient", "GtMyDischargeReferralPatient", "GtMyTomorrowPatient", - "GtMyReferralPatient" + "GtMyReferralPatient", + "PatientArrivalList" ]; var SERVICES_PATIANT2 = [ "List_MyOutPatient", @@ -97,7 +98,8 @@ var SERVICES_PATIANT2 = [ "List_MyReferredPatient", "List_MyDischargeReferralPatient", "List_MyTomorrowPatient", - "List_MyReferralPatient" + "List_MyReferralPatient", + "patientArrivalList" ]; var SERVICES_PATIANT_HEADER = [ "Search Out-Patient", @@ -106,7 +108,8 @@ var SERVICES_PATIANT_HEADER = [ "Referred", "Referral Discharge", "Tomorrow", - "Referral" + "Referral", + "Arrival Patient" ]; var SERVICES_PATIANT_HEADER_AR = [ "المريض الخارجي", @@ -115,7 +118,8 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", - "المريض المحول مني" + "المريض المحول مني", + "المريض الواصل" ]; //****************** diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index b16753f5..a847b95d 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -84,7 +84,7 @@ class PatientService extends BaseService { RequestSchedule _requestSchedule = RequestSchedule(); - Future getPatientList(PatientModel patient, patientType) async { + Future getPatientList( patient, patientType) async { hasError = false; int val = int.parse(patientType); @@ -98,7 +98,7 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body: { + body:val ==7?patient: { "ProjectID": patient.ProjectID, "ClinicID": patient.ClinicID, "DoctorID": patient.DoctorID, diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index f39a3d48..46232bbf 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -46,7 +46,7 @@ class PatientViewModel extends BaseViewModel { get doctorsList => _patientService.doctorsList; get referalFrequancyList => _patientService.referalFrequancyList; - Future getPatientList(PatientModel patient, patientType, + Future getPatientList( patient, patientType, {bool isBusyLocal = false}) async { if(isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 189535ce..dfcaa305 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -10,6 +10,7 @@ const PATIENT_TYPE = const [ }, {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, + {"text": "Arrival", "text_ar": "المريض الواصل", "val": "7"}, ]; const LOCATIONS = const [ diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart new file mode 100644 index 00000000..393790dd --- /dev/null +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -0,0 +1,40 @@ +class GetPatientArrivalListRequestModel { + String vidaAuthTokenID; + String from; + String to; + String doctorID; + int pageIndex; + int pageSize; + int clinicID; + + GetPatientArrivalListRequestModel( + {this.vidaAuthTokenID, + this.from, + this.to, + this.doctorID, + this.pageIndex, + this.pageSize, + this.clinicID}); + + GetPatientArrivalListRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + from = json['From']; + to = json['To']; + doctorID = json['DoctorID']; + pageIndex = json['PageIndex']; + pageSize = json['PageSize']; + clinicID = json['ClinicID']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['From'] = this.from; + data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['PageIndex'] = this.pageIndex; + data['PageSize'] = this.pageSize; + data['ClinicID'] = this.clinicID; + return data; + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 204d2336..450a32f7 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -65,12 +65,9 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { -//print("============== _selectedType============"+ _selectedType); + try { - //==================== - //_selectedType=='3'? - //===================== Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = @@ -79,20 +76,13 @@ class _PatientSearchScreenState extends State { _formKey.currentState.save(); sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - print('************_selectedType*************'); - print('_selectedType${_selectedType}'); String token = await sharedPref.getString(TOKEN); _patientSearchFormValues.TokenID = token; _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 _patientSearchFormValues.DoctorID = doctorProfile.doctorID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - //===================== - // _patientSearchFormValues. - //===================== - print("=============doctorProfile.clinicID=" + - doctorProfile.clinicID.toString()); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, @@ -105,7 +95,6 @@ class _PatientSearchScreenState extends State { } } catch (err) { error = err; - // handelCatchErrorCase(err); } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4ca3e587..7b27d746 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -9,11 +9,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_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/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -48,7 +49,6 @@ class _PatientsScreenState extends State { final String avatarFemale = 'user_female.svg'; final String assetName = 'assets/image.svg'; - // List _locations = ['Today', 'Old Date', 'YESTERDAY']; List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -66,14 +66,6 @@ class _PatientsScreenState extends State { PatientModel patient; -/* - *@author: Amjad Amireh - *@Date:2/5/2020 - *@param: - *@return:PatientsScreen Search textbox filter - - *@desc: - */ searchData(String str) { this.responseModelList = this.responseModelList2; @@ -277,11 +269,26 @@ class _PatientsScreenState extends State { return BaseView( onModelReady: (model) { // TODO : change all the logic here to make it work with the model and remove future - model.getPatientList(patient, patientType).then((res) { + int val2 = int.parse(patientType); + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; + if (val2 == 7) { + getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( + from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); + } + + model + .getPatientList( + val2 == 7 + ? getPatientArrivalListRequestModel.toJson() + : patient, + patientType) + .then((res) { setState(() { _isLoading = false; if (res['MessageStatus'] == 1) { - int val2 = int.parse(patientType); + if (val2 == 7) { + print("Assad"); + } lItems = res[SERVICES_PATIANT2[val2]]; parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; From 94093e775eaeb3fb1e7d124975afd92e2d131b38 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 17 Dec 2020 15:16:08 +0200 Subject: [PATCH 015/421] add vital-sign files --- lib/core/service/base/base_service.dart | 2 + .../service/patient-vital-signs-service.dart | 45 +++++++++++++++++++ .../patient-vital-sign-viewModel.dart | 27 +++++++++++ lib/locator.dart | 4 ++ 4 files changed, 78 insertions(+) create mode 100644 lib/core/service/patient-vital-signs-service.dart create mode 100644 lib/core/viewModel/patient-vital-sign-viewModel.dart diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index c4cb240d..885398f5 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,8 +1,10 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { String error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); //TODO add the user login model when we need it } diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart new file mode 100644 index 00000000..72619fa4 --- /dev/null +++ b/lib/core/service/patient-vital-signs-service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; + +class VitalSignsService extends BaseService{ + + List patientVitalSignList = []; + List patientVitalSignOrderdSubList = []; + + Future getPatientVitalSign(patient) async { + hasError = false; + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN, + onSuccess: (dynamic response, int statusCode) { + patientVitalSignList = []; + response['List_DoctorPatientVitalSign'].forEach((v) { + patientVitalSignList.add(new VitalSignResModel.fromJson(v)); + }); + + if (patientVitalSignList.length > 0) { + List patientVitalSignOrderdSubListTemp = []; + patientVitalSignOrderdSubListTemp = patientVitalSignList; + patientVitalSignOrderdSubListTemp + .sort((VitalSignResModel a, VitalSignResModel b) { + return b.vitalSignDate.microsecondsSinceEpoch - + a.vitalSignDate.microsecondsSinceEpoch; + }); + patientVitalSignOrderdSubList.clear(); + int length = patientVitalSignOrderdSubListTemp.length >= 20 + ? 20 + : patientVitalSignOrderdSubListTemp.length; + for (int x = 0; x < length; x++) { + patientVitalSignOrderdSubList + .add(patientVitalSignOrderdSubListTemp[x]); + } + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: patient, + ); + } +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-vital-sign-viewModel.dart b/lib/core/viewModel/patient-vital-sign-viewModel.dart new file mode 100644 index 00000000..255ab5bd --- /dev/null +++ b/lib/core/viewModel/patient-vital-sign-viewModel.dart @@ -0,0 +1,27 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; + +import '../../locator.dart'; + +class VitalSignsViewModel extends BaseViewModel{ + VitalSignsService _vitalSignService = locator(); + + List get patientVitalSignList => + _vitalSignService.patientVitalSignList; + + List get patientVitalSignOrderdSubList => + _vitalSignService.patientVitalSignOrderdSubList; + + Future getPatientVitalSign(patient) async { + setState(ViewState.Busy); + await _vitalSignService.getPatientVitalSign(patient); + if (_vitalSignService.hasError) { + error = _vitalSignService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..9ca9d8db 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,11 +4,13 @@ import 'package:get_it/get_it.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; +import 'core/service/patient-vital-signs-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/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; +import 'core/viewModel/patient-vital-sign-viewModel.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -24,6 +26,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => VitalSignsService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +35,5 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => VitalSignsViewModel()); } From 44779e6ee7dc88f1c5eb83d1470846a72cd0e65b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 17 Dec 2020 19:17:20 +0200 Subject: [PATCH 016/421] patient screen --- lib/client/base_app_client.dart | 21 +++++----- lib/screens/patients/patients_screen.dart | 49 +++++++++++++---------- 2 files changed, 40 insertions(+), 30 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ee4e9882..876226ce 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,7 +50,7 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; - body['VidaAuthTokenID'] = ""; + body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiMDBmMDI3NjQtZDczMi00NDA0LThkYmUtZWViZDkwY2EzM2JiIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1NzYyMDYiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODIyMjUwNiwiZXhwIjoxNjA5MDg2NTA2LCJpYXQiOjE2MDgyMjI1MDZ9.X_66vZw08tiH4DmhKUPXzIiIMrnadE2IHe0wOA0GM6g"; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') @@ -80,16 +80,19 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (!parsed['IsAuthenticated']) { - await helpers.logout(); + // TODO: return it back when backend fixed + // if (!parsed['IsAuthenticated']) { + // await helpers.logout(); + // + // helpers.showErrorToast('Your session expired Please login agian'); + // } else - helpers.showErrorToast('Your session expired Please login agian'); - } else if (parsed['MessageStatus'] == 1) { + // if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); - } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], - statusCode); - } + // } else { + // onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + // statusCode); + // } } } else { onFailure('Please Check The Internet Connection', -1); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 7b27d746..8b02ab3d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -285,25 +285,33 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - if (res['MessageStatus'] == 1) { - if (val2 == 7) { - print("Assad"); + // if (res['MessageStatus'] == 1) { + if (val2 == 7) { + print("Assad"); + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + lItems = res[SERVICES_PATIANT2[val2]]["entityList"]; } - lItems = res[SERVICES_PATIANT2[val2]]; - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2 = responseModelList; - _isError = false; } else { - _isError = true; - error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + lItems = res[SERVICES_PATIANT2[val2]]; } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; + // } else { + // _isError = true; + // error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + // } }); }).catchError((error) { setState(() { _isError = true; _isLoading = false; - this.error = error; + this.error = error.toString(); }); }); }, @@ -315,16 +323,15 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .youDontHaveAnyPatient) - : Container( - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null + ? DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient) + : Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child: lItems == null ? Column( crossAxisAlignment: CrossAxisAlignment.start, From dcba85c7b9b017dbdd116259f72842103e4244fd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 18 Dec 2020 19:53:46 +0200 Subject: [PATCH 017/421] Finish first step subjective_page.dart --- lib/config/localized_values.dart | 4 + lib/util/translations_delegate_base.dart | 2 + .../patients/profile/SOAP/add_SOAP_index.dart | 226 ++++++++-------- .../SOAP/subjective/add_allergies_widget.dart | 115 +++++++++ .../SOAP/subjective/add_history_widget.dart | 107 ++++++++ .../subjective/add_medication_widget.dart | 107 ++++++++ .../SOAP/subjective/subjective_page.dart | 242 ++++++++++++++++++ .../profile/SOAP/subjective_page.dart | 56 ---- lib/widgets/shared/TextFields.dart | 4 +- 9 files changed, 694 insertions(+), 169 deletions(-) create mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart create mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart create mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart create mode 100644 lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart delete mode 100644 lib/widgets/patients/profile/SOAP/subjective_page.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 8ae95c74..e205bb4e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -279,4 +279,8 @@ const Map> localizedValues = { 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, + "empty-message": { + "en": "Please enter message", + "ar": "يرجى ادخال الموضوع" + }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c60a65d3..7292492d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -299,6 +299,8 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index a74e5c51..2018a582 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -46,124 +46,126 @@ class _AddSOAPIndexState extends State builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).healthRecordInformation, - body: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: - BoxDecoration(boxShadow: [], color: Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: + BoxDecoration(boxShadow: [], color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 20, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - width: 20, - ), - FractionallySizedBox( - child: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.75, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: - MediaQuery.of(context).size.width * 0.05, - right: - MediaQuery.of(context).size.width * 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 5, ), - ), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - SubjectivePage(changePageViewIndex: changePageViewIndex,), - ObjectivePage(changePageViewIndex: changePageViewIndex,), - AssessmentPage(changePageViewIndex: changePageViewIndex,), - PlanPage(changePageViewIndex: changePageViewIndex,) + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), ], ), - ), - ], - ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], ), ), - ) - ], + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + width: 20, + ), + FractionallySizedBox( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.75, + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + left: + MediaQuery.of(context).size.width * 0.05, + right: + MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + SubjectivePage(changePageViewIndex: changePageViewIndex,), + ObjectivePage(changePageViewIndex: changePageViewIndex,), + AssessmentPage(changePageViewIndex: changePageViewIndex,), + PlanPage(changePageViewIndex: changePageViewIndex,) + ], + ), + ), + ], + ), + ), + ), + ) + ], + ), ), - ), - ], + ], + ), ), ), ); diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart new file mode 100644 index 00000000..54c914f9 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -0,0 +1,115 @@ + +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class AddAllergiesWidget extends StatefulWidget { + @override + _AddAllergiesWidgetState createState() => _AddAllergiesWidgetState(); +} + +class _AddAllergiesWidgetState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Allergies", + fontSize: 13.5, + onTapTextFields: () { + openAllergiesList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('White Egg'.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black), + Texts('Severe'.toUpperCase(), + variant: "bodyText", + bold: true, + color: AppGlobal.appPrimaryColor), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('White Egg'.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black), + Texts('Severe'.toUpperCase(), + variant: "bodyText", + bold: true, + color: AppGlobal.appPrimaryColor), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + ], + ), + ) + ], + ); + } + openAllergiesList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: Container( + child: Center( + child: Texts("openAllergiesList"), + )), + ); + }); + } + +} + diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart new file mode 100644 index 00000000..55df7a68 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -0,0 +1,107 @@ + +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class AddHistoryWidget extends StatefulWidget { + @override + _AddHistoryWidgetState createState() => _AddHistoryWidgetState(); +} + +class _AddHistoryWidgetState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add History", + fontSize: 13.5, + onTapTextFields: () { + openHistoryList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Abdomen Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Back Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + ], + ), + ) + ], + ); + } + openHistoryList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: Container( + child: Center( + child: Texts("HistoryList"), + )), + ); + }); + } + +} + diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart new file mode 100644 index 00000000..1db7c2e0 --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart @@ -0,0 +1,107 @@ + +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class AddMedication extends StatefulWidget { + @override + _AddMedicationState createState() => _AddMedicationState(); +} + +class _AddMedicationState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Current Medications", + fontSize: 13.5, + onTapTextFields: () { + openMedicationsList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Abdomen Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Back Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + ], + ), + ) + ], + ); + } + openMedicationsList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: Container( + child: Center( + child: Texts("dfdfd"), + )), + ); + }); + } + +} + diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart new file mode 100644 index 00000000..b5fc805e --- /dev/null +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -0,0 +1,242 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class SubjectivePage extends StatefulWidget { + final Function changePageViewIndex; + + SubjectivePage({Key key, this.changePageViewIndex}); + + @override + _SubjectivePageState createState() => _SubjectivePageState(); +} + +class _SubjectivePageState extends State { + bool isChiefExpand = true; + bool isHistoryExpand = false; + bool isAllergiesExpand = false; + + TextEditingController messageController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('CHIEF COMPLAINTS', + variant: isChiefExpand ? "bodyText" : '', + bold: isChiefExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isChiefExpand = !isChiefExpand; + }); + }, + child: Icon( + isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Chief Complaints", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "History of Present Illness", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + AddMedication(), + ]), + isExpand: isChiefExpand, + ), + + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('History', + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + AddHistoryWidget() + ], + ), + isExpand: isHistoryExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Allergies', + variant: isAllergiesExpand ? "bodyText" : '', + bold: isAllergiesExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Icon(isAllergiesExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget:Column( + children: [ + AddAllergiesWidget(), + SizedBox( + height: 30, + ), + ], + ) + , + isExpand: isAllergiesExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + AppButton( + title: TranslationBase.of(context).next, + onPressed: () { + widget.changePageViewIndex(1); + }, + ), + ], + ), + ), + ), + )); + } + +} diff --git a/lib/widgets/patients/profile/SOAP/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective_page.dart deleted file mode 100644 index fd6a6e50..00000000 --- a/lib/widgets/patients/profile/SOAP/subjective_page.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:doctor_app_flutter/config/config.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_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -class SubjectivePage extends StatelessWidget { - final Function changePageViewIndex; - - SubjectivePage({Key key, this.changePageViewIndex}); - - @override - Widget build(BuildContext context) { - return AppScaffold( - isShowAppBar: false, -// baseViewModel: widget.model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox(height: 30,), - Row(children: [ - Row( - children: [ - Texts('ASSESSMENT', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon(FontAwesomeIcons.asterisk, color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - Icon(EvaIcons.plus) - ],), - - AppButton( - title: TranslationBase.of(context).next, - onPressed: () { - changePageViewIndex(1); - }, - ), - ], - ), - ), - ), - )); - } -} diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 269ad660..e41b4379 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -8,7 +8,7 @@ class TextFields extends StatefulWidget { TextFields({Key key, this.type, this.hintText, this.suffixIcon, this.autoFocus, this.onChanged, this.initialValue, this.minLines, this.maxLines, this.inputFormatters, this.padding, this.focus=false, this.maxLengthEnforced=true, this.suffixIconColor, this.inputAction, this.onSubmit, this.keepPadding=true, this.textCapitalization = TextCapitalization.none, this.onTap, this.controller, this.keyboardType, this.validator, this.borderOnlyError=false, - this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false}) : super(key: key); + this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false, this.onTapTextFields}) : super(key: key); final String hintText; final String initialValue; @@ -18,6 +18,7 @@ class TextFields extends StatefulWidget { final Color suffixIconColor; final IconData prefixIcon; final VoidCallback onTap; + final Function onTapTextFields; final TextEditingController controller; final TextInputType keyboardType; final FormFieldValidator validator; @@ -112,6 +113,7 @@ class _TextFieldsState extends State { boxShadow: [BoxShadow(color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0)] ), child: TextFormField( + onTap: widget.onTapTextFields, keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, From e61f3f0281488f94db81bb843281441b49147ae3 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 20 Dec 2020 08:25:02 +0300 Subject: [PATCH 018/421] add sick leave --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 12 +- lib/core/service/sickleave_service.dart | 71 ++- lib/core/viewModel/sick_leave_view_model.dart | 41 +- .../sickleave/add_sickleave_request.dart | 32 ++ .../sickleave/extend_sick_leave_request.dart | 25 + .../sickleave/get_all_sickleave_response.dart | 44 ++ lib/screens/sick-leave/add-sickleave.dart | 204 +++++-- lib/screens/sick-leave/sick_leave.dart | 501 ++++++++++-------- lib/util/translations_delegate_base.dart | 10 + 11 files changed, 678 insertions(+), 268 deletions(-) create mode 100644 lib/models/sickleave/add_sickleave_request.dart create mode 100644 lib/models/sickleave/extend_sick_leave_request.dart create mode 100644 lib/models/sickleave/get_all_sickleave_response.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 94c732a5..c0a6b357 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -85,7 +85,7 @@ class BaseAppClient { if (!parsed['IsAuthenticated']) { //need to uncomment // await helpers.logout(); - + onSuccess(parsed, statusCode); helpers.showErrorToast('Your session expired Please login agian'); } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); diff --git a/lib/config/config.dart b/lib/config/config.dart index 17e23187..39dfb023 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -83,7 +83,9 @@ const GET_SICKLEAVE_STATISTIC = 'Services/DoctorApplication.svc/REST/PreSickLeaveStatistics'; const ARRIVED_PATIENT_URL = 'Services/DoctorApplication.svc/REST/PatientArrivalList​'; - +const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; +const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; +const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index dddccfa2..0abdad83 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -266,7 +266,7 @@ const Map> localizedValues = { }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, - "sick-leaves": {"en": "Patient Sick", "ar": "الاجازات المرضية"}, + "sick-leaves": {"en": "Patient Sick Leave", "ar": "الاجازات المرضية"}, "patient-sick": {"en": "Patient Sick", "ar": "المرضية"}, "leave": {"en": "Leave", "ar": "غادر"}, "submit": {"en": "Submit", "ar": "ارسال"}, @@ -295,4 +295,14 @@ const Map> localizedValues = { 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, 'add': {'en': "Add", 'ar': 'أضف'}, + 'approved': {'en': "Approved", 'ar': 'وافق'}, + 'extended': {'en': "Extended", 'ar': 'وسعوا'}, + 'pending': {'en': "Pending", 'ar': 'قيد الانتظار'}, + 'leave-start-date': {'en': "Leave start date", 'ar': 'تاريخ بدء المغادرة'}, + 'days-sick-leave': {'en': "DAYS OF SICK LEAVE", 'ar': 'أيام الإجازة المرضية'}, + 'extend': {'en': "Extend", 'ar': 'تمديد'}, + 'extend-sickleave': { + 'en': "EXTEND SICK LEAVE", + 'ar': 'قم بتمديد الإجازة المرضية' + }, }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 7e9de230..1c5ee415 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -1,10 +1,16 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; // import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; class SickLeaveService extends BaseService { Map get sickLeavestatisitics => _statistics; Map _statistics = {}; + + List get getAllSickLeave => _getAllsickLeave; + List _getAllsickLeave = []; Future getStatistics() async { hasError = false; await baseAppClient.post( @@ -18,7 +24,70 @@ class SickLeaveService extends BaseService { hasError = true; super.error = error; }, - body: {"PatientMRN": 3120737, "AppointmentNo": 2016055008}, + body: {"PatientMRN": 3120746, "AppointmentNo": 2016054661}, + ); + } + + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { + addSickLeaveRequest.appointmentNo = '2016054661'; + addSickLeaveRequest.patientMRN = '3120746'; + hasError = false; + await baseAppClient.post( + ADD_SICK_LEAVE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + print(response); + // _statistics = {}; + // _statistics = response['SickLeaveStatistics']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: addSickLeaveRequest.toJson(), + ); + } + + Future extendSickLeave(GetAllSickLeaveResponse request) async { + var extendSickLeaveRequest = ExtendSickLeaveRequest(); + extendSickLeaveRequest.patientMRN = + request.patientMRN.toString(); //'3120746'; + extendSickLeaveRequest.previousRequestNo = request.requestNo.toString(); + extendSickLeaveRequest.noOfDays = request.noOfDays.toString(); + extendSickLeaveRequest.remarks = request.remarks; + hasError = false; + await baseAppClient.post( + EXTEND_SICK_LEAVE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + print(response); + // _statistics = {}; + // _statistics = response['SickLeaveStatistics']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: extendSickLeaveRequest.toJson(), + ); + } + + Future getSickLeave() async { + hasError = false; + await baseAppClient.post( + GET_SICK_LEAVE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + _getAllsickLeave.clear(); + response['SickLeavesList']['entityList'].forEach((v) { + _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'PatientMRN': 3120772}, ); } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index eecee46d..7eac919f 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -1,6 +1,9 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart'; +import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -8,16 +11,26 @@ import 'base_view_model.dart'; class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; + get getAllSIckLeave => _sickLeaveService.getAllSickLeave; + Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { + setState(ViewState.Busy); + await _sickLeaveService.addSickLeave(addSickLeaveRequest); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } - // Future getDashboard() async { - // setState(ViewState.Busy); - // await _dashboardService.getDashboard(); - // if (_dashboardService.hasError) { - // error = _dashboardService.error; - // setState(ViewState.Error); - // } else - // setState(ViewState.Idle); - // } + Future extendSickLeave(GetAllSickLeaveResponse extendSickLeaveRequest) async { + setState(ViewState.Busy); + await _sickLeaveService.extendSickLeave(extendSickLeaveRequest); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } Future preSickLeaveStatistics() async { setState(ViewState.Busy); @@ -28,4 +41,14 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getSickLeave() async { + setState(ViewState.Busy); + await _sickLeaveService.getSickLeave(); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/models/sickleave/add_sickleave_request.dart b/lib/models/sickleave/add_sickleave_request.dart new file mode 100644 index 00000000..d398153b --- /dev/null +++ b/lib/models/sickleave/add_sickleave_request.dart @@ -0,0 +1,32 @@ +class AddSickLeaveRequest { + String patientMRN; + String appointmentNo; + String startDate; + String noOfDays; + String remarks; + + AddSickLeaveRequest( + {this.patientMRN, + this.appointmentNo, + this.startDate, + this.noOfDays, + this.remarks}); + + AddSickLeaveRequest.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + startDate = json['StartDate']; + noOfDays = json['NoOfDays']; + remarks = json['Remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['StartDate'] = this.startDate; + data['NoOfDays'] = this.noOfDays; + data['Remarks'] = this.remarks; + return data; + } +} diff --git a/lib/models/sickleave/extend_sick_leave_request.dart b/lib/models/sickleave/extend_sick_leave_request.dart new file mode 100644 index 00000000..8b61eb90 --- /dev/null +++ b/lib/models/sickleave/extend_sick_leave_request.dart @@ -0,0 +1,25 @@ +class ExtendSickLeaveRequest { + String patientMRN; + String previousRequestNo; + String noOfDays; + String remarks; + + ExtendSickLeaveRequest( + {this.patientMRN, this.previousRequestNo, this.noOfDays, this.remarks}); + + ExtendSickLeaveRequest.fromJson(Map json) { + patientMRN = json['PatientMRN']; + previousRequestNo = json['PreviousRequestNo']; + noOfDays = json['NoOfDays']; + remarks = json['Remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['PreviousRequestNo'] = this.previousRequestNo; + data['NoOfDays'] = this.noOfDays; + data['Remarks'] = this.remarks; + return data; + } +} diff --git a/lib/models/sickleave/get_all_sickleave_response.dart b/lib/models/sickleave/get_all_sickleave_response.dart new file mode 100644 index 00000000..f3fc8032 --- /dev/null +++ b/lib/models/sickleave/get_all_sickleave_response.dart @@ -0,0 +1,44 @@ +class GetAllSickLeaveResponse { + int appointmentNo; + bool isExtendedLeave; + int noOfDays; + int patientMRN; + String remarks; + int requestNo; + String startDate; + int status; + + GetAllSickLeaveResponse( + {this.appointmentNo, + this.isExtendedLeave, + this.noOfDays, + this.patientMRN, + this.remarks, + this.requestNo, + this.startDate, + this.status}); + + GetAllSickLeaveResponse.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + isExtendedLeave = json['isExtendedLeave']; + noOfDays = json['noOfDays']; + patientMRN = json['patientMRN']; + remarks = json['remarks']; + requestNo = json['requestNo']; + startDate = json['startDate']; + status = json['status']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['isExtendedLeave'] = this.isExtendedLeave; + data['noOfDays'] = this.noOfDays; + data['patientMRN'] = this.patientMRN; + data['remarks'] = this.remarks; + data['requestNo'] = this.requestNo; + data['startDate'] = this.startDate; + data['status'] = this.status; + return data; + } +} diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 57960ec2..697b9127 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -1,58 +1,184 @@ +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/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/translations_delegate_base.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 AddSickLeavScreen extends StatelessWidget { @override Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: TranslationBase.of(context).sickleave, - body: new Builder(builder: (context) { - return Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all(color: HexColor('#B8382C'), width: 4), - borderRadius: BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openSickLeave(context); + return BaseView( + onModelReady: (model) => model.getSickLeave(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: model.getAllSIckLeave.length > 0 + ? SingleChildScrollView( + child: 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: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + child: AppText( + item.status == 1 + ? TranslationBase.of( + context) + .approved + : item.status == 2 + ? TranslationBase + .of(context) + .extended + : TranslationBase + .of(context) + .pending, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + color: item.status == 1 + ? Colors.green + : Colors.yellow[800], + ), + Row( + children: [ + AppText( + TranslationBase.of( + context) + .leaveStartDate, + fontWeight: + FontWeight.bold, + ), + AppText(item.startDate) + ], + ), + AppText( + item.noOfDays.toString() + + ' ' + + TranslationBase.of( + context) + .daysSickleave, + fontWeight: FontWeight.bold, + ), + Row(children: [ + AppText( + item.remarks, + ) + ]), + ], + ), + SizedBox( + width: 20, + ), + ], + ), + ), + (item.status == 1 || item.status == 2) + ? Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.open_in_full, + size: 40, + ), + // color: Colors.green, //Colors.black, + onPressed: () => { + openSickLeave(context, true, + extendedData: item) + }, + )) + : SizedBox(), + ], + )), + SizedBox( + height: 20, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ), + ) + : new Builder(builder: (context) { + return Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: Border.all( + color: HexColor('#B8382C'), width: 4), + borderRadius: + BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).noSickLeaveApplied, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) + ], + ), + )); }), - ), - Padding( - child: AppText( - TranslationBase.of(context).noSickLeaveApplied, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - ), - ); - }), - ); + )); } - openSickLeave(BuildContext context) { + openSickLeave(BuildContext context, isExtend, + {GetAllSickLeaveResponse extendedData}) { showModalBottomSheet( context: context, builder: (context) { - return new Container(child: SickLeaveScreen()); + return new Container( + child: SickLeaveScreen( + isExtended: isExtend, + extendedData: extendedData, + )); }); } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 1eac90c3..7091a54f 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -3,9 +3,11 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; 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/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/text_validator.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_buttons_widget.dart'; @@ -17,10 +19,14 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; Helpers helpers = Helpers(); class SickLeaveScreen extends StatefulWidget { + final bool isExtended; + final GetAllSickLeaveResponse extendedData; + SickLeaveScreen({this.isExtended = false, this.extendedData}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -30,6 +36,7 @@ class _SickLeaveScreenState extends State { TextEditingController _toDateController = new TextEditingController(); String _selectedClinic; Map profile = {}; + AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { showDatePicker( context: context, @@ -41,8 +48,12 @@ class _SickLeaveScreenState extends State { return; } setState(() { - var selectedDate = DateFormat.yMd().format(pickedDate); - _toDateController.text = selectedDate; + // var selectedDate = DateFormat.yMd().format(pickedDate); + final df = new DateFormat('yyyy-MM-dd'); + addSickLeave.startDate = df.format(pickedDate); + + _toDateController.text = addSickLeave.startDate; + //addSickLeave.startDate = selectedDate; }); }); } @@ -58,233 +69,291 @@ class _SickLeaveScreenState extends State { return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics(), - builder: (_, model2, w) => Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - Padding( - child: AppText( - TranslationBase.of(context).addSickLeave, - fontWeight: FontWeight.bold, + onModelReady: (model2) => model2.preSickLeaveStatistics(), + builder: (_, model2, w) => AppScaffold( + baseViewModel: model2, + isShowAppBar: false, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Padding( + child: AppText( + widget.isExtended == true + ? TranslationBase.of(context) + .extendSickLeave + : TranslationBase.of(context) + .addSickLeave, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10)), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + borderColor: Colors.white, + onChanged: (value) { + addSickLeave.noOfDays = value; + }, + hintText: widget.extendedData != null + ? widget.extendedData.noOfDays + .toString() + : TranslationBase.of(context) + .sickLeaveDays, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ]), ), - padding: EdgeInsets.all(10)), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - borderColor: Colors.white, - onSaved: (value) {}, - hintText: TranslationBase.of(context) - .sickLeaveDays, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ]), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).sickLeaveDate, - // fontSize: 10, - // ), - AppTextFormField( - hintText: TranslationBase.of(context) - .sickLeaveDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onSaved: (value) {}), - ], - )), - Container( - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - 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), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).sickLeaveDate, + // fontSize: 10, + // ), + AppTextFormField( + hintText: widget.extendedData != null + ? widget.extendedData.startDate + : TranslationBase.of(context) + .sickLeaveDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + addSickLeave.startDate = value; + }), + ], + )), + Container( + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).clinicName, + // fontSize: 10, + // ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + model2.sickLeaveStatistics[ + 'recommendedSickLeaveDays'] != + null + ? Padding( + child: AppText( + model2.sickLeaveStatistics[ + 'recommendedSickLeaveDays'], + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ) + : SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ // AppText( - // TranslationBase.of(context).clinicName, + // TranslationBase.of(context).doctorName, // fontSize: 10, // ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName(model) ?? - "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) + new IgnorePointer( + ignoring: true, + child: AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS)) ], ), - )), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).doctorName, - // fontSize: 10, - // ), - AppTextFormField( - readOnly: true, - hintText: profile['DoctorName'], - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ], - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).remarks, - // fontSize: 10, - // ), - AppTextFormField( - borderColor: Colors.white, - hintText: TranslationBase.of(context).remarks, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ], - ), - ), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).add, - onPressed: () { - // _validateInputs(); - }, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).remarks, + // fontSize: 10, + // ), + AppTextFormField( + borderColor: Colors.white, + hintText: widget.extendedData != null + ? widget.extendedData.remarks + : TranslationBase.of(context).remarks, + onChanged: (value) { + addSickLeave.remarks = value; + }, + validator: (value) { + // return TextValidator().validateName(value); + }, + inputFormatter: ONLY_LETTERS) + ], ), - ], - ), - ), - Column( - children: [ - Texts(TranslationBase.of(context) - .previousSickLeaveIssue + - ' ') + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isExtended == true + ? TranslationBase.of(context).extend + : TranslationBase.of(context).add, + onPressed: () { + if (widget.isExtended) { + model2 + .extendSickLeave( + widget.extendedData) + .then((value) => (value) { + print(value); + }); + } else { + model2 + .addSickLeave(addSickLeave) + .then((value) => print(value)); + } + }, + ), + ], + ), + ), + // Column( + // children: [ + // Texts(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) ], - ) - ], + ), + ), ), ), - ), - ), - )); + ))); } getProfile() async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 5290e933..43fec17b 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -326,6 +326,16 @@ class TranslationBase { String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; + String get approved => localizedValues['approved'][locale.languageCode]; + String get extended => localizedValues['extended'][locale.languageCode]; + String get pending => localizedValues['pending'][locale.languageCode]; + String get leaveStartDate => + localizedValues['leave-start-date'][locale.languageCode]; + String get daysSickleave => + localizedValues['days-sick-leave'][locale.languageCode]; + String get extend => localizedValues['extend'][locale.languageCode]; + String get extendSickLeave => + localizedValues['extend-sickleave'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From c15300125eb5b3d5c43ae13027f3b3f209b6e022 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Dec 2020 14:36:27 +0200 Subject: [PATCH 019/421] First step objective_page.dart --- .../patients/patients_referred_screen.dart | 1 + .../patients/profile/SOAP/objective_page.dart | 452 +++++++++++++++++- .../SOAP/subjective/add_allergies_widget.dart | 188 +++++++- .../SOAP/subjective/add_history_widget.dart | 341 ++++++++++++- .../SOAP/subjective/subjective_page.dart | 3 +- .../shared/divider_with_spaces_around.dart | 27 ++ 6 files changed, 997 insertions(+), 15 deletions(-) create mode 100644 lib/widgets/shared/divider_with_spaces_around.dart diff --git a/lib/screens/patients/patients_referred_screen.dart b/lib/screens/patients/patients_referred_screen.dart index 70a84f03..df1427c2 100644 --- a/lib/screens/patients/patients_referred_screen.dart +++ b/lib/screens/patients/patients_referred_screen.dart @@ -46,6 +46,7 @@ class _PatientReferredScreenState extends State { Listlist=List(); return AppScaffold( + //TODO : add Translation appBarTitle: "My Referred Patients",//patientTypetitle, body: Center( diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 8960a8dc..c0df7241 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -1,18 +1,47 @@ +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; -class ObjectivePage extends StatelessWidget { +class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; ObjectivePage({Key key, this.changePageViewIndex}); + @override + _ObjectivePageState createState() => _ObjectivePageState(); +} + +class _ObjectivePageState extends State { + bool isSysExaminationExpand = false; + List ExaminationsList; + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 0.5, + )), + ); + } @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return AppScaffold( isShowAppBar: false, -// baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -21,11 +50,173 @@ class ObjectivePage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Physical/System Examination', + variant: + isSysExaminationExpand ? "bodyText" : '', + bold: isSysExaminationExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isSysExaminationExpand = + !isSysExaminationExpand; + }); + }, + child: Icon(isSysExaminationExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Examination", + fontSize: 13.5, + onTapTextFields: () { + openExaminationList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Abdomen'.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + Colors.white,Colors.grey + ), + child: Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "Normal", + style: TextStyle( + fontSize: 12, + color: + Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ), + )), + ), + onTap: () { + + }), + SizedBox(width: 12,), + InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + Color(0xFF515A5D), Colors.black + ), + child: Center( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + "Abnormal", + style: TextStyle( + fontSize: 12, + color: + Colors.white, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + ), + )), + ), + onTap: () { + + }), + ], + ), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + ], + ), + ) + ], + ) + ]), + isExpand: isSysExaminationExpand, + ), + DividerWithSpacesAround(height: 30,), AppButton( title: TranslationBase.of(context).next, - onPressed: () { - changePageViewIndex(2); - }, + onPressed: () {}, + ), + SizedBox( + height: 30, ), ], ), @@ -33,4 +224,255 @@ class ObjectivePage extends StatelessWidget { ), )); } + + openExaminationList(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + ; + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Examinations", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('Examinations', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ), + ], + ), + )), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add SELECTED Examinations".toUpperCase(), + onPressed: () {}, + ), + ]), + )), + ); + }); + } } + diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 54c914f9..9fc21aa1 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -1,8 +1,10 @@ - import 'package:doctor_app_flutter/config/config.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/TextFields.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/dialogs/dailog-list-select.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -13,8 +15,21 @@ class AddAllergiesWidget extends StatefulWidget { } class _AddAllergiesWidgetState extends State { + + List allergiesList; + dynamic _referTo; + dynamic _selectedBranch; + dynamic _selectedClinic; + dynamic _selectedDoctor; + TextEditingController remarkController = TextEditingController(); + + @override Widget build(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + return Column( children: [ Container( @@ -95,7 +110,34 @@ class _AddAllergiesWidgetState extends State { ], ); } + openAllergiesList(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + }; showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, @@ -104,8 +146,147 @@ class _AddAllergiesWidgetState extends State { return FractionallySizedBox( heightFactor: 0.7, child: Container( - child: Center( - child: Texts("openAllergiesList"), + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox( + height: 16, + ), + AppText( + "Add Allergy", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: allergiesList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: allergiesList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Allergy", + _referTo != null ? _referTo['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: allergiesList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: allergiesList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Severity", + _referTo != null ? _referTo['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ),SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + }, + ), + ] + + ), )), ); }); @@ -113,3 +294,4 @@ class _AddAllergiesWidgetState extends State { } + diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart index 55df7a68..ef08b28d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -3,23 +3,40 @@ import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; class AddHistoryWidget extends StatefulWidget { @override _AddHistoryWidgetState createState() => _AddHistoryWidgetState(); } -class _AddHistoryWidgetState extends State { +class _AddHistoryWidgetState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + void initState() { + _controller = new PageController(); + + super.initState(); + } + @override Widget build(BuildContext context) { return Column( children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), + margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: "Add History", fontSize: 13.5, @@ -87,6 +104,7 @@ class _AddHistoryWidgetState extends State { ], ); } + openHistoryList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, @@ -96,12 +114,323 @@ class _AddHistoryWidgetState extends State { return FractionallySizedBox( heightFactor: 0.7, child: Container( - child: Center( - child: Texts("HistoryList"), - )), + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) { + changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ), + ], + ), + )), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () {}, + ), + ], + ), + Container( + child: Center( + child: Texts("eee"), + ), + ), + Container( + child: Center( + child: Texts("cccc"), + ), + ), + ], + ), + ), + ], + ), + )), ); }); } +} + +class PriorityBar extends StatefulWidget { + final Function onTap; + + const PriorityBar({Key key, this.onTap}) : super(key: key); + @override + _PriorityBarState createState() => _PriorityBarState(); } +class _PriorityBarState extends State { + int _activePriority = 0; + + List _priorities = [ + "Family", + "Surgical/Sports", + "Medical", + ]; + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 2.0, + )), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return Container( + height: screenSize.height * 0.070, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + return Expanded( + child: InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + widget.onTap(_priorities.indexOf(item)); + + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + ); + }).toList(), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index b5fc805e..ce43b6c3 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -22,7 +22,7 @@ class SubjectivePage extends StatefulWidget { } class _SubjectivePageState extends State { - bool isChiefExpand = true; + bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; @@ -30,6 +30,7 @@ class _SubjectivePageState extends State { @override Widget build(BuildContext context) { + return AppScaffold( isShowAppBar: false, body: SingleChildScrollView( diff --git a/lib/widgets/shared/divider_with_spaces_around.dart b/lib/widgets/shared/divider_with_spaces_around.dart new file mode 100644 index 00000000..b43557cb --- /dev/null +++ b/lib/widgets/shared/divider_with_spaces_around.dart @@ -0,0 +1,27 @@ +import 'package:flutter/material.dart'; + +class DividerWithSpacesAround extends StatelessWidget { + DividerWithSpacesAround({ + Key key, this.height = 0, + }); + final double height ; + + @override + Widget build(BuildContext context) { + return Column( + children: [ + SizedBox( + height: height, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: height, + ), + ], + ); + } +} From 7910e6a9e92fbeea55890c3891cc660a0a55fb47 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Dec 2020 16:31:02 +0200 Subject: [PATCH 020/421] Finish step objective_page.dart + assessment_page.dart page --- .../profile/SOAP/assessment_page.dart | 464 +++++++++++++++++- .../patients/profile/SOAP/objective_page.dart | 28 +- 2 files changed, 487 insertions(+), 5 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 7649ac46..2f747d52 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -1,18 +1,40 @@ +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -class AssessmentPage extends StatelessWidget { +class AssessmentPage extends StatefulWidget { final Function changePageViewIndex; AssessmentPage({Key key, this.changePageViewIndex}); + @override + _AssessmentPageState createState() => _AssessmentPageState(); +} + +class _AssessmentPageState extends State { + bool isAssessmentExpand = false; + + List assessmentList; + dynamic _referTo; + + TextEditingController remarksController = TextEditingController(); + @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return AppScaffold( isShowAppBar: false, -// baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -21,16 +43,452 @@ class AssessmentPage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('ASSESSMENT', + variant: isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), + child: TextFields( + hintText: "Add ASSESSMENT", + fontSize: 13.5, + onTapTextFields: () { + openAssessmentDialog(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Appointment #: ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "2019054946", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Typhoid Fever", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Type : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Possible Diagnosis", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Doc : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + "Some short remark about the allergy", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + + children: [ + AppText( + "ICD: ".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "R07.1".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + children: [ + InkWell( + onTap: () {}, + child: Icon(EvaIcons.edit2Outline), + ) + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isAssessmentExpand, + ), + DividerWithSpacesAround( + height: 30, + ), AppButton( title: TranslationBase.of(context).next, onPressed: () { - changePageViewIndex(3); + widget.changePageViewIndex(3); }, ), + SizedBox( + height: 30, + ), ], ), ), ), )); } + + openAssessmentDialog(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown) { + //TODO: make one Input InputDecoration for all + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.75, + widthFactor: 0.9, + + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Assessment Details".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: assessmentList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: assessmentList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Appointment Number", + _referTo != null ? _referTo['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: assessmentList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: assessmentList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() {}); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration("Name or ICD", + _referTo != null ? _referTo['name'] : null, true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: assessmentList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: assessmentList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() {}); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration("Condition", + _referTo != null ? _referTo['name'] : null, true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: assessmentList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: assessmentList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() {}); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration("Type", + _referTo != null ? _referTo['name'] : null, true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 18, + minLines: 8, + controller: remarksController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () {}, + ), + ])), + ); + }); + } } diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index c0df7241..b2cd920f 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -23,7 +23,9 @@ class ObjectivePage extends StatefulWidget { class _ObjectivePageState extends State { bool isSysExaminationExpand = false; - List ExaminationsList; + List examinationsList; + TextEditingController remarksController = TextEditingController(); + BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { return BoxDecoration( @@ -202,6 +204,26 @@ class _ObjectivePageState extends State { SizedBox( height: 20, ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarksController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), ], ), ) @@ -213,7 +235,9 @@ class _ObjectivePageState extends State { DividerWithSpacesAround(height: 30,), AppButton( title: TranslationBase.of(context).next, - onPressed: () {}, + onPressed: () { + widget.changePageViewIndex(2); + }, ), SizedBox( height: 30, From 16e6221b9e25a87d2175cae1dd9cb30d68ebcbbf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 20 Dec 2020 21:31:22 +0200 Subject: [PATCH 021/421] Finish plan page design --- .../patients/profile/SOAP/plan_page.dart | 290 +++++++++++++++++- 1 file changed, 287 insertions(+), 3 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 5054647c..7b5ddcdc 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -1,18 +1,49 @@ +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -class PlanPage extends StatelessWidget { +class PlanPage extends StatefulWidget { final Function changePageViewIndex; PlanPage({Key key, this.changePageViewIndex}); + @override + _PlanPageState createState() => _PlanPageState(); +} + +class _PlanPageState extends State { + bool isProgressNoteExpand = false; + + List progressNoteList; + + TextEditingController progressNoteController = TextEditingController(); + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 0.5, + )), + ); + } @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return AppScaffold( isShowAppBar: false, -// baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -21,16 +52,269 @@ class PlanPage extends StatelessWidget { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Progress Note', + variant: + isProgressNoteExpand ? "bodyText" : '', + bold: isProgressNoteExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isProgressNoteExpand = + !isProgressNoteExpand; + }); + }, + child: Icon(isProgressNoteExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Progress Note", + fontSize: 13.5, + onTapTextFields: () { + openExaminationList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Padding( + padding: const EdgeInsets.all(0.0), + child: AppText( + "Some progress note about", + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ),SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Created By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah on 12 De", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Edited By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Rahim on 13 Dec", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + + ], + ), + Column( + children: [ + InkWell( + onTap: () {}, + child: Icon(EvaIcons.edit2Outline), + ) + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isProgressNoteExpand, + ), + DividerWithSpacesAround(height: 30,), AppButton( title: TranslationBase.of(context).next, onPressed: () { - changePageViewIndex(4); + widget.changePageViewIndex(2); }, ), + SizedBox( + height: 30, + ), ], ), ), ), )); } + + openExaminationList(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + ; + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.5, + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Progress Note", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 16, + minLines: 8, + controller: progressNoteController, + validator: (value) { + if (value == null) + return TranslationBase.of(context).emptyMessage; + else + return null; + }), + ),SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + }, + ), + ]), + )), + ); + }); + } } From ef6b1bc50e59b549801c549b502e1b2187866b49 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 21 Dec 2020 13:18:28 +0200 Subject: [PATCH 022/421] add master lookups --- lib/client/base_app_client.dart | 3 +- lib/config/config.dart | 1 + lib/core/enum/master_lookup_key.dart | 42 +++++++++++++++++++ lib/core/service/SOAP_service.dart | 24 ++++++++++- lib/core/viewModel/SOAP_view_model.dart | 11 +++++ lib/locator.dart | 4 ++ .../SOAP/subjective/subjective_page.dart | 28 ++++++++----- 7 files changed, 99 insertions(+), 14 deletions(-) create mode 100644 lib/core/enum/master_lookup_key.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index b2b76709..46d34f26 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -50,7 +50,6 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; - body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ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IkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgxMDYwOTgsImV4cCI6MTYwODk3MDA5OCwiaWF0IjoxNjA4MTA2MDk4fQ.EJ_QwlrHPQncnU_CP0HpnERPidpIl5nFQzqB2VNFbNs"; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; @@ -64,6 +63,8 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; + // body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZWE0M2QxOTEtMWY1OS00ZWY1LThmYTYtM2ExYzBkNjQyNjc5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NTk0NyIsIkN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2VNFbNs"; + print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/config/config.dart b/lib/config/config.dart index 0ee1eb0d..817925f5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -84,6 +84,7 @@ const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; +const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; var selectedPatientType = 1; diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart new file mode 100644 index 00000000..2ea576c6 --- /dev/null +++ b/lib/core/enum/master_lookup_key.dart @@ -0,0 +1,42 @@ +enum MasterKeysService { + Allergies, + HistoryFamily, + HistoryMedical, + HistorySocial, + HistorySports, + HistorySurgical, + PhysicalExamination, + AllergySeverity +} + +extension SelectedMasterKeysService on MasterKeysService { + // ignore: missing_return + int getMasterKeyService() { + switch (this) { + case MasterKeysService.Allergies: + return 11; + break; + case MasterKeysService.HistoryFamily: + return 36; + break; + case MasterKeysService.HistoryMedical: + return 37; + break; + case MasterKeysService.HistorySocial: + return 38; + break; + case MasterKeysService.HistorySports: + return 39; + break; + case MasterKeysService.HistorySurgical: + return 66; + break; + case MasterKeysService.PhysicalExamination: + return 59; + break; + case MasterKeysService.AllergySeverity: + return 55; + break; + } + } +} diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 3ab75c27..69e1adb1 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,12 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; class SOAPService extends BaseService { - List get listOfAllergies => _listOfAllergies; - List _listOfAllergies = []; + List get listOfAllergies => _listOfAllergies; + List _listOfAllergies = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { @@ -22,4 +23,23 @@ class SOAPService extends BaseService { super.error = error; }, body: getAllergiesRequestModel.toJson(),); } + + Future getMasterLookup(MasterKeysService masterKeys) async { + Map body = { + "MasterInput" : masterKeys.getMasterKeyService() + }; + print("fdfd"); + await baseAppClient.post(GET_MASTER_LOOKUP_LIST, + onSuccess: (dynamic response, int statusCode) { + _listOfAllergies.clear(); + response['MasterLookUpList']['entityList'].forEach((v) { + _listOfAllergies + .add(v); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index a68f3991..b34e56d8 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; @@ -20,4 +21,14 @@ class SOAPViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getMasterLookup(MasterKeysService masterKeys) async { + setState(ViewState.Busy); + await _SOAPService.getMasterLookup(masterKeys); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..012ad17b 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -2,11 +2,13 @@ import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:get_it/get_it.dart'; +import 'core/service/SOAP_service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_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/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; @@ -24,6 +26,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => SOAPService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +35,5 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => SOAPViewModel()); } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index ce43b6c3..eafa07c2 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -1,4 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; @@ -30,8 +33,9 @@ class _SubjectivePageState extends State { @override Widget build(BuildContext context) { - - return AppScaffold( + return BaseView( + onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -227,17 +231,19 @@ class _SubjectivePageState extends State { SizedBox( height: 30, ), - AppButton( - title: TranslationBase.of(context).next, - onPressed: () { - widget.changePageViewIndex(1); - }, + AppButton( + title: TranslationBase + .of(context) + .next, + onPressed: () { + widget.changePageViewIndex(1); + }, + ), + ], ), - ], + ), ), - ), - ), - )); + ),),); } } From 8d58348267e83b91546d30049ce55408a8caf780 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 21 Dec 2020 16:32:39 +0300 Subject: [PATCH 023/421] dashboard changes --- lib/config/config.dart | 9 +- lib/config/localized_values.dart | 1 + lib/core/service/dasboard_service.dart | 12 +- lib/core/service/sickleave_service.dart | 4 +- lib/core/viewModel/sick_leave_view_model.dart | 4 +- lib/screens/dashboard_screen.dart | 721 +++++++++++------ lib/screens/patients/patients_screen.dart | 751 +++++++++--------- lib/screens/sick-leave/add-sickleave.dart | 20 +- lib/screens/sick-leave/sick_leave.dart | 11 +- lib/util/translations_delegate_base.dart | 2 + .../prescription_out_patinets_widget.dart | 46 +- lib/widgets/shared/app_texts_widget.dart | 5 +- 12 files changed, 923 insertions(+), 663 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 39dfb023..2e0adf27 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -96,7 +96,8 @@ var SERVICES_PATIANT = [ "GtMyReferredPatient", "GtMyDischargeReferralPatient", "GtMyTomorrowPatient", - "GtMyReferralPatient" + "GtMyReferralPatient", + "PatientArrivalList" ]; var SERVICES_PATIANT2 = [ "List_MyOutPatient", @@ -114,7 +115,8 @@ var SERVICES_PATIANT_HEADER = [ "Referred", "Referral Discharge", "Tomorrow", - "Referral" + "Referral", + "Arrived" ]; var SERVICES_PATIANT_HEADER_AR = [ "المريض الخارجي", @@ -123,7 +125,8 @@ var SERVICES_PATIANT_HEADER_AR = [ "المريض المحول الي", "المريض المحال المعافى", "مريض الغد", - "المريض المحول مني" + "المريض المحول مني", + "وصل المريض" ]; //****************** diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0abdad83..3ba857e0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -305,4 +305,5 @@ const Map> localizedValues = { 'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية' }, + 'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'} }; diff --git a/lib/core/service/dasboard_service.dart b/lib/core/service/dasboard_service.dart index 8ad8aa4f..5a66e9eb 100644 --- a/lib/core/service/dasboard_service.dart +++ b/lib/core/service/dasboard_service.dart @@ -1,20 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -// import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; class DashboardService extends BaseService { - var _dashboardItemsList = []; - get dashboardItemsList => _dashboardItemsList; + List _dashboardItemsList = []; + List get dashboardItemsList => _dashboardItemsList; // DashboardModel _dashboard = DashboardModel(); Future getDashboard() async { - return Future.value(null); + hasError = false; await baseAppClient.post( GET_DASHBOARD, onSuccess: (dynamic response, int statusCode) { _dashboardItemsList.clear(); - _dashboardItemsList = response['listDoctorDashboarKPI']; + response['listDoctorDashboarKPI'].forEach((v) { + _dashboardItemsList.add(DashboardModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 1c5ee415..70d9a3e4 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -11,7 +11,7 @@ class SickLeaveService extends BaseService { List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = []; - Future getStatistics() async { + Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( GET_SICKLEAVE_STATISTIC, @@ -24,7 +24,7 @@ class SickLeaveService extends BaseService { hasError = true; super.error = error; }, - body: {"PatientMRN": 3120746, "AppointmentNo": 2016054661}, + body: {"PatientMRN": patientMRN, "AppointmentNo": appoNo}, ); } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 7eac919f..a11d43ec 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -32,9 +32,9 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future preSickLeaveStatistics() async { + Future preSickLeaveStatistics(appoNo, patientMRN) async { setState(ViewState.Busy); - await _sickLeaveService.getStatistics(); + await _sickLeaveService.getStatistics(appoNo, patientMRN); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index ce5776ac..0e7e5382 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -19,7 +19,7 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:provider/provider.dart'; - +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; import '../routes.dart'; import '../widgets/shared/app_texts_widget.dart'; import 'doctor/doctor_reply_screen.dart'; @@ -47,7 +47,8 @@ class _DashboardScreenState extends State { ProjectProvider projectsProvider; var _isInit = true; DoctorProfileModel profile; - + bool isExpanded = false; + String isInpatient = ""; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -77,7 +78,6 @@ class _DashboardScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - isLoading: isLoading, body: ListView(children: [ Column( children: [ @@ -211,182 +211,437 @@ class _DashboardScreenState extends State { ), Container( color: Colors.white, - height: 90, + height: this.isExpanded ? 150 : 90, ), ], ), Positioned( - right: 9.0, - left: 9, - bottom: 19, - child: Container( - decoration: BoxDecoration( - color: HexColor("#DED8CF"), - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - ), - margin: EdgeInsets.only(left: 10, right: 10), - height: 140, - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Divider(), - Padding( - padding: const EdgeInsets.only( - top: 8.0, bottom: 8, right: 40, left: 8), - child: CircularPercentIndicator( - radius: 100, - animation: true, - animationDuration: 1200, - lineWidth: 7.0, - percent: .75, - center: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - AppText( - "38", - fontSize: SizeConfig.textMultiplier * 3.7, - color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold, - ), - AppText( - TranslationBase.of(context).outPatients, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.4, - color: HexColor('#5D4C35'), - ), - ], + right: 9.0, + left: 9, + bottom: 15, + child: ExpandableCardContainer( + expandedChild: Container( + margin: EdgeInsets.only(left: 10, right: 10), + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.22 + : MediaQuery.of(context).size.height * 0.25, + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DashboardItem( + onTap: () { + setState(() { + this.isExpanded = false; + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + children: [ + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[0] + .value + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[0] + .value + .toString() + : "", + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 24, + ), + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[0] + .kPIParameter + : model + .dashboardItemsList[ + 1] + .summaryoptions[0] + .kPIParameter + : "", + //'My Admitted Patient', + color: Colors.white, + textAlign: TextAlign.center, + fontSize: 12, + ) + ], + )), + Expanded( + child: Column( + children: [ + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[1] + .value + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[1] + .value + .toString() + : "", + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 28, + ), + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[1] + .kPIParameter + : model + .dashboardItemsList[ + 1] + .summaryoptions[1] + .kPIParameter + : "", + color: Colors.white, + textAlign: TextAlign.center, + fontSize: 12, + ) + ], + )), + Expanded( + child: Column( + children: [ + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[2] + .value + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[2] + .value + .toString() + : "", + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 28), + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[2] + .kPIParameter + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[2] + .kPIParameter + .toString() + : "", + color: Colors.white, + fontSize: 12, + textAlign: TextAlign.center) + ], + )) + ], + ), + Row( + children: [ + Expanded( + child: Column( + children: [ + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[3] + .value + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[3] + .value + .toString() + : "", + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 28), + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[3] + .kPIParameter + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[3] + .kPIParameter + .toString() + : "", + color: Colors.white, + fontSize: 12, + textAlign: TextAlign.center) + ], + )), + Expanded( + child: Column( + children: [ + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[ + 4] + .value + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[ + 4] + .value + .toString() + : "", + fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 28), + AppText( + model.dashboardItemsList + .length > + 0 + ? isInpatient == 'in' + ? model + .dashboardItemsList[ + 0] + .summaryoptions[ + 4] + .kPIParameter + .toString() + : model + .dashboardItemsList[ + 1] + .summaryoptions[ + 4] + .kPIParameter + .toString() + : "", + color: Colors.white, + fontSize: 12, + textAlign: TextAlign.center) + ], + ), + ), + Expanded( + child: Container(), + ) + ], + ) + ], + )), + imageName: '5.png', + color: HexColor('#B8382C'), + hasBorder: false, + width: MediaQuery.of(context).size.width * 0.9, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.22 + : MediaQuery.of(context).size.height * 0.25, ), - circularStrokeCap: CircularStrokeCap.butt, - backgroundColor: Colors.blueGrey[100], - progressColor: HexColor('#B8382C'), - ), + ], ), - Container( - child: Table( - defaultColumnWidth: FixedColumnWidth( - MediaQuery.of(context).size.width / 5), -// border: TableBorder.all( -// color: Colors.black26, -// width: 1, -// style: BorderStyle.solid), - border: TableBorder.symmetric( - inside: BorderSide( - width: 0.5, - color: HexColor('#5D4C35'), - ), - ), - children: [ - TableRow( - children: [ - TableCell( - child: Center( - child: Column( + ), + collapsedChild: Container( + margin: EdgeInsets.only(left: 10, right: 10), + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.15 + : MediaQuery.of(context).size.height * 0.25, + width: double.infinity, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + DashboardItem( + onTap: () { + setState(() { + this.isExpanded = true; + this.isInpatient = 'in'; + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - InkWell( - child: AppText( - TranslationBase.of(context).arrived, - fontSize: - SizeConfig.textMultiplier * 1.5, - color: HexColor('#5D4C35'), - ), - onTap: () {}, - ), AppText( - "23", + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[0]) + : "", fontSize: - SizeConfig.textMultiplier * 2.7, - color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 6, + SizeConfig.textMultiplier * 6, + color: Colors.white, ), + Flexible( + child: AppText( + TranslationBase.of(context).inPatient, + color: Colors.white, + textOverflow: TextOverflow.ellipsis, + )), ], ), - )), - TableCell( - child: Column( + Padding( + padding: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Icon( + DoctorApp.in_patient_white, + size: 35, + color: Colors.white, + ) + ], + )) + ], + ), + ), + imageName: '4.png', + color: HexColor('#B8382C'), + hasBorder: false, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.15 + : MediaQuery.of(context).size.height * 0.25, + ), + DashboardItem( + onTap: () { + setState(() { + isExpanded = true; + this.isInpatient = 'out'; + }); + }, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).er, - fontSize: - SizeConfig.textMultiplier * 1.5, - color: HexColor('#5D4C35'), - ), - AppText( - "03", + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[1]) + : "", fontSize: - SizeConfig.textMultiplier * 2.7, - color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 6, + SizeConfig.textMultiplier * 6, + color: Colors.white, ), + Flexible( + child: AppText( + TranslationBase.of(context) + .outPatients, + color: Colors.white, + textOverflow: TextOverflow.ellipsis, + )), ], ), - ), - ], -// - ), - TableRow(children: [ - TableCell( - child: Column( - children: [ - SizedBox( - height: 6, - ), - AppText( - TranslationBase.of(context).notArrived, - fontSize: - SizeConfig.textMultiplier * 1.5, - color: HexColor('#5D4C35'), - ), - AppText( - "15", - fontSize: - SizeConfig.textMultiplier * 2.7, - color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold, - ), - ], - ), - ), - TableCell( - child: Column( - children: [ - SizedBox( - height: 6, - ), - AppText( - TranslationBase.of(context).walkIn, - fontSize: - SizeConfig.textMultiplier * 1.5, - color: HexColor('#5D4C35'), - ), - AppText( - "04", - fontSize: - SizeConfig.textMultiplier * 2.7, - color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold, - ), - ], - ), + Padding( + padding: EdgeInsets.all(5), + child: Column( + mainAxisAlignment: + MainAxisAlignment.end, + children: [ + Icon( + DoctorApp.out_patient, + size: 35, + color: Colors.white, + ) + ], + )) + ], ), - ]), - ], - ), + ), + imageName: '5.png', + color: HexColor('#B8382C'), + hasBorder: false, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.15 + : MediaQuery.of(context).size.height * 0.25, + ), + ], ), - Divider(), - ], - ), - ), - ) + ), + isExpanded: isExpanded, + )) ]), FractionallySizedBox( widthFactor: 0.90, @@ -412,16 +667,21 @@ class _DashboardScreenState extends State { ), ), Container( - margin: EdgeInsets.only(bottom: 10), + // margin: EdgeInsets.only(bottom: 10), child: Column( children: [ AppText( - "08", + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[7]) + : "", fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, ), AppText( - TranslationBase.of(context).labResult, + TranslationBase.of(context) + .targetPatient, + textAlign: TextAlign.center, color: Colors.white, ) ], @@ -449,7 +709,10 @@ class _DashboardScreenState extends State { child: Column( children: [ AppText( - "10", + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[6]) + : "", fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, ), @@ -482,7 +745,10 @@ class _DashboardScreenState extends State { child: Column( children: [ AppText( - "05", + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[2]) + : "", fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, ), @@ -503,99 +769,6 @@ class _DashboardScreenState extends State { SizedBox( height: 15, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Icon( - DoctorApp.in_patient_white, - size: 40, - color: Colors.white, - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - AppText( - "14", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - AppText( - TranslationBase.of(context).inPatient, - color: Colors.white, - ) - ], - ) - ], - ), - ), - imageName: '4.png', - color: HexColor('#B8382C'), - hasBorder: false, - width: MediaQuery.of(context).size.width * 0.44, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.13 - : MediaQuery.of(context).size.height * 0.25, - ), - DashboardItem( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Column( - children: [ - Icon( - DoctorApp.operations, - size: 40, - color: Colors.white, - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - AppText( - "07", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - AppText( - TranslationBase.of(context).operations, - color: Colors.white, - ) - ], - ) - ], - ), - ), - imageName: '5.png', - color: HexColor('#B8382C'), - hasBorder: false, - width: MediaQuery.of(context).size.width * 0.44, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.13 - : MediaQuery.of(context).size.height * 0.25, - ), - ], - ), - SizedBox( - height: 15, - ), Row( children: [ AppText( @@ -909,8 +1082,17 @@ class _DashboardScreenState extends State { this.isLoading = val; }); } + + getPatientCount(DashboardModel inPatientCount) { + int value = 0; + inPatientCount.summaryoptions.forEach((result) => {value += result.value}); + + return value.toString(); + } } +getSummaryResult(item) {} + // TODO Move to it file class DashboardItem extends StatelessWidget { const DashboardItem( @@ -970,3 +1152,28 @@ class DashboardItem extends StatelessWidget { ); } } + +class ExpandableCardContainer extends StatefulWidget { + final bool isExpanded; + final Widget collapsedChild; + final Widget expandedChild; + + const ExpandableCardContainer( + {Key key, this.isExpanded, this.collapsedChild, this.expandedChild}) + : super(key: key); + + @override + _ExpandableCardContainerState createState() => + _ExpandableCardContainerState(); +} + +class _ExpandableCardContainerState extends State { + @override + Widget build(BuildContext context) { + return new AnimatedContainer( + duration: new Duration(milliseconds: 1000), + curve: Curves.easeInOut, + child: widget.isExpanded ? widget.expandedChild : widget.collapsedChild, + ); + } +} diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4ca3e587..d278dbcd 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -246,24 +246,13 @@ class _PatientsScreenState extends State { @override Widget build(BuildContext context) { _locations = [ - TranslationBase - .of(context) - .all, - TranslationBase - .of(context) - .today, - TranslationBase - .of(context) - .tomorrow, - TranslationBase - .of(context) - .nextWeek, + TranslationBase.of(context).all, + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, ]; projectsProvider = Provider.of(context); - final routeArgs = ModalRoute - .of(context) - .settings - .arguments as Map; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patientSearchForm']; @@ -300,397 +289,394 @@ class _PatientsScreenState extends State { }); }); }, - builder: (_, model, w) => - AppScaffold( - appBarTitle: patientTypeTitle, - body: _isLoading - ? DrAppCircularProgressIndeicator() - : _isError + builder: (_, model, w) => AppScaffold( + appBarTitle: patientTypeTitle, + body: _isLoading + ? DrAppCircularProgressIndeicator() + : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: TranslationBase - .of(context) - .youDontHaveAnyPatient) - : Container( - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : 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, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatient), + ? DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient) + : Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child: lItems == null + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 0, 0, 0, 0), //250 + child: + DrAppCircularProgressIndeicator(), + )), ), - ), - 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), - child: (responseModelList.length > 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList.map( - (PatiantInformtion item) { - return Container( - decoration: - myBoxDecoration(), - child: InkWell( - child: 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), - ), - width: 70, - height: 70, - child: Icon( - item.genderDescription == - "Male" - ? DoctorApp - .male - : DoctorApp - .female_icon, - size: 70, - color: Colors - .white, + ], + ) + : 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, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: buildInputDecoration( + context, + TranslationBase.of(context) + .searchPatient), + ), + ), + 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), + child: (responseModelList.length > 0) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: responseModelList + .map((PatiantInformtion + item) { + return Container( + decoration: + myBoxDecoration(), + 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) + ], + borderRadius: + BorderRadius.all( + Radius.circular(35.0)), + color: Color( + 0xffCCCCCC), + ), + width: 70, + height: 70, + child: Icon( + item.genderDescription == + "Male" + ? DoctorApp + .male + : DoctorApp + .female_icon, + size: 70, + color: Colors + .white, + ), ), ), - ), - ], - ), + ], + ), - SizedBox( - width: 10, - ), + SizedBox( + width: 10, + ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Column( - children: [ - SizedBox( - height: - 10.0, - ), - Padding( - padding: EdgeInsets.symmetric( - vertical: - 5.5, - horizontal: - 22.5), - child: - AppText( - item.firstName + - " " + - item.lastName, - fontSize: - 2.0 * - SizeConfig.textMultiplier, - fontWeight: - FontWeight.bold, - backGroundcolor: - Colors.white, + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + Column( + children: [ + SizedBox( + height: + 10.0, ), - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: < - Widget>[ - Wrap( - children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: + 5.5, + horizontal: + 22.5), + child: AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.patientId.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 2.5, - ), - AppText( - 'NATIONALITY: ' + - item.nationalityName.toString(), + item.firstName + + " " + + item.lastName, fontSize: - 1.8 * SizeConfig.textMultiplier, + 2.0 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), - SizedBox( - height: - 15.5, - ), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceAround, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: < + Widget>[ + Wrap( + children: [ + AppText( + TranslationBase.of(context).fileNo, + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + AppText( + item.patientId.toString(), + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + backGroundcolor: Colors.white, + ), + ], + ), + SizedBox( + height: + 2.5, + ), + AppText( + 'NATIONALITY: ' + + item.nationalityName.toString(), + fontSize: + 1.8 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.bold, + backGroundcolor: + Colors.white, + ), + SizedBox( + height: + 15.5, + ), + SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + item.startTime, + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), ), - child: AppText( - item.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, + SizedBox( + width: 3.5, ), - ), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(item.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + child: AppText( + convertDateFormat2(item.appointmentDate.toString()), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), ), - ), - SizedBox( - height: 0.5, - ) - ], - ) - : SizedBox( - height: 5, + SizedBox( + height: 0.5, + ) + ], + ) + : SizedBox( + height: 5, + ), + ], + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + // mainAxisAlignment: + // MainAxisAlignment + // .spaceBetween, + children: < + Widget>[ + SizedBox( + height: + 0.5, + ), + SizedBox( + height: + 0, + ), + Wrap( + children: [ + AppText( + TranslationBase.of(context).age2, + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, ), - ], - ), - Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - // mainAxisAlignment: - // MainAxisAlignment - // .spaceBetween, - children: < - Widget>[ - SizedBox( - height: - 0.5, - ), - SizedBox( - height: - 0, - ), - Wrap( - children: [ - AppText( - TranslationBase.of(context).age2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.age.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 2.5, - ), - Wrap( - children: [ - AppText( - TranslationBase.of(context).gender2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.gender.toString() == '1' ? 'Male' : 'Female', - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 8, - ), - SERVICES_PATIANT2[int.parse(patientType)] == - "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), + AppText( + item.age.toString(), + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + backGroundcolor: Colors.white, + ), + ], + ), + SizedBox( + height: + 2.5, + ), + Wrap( + children: [ + AppText( + TranslationBase.of(context).gender2, + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + AppText( + item.gender.toString() == '1' ? 'Male' : 'Female', + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + backGroundcolor: Colors.white, + ), + ], + ), + SizedBox( + height: + 8, + ), + SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + item.startTime, + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), ), - child: AppText( - item.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, + SizedBox( + width: 3.5, ), - ), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(item.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + child: AppText( + convertDateFormat2(item.appointmentDate.toString()), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), ), - ), - SizedBox( - height: 25.5, - ), - ], - ) - : SizedBox( - height: 15, - ), - ], - ), - ], - ), - ], + SizedBox( + height: 25.5, + ), + ], + ) + : SizedBox( + height: 15, + ), + ], + ), + ], + ), + ], + ), ), - ), - // Divider(color: Colors.grey) - ], + // Divider(color: Colors.grey) + ], + ), + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item + }); + }, ), - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item - }); - }, - ), - ); - }).toList(), - ) - : Center( - child: DrAppEmbeddedError( - error: TranslationBase.of( - context) - .youDontHaveAnyPatient), + ); + }).toList(), + ) + : Center( + child: DrAppEmbeddedError( + error: TranslationBase.of( + context) + .youDontHaveAnyPatient), + ), ), - ), - ], - ), - ) - ], - ), - ), - ),); + ], + ), + ) + ], + ), + ), + ), + ); } InputDecoration buildInputDecoration(BuildContext context, hint) { @@ -760,7 +746,6 @@ class _PatientsScreenState extends State { ), ), onTap: () { - filterBooking(item.toString()); setState(() { diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 697b9127..37bf9454 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -35,9 +35,9 @@ class AddSickLeavScreen extends StatelessWidget { children: [ Expanded( flex: 4, - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, + child: Wrap( + // mainAxisAlignment: + // MainAxisAlignment.start, children: [ Column( crossAxisAlignment: @@ -68,12 +68,18 @@ class AddSickLeavScreen extends StatelessWidget { children: [ AppText( TranslationBase.of( - context) - .leaveStartDate, + context) + .leaveStartDate + + ' ', fontWeight: FontWeight.bold, ), - AppText(item.startDate) + Flexible( + child: Text( + item.startDate, + overflow: + TextOverflow.ellipsis, + )) ], ), AppText( @@ -176,6 +182,8 @@ class AddSickLeavScreen extends StatelessWidget { builder: (context) { return new Container( child: SickLeaveScreen( + appointmentNo: extendedData.appointmentNo, + patientMRN: extendedData.patientMRN, isExtended: isExtend, extendedData: extendedData, )); diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 7091a54f..026b7c19 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -26,7 +26,13 @@ Helpers helpers = Helpers(); class SickLeaveScreen extends StatefulWidget { final bool isExtended; final GetAllSickLeaveResponse extendedData; - SickLeaveScreen({this.isExtended = false, this.extendedData}); + final appointmentNo; + final patientMRN; + SickLeaveScreen( + {this.appointmentNo, + this.patientMRN, + this.isExtended = false, + this.extendedData}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -69,7 +75,8 @@ class _SickLeaveScreenState extends State { return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.preSickLeaveStatistics(), + onModelReady: (model2) => model2.preSickLeaveStatistics( + widget.appointmentNo, widget.patientMRN), builder: (_, model2, w) => AppScaffold( baseViewModel: model2, isShowAppBar: false, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 43fec17b..1dde64be 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -336,6 +336,8 @@ class TranslationBase { String get extend => localizedValues['extend'][locale.languageCode]; String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; + String get targetPatient => + localizedValues['patient-target'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index fd43e48d..bfb7b8c7 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -1,11 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'large_avatar.dart'; @@ -18,7 +20,41 @@ class PrescriptionOutPatientWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( child: patientPrescriptionsList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions') + ? Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: + Border.all(color: HexColor('#B8382C'), width: 4), + borderRadius: BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + openAddPrescription(context); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).noSickLeaveApplied, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) + ], + ), + )) : Container( margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), @@ -91,4 +127,12 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), ); } + + openAddPrescription(BuildContext context) { + showModalBottomSheet( + context: context, + builder: (context) { + return new Container(); + }); + } } diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index e52dab51..d5320bb9 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -20,7 +20,7 @@ class AppText extends StatefulWidget { final bool visibility; final TextAlign textAlign; final Color backGroundcolor; - + final TextOverflow textOverflow; AppText(this.data, {this.color = Colors.black, this.fontWeight = FontWeight.normal, @@ -33,6 +33,7 @@ class AppText extends StatefulWidget { this.marginLeft = 0, this.visibility = true, this.textAlign, + this.textOverflow, this.backGroundcolor = Colors.white}); @override @@ -55,7 +56,7 @@ class _AppTextState extends State { child: Text( widget.data, textAlign: widget.textAlign, - overflow: TextOverflow.clip, + overflow: widget.textOverflow ?? TextOverflow.clip, style: TextStyle( color: widget.color, fontWeight: widget.fontWeight, From df68e912b51afc60032f6ef0c7bbf43b3deb42ac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 22 Dec 2020 17:40:22 +0200 Subject: [PATCH 024/421] first step from calling history --- lib/client/base_app_client.dart | 2 +- lib/core/service/SOAP_service.dart | 87 ++- lib/core/viewModel/SOAP_view_model.dart | 4 +- lib/models/SOAP/master_key_model.dart | 76 +++ lib/models/SOAP/my_selected_allergy.dart | 32 + .../SOAP/subjective/add_allergies_widget.dart | 485 ++++++++------- .../SOAP/subjective/add_history_widget.dart | 551 ++++++++++-------- .../SOAP/subjective/subjective_page.dart | 8 +- .../shared/dialogs/master_key_dailog.dart | 86 +++ 9 files changed, 833 insertions(+), 498 deletions(-) create mode 100644 lib/models/SOAP/master_key_model.dart create mode 100644 lib/models/SOAP/my_selected_allergy.dart create mode 100644 lib/widgets/shared/dialogs/master_key_dailog.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 46d34f26..cc77681f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -63,7 +63,7 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - // body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiZWE0M2QxOTEtMWY1OS00ZWY1LThmYTYtM2ExYzBkNjQyNjc5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NTk0NyIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRV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CJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1ODU1MzAiLCJDbGluaWNJZCI6IjE3Iiwicm9sZSI6IkRPQ1RPUlMiLCJuYmYiOjE2MDg1NTMxMDAsImV4cCI6MTYwOTQxNzEwMCwiaWF0IjoxNjA4NTUzMTAwfQ.lydDI-nsHlmb4Z4vesnckCU1i3hnNayoWVacc3E5_XM"; print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 69e1adb1..de729be3 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,45 +1,80 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class SOAPService extends BaseService { - - List get listOfAllergies => _listOfAllergies; - List _listOfAllergies = []; - + List get listOfAllergies => _listOfAllergies; + List get allergySeverityList => _allergySeverityList; + List _listOfAllergies = []; + List _allergySeverityList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { - await baseAppClient.post(GET_ALLERGIES, - onSuccess: (dynamic response, int statusCode) { - _listOfAllergies.clear(); - response['List_Allergies']['entityList'].forEach((v) { - _listOfAllergies - .add(AllergyModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: getAllergiesRequestModel.toJson(),); + await baseAppClient.post( + GET_ALLERGIES, + onSuccess: (dynamic response, int statusCode) { + _listOfAllergies.clear(); + response['List_Allergies']['entityList'].forEach((v) { + _listOfAllergies.add(MasterKeyModel.fromJson(v)); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: getAllergiesRequestModel.toJson(), + ); } Future getMasterLookup(MasterKeysService masterKeys) async { Map body = { - "MasterInput" : masterKeys.getMasterKeyService() + "MasterInput": masterKeys.getMasterKeyService() }; - print("fdfd"); await baseAppClient.post(GET_MASTER_LOOKUP_LIST, - onSuccess: (dynamic response, int statusCode) { + onSuccess: (dynamic response, int statusCode) { + setMasterLookupInCorrectArray( + response['MasterLookUpList']['entityList'], masterKeys); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { + switch (masterKeys) { + case MasterKeysService.Allergies: _listOfAllergies.clear(); - response['MasterLookUpList']['entityList'].forEach((v) { + entryList.forEach((v) { _listOfAllergies - .add(v); + .add(MasterKeyModel.fromJson(v)); }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + break; + case MasterKeysService.HistoryFamily: + return 36; + break; + case MasterKeysService.HistoryMedical: + return 37; + break; + case MasterKeysService.HistorySocial: + return 38; + break; + case MasterKeysService.HistorySports: + return 39; + break; + case MasterKeysService.HistorySurgical: + return 66; + break; + case MasterKeysService.PhysicalExamination: + return 59; + break; + case MasterKeysService.AllergySeverity: + _allergySeverityList.clear(); + entryList.forEach((v) { + _allergySeverityList + .add(MasterKeyModel.fromJson(v)); + }); + break; + } } - } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index b34e56d8..b48bfcba 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -10,7 +11,8 @@ import 'base_view_model.dart'; class SOAPViewModel extends BaseViewModel { SOAPService _SOAPService = locator(); - List get listOfAllergies => _SOAPService.listOfAllergies; + List get listOfAllergies => _SOAPService.listOfAllergies; + List get allergySeverityList => _SOAPService.allergySeverityList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart new file mode 100644 index 00000000..79615f82 --- /dev/null +++ b/lib/models/SOAP/master_key_model.dart @@ -0,0 +1,76 @@ +class MasterKeyModel { + String alias; + String aliasN; + int code; + Null description; + Null detail1; + Null detail2; + Null detail3; + Null detail4; + Null detail5; + int groupID; + int id; + String nameAr; + String nameEn; + Null remarks; + int typeId; + String valueList; + + MasterKeyModel( + {this.alias, + this.aliasN, + this.code, + this.description, + this.detail1, + this.detail2, + this.detail3, + this.detail4, + this.detail5, + this.groupID, + this.id, + this.nameAr, + this.nameEn, + this.remarks, + this.typeId, + this.valueList}); + + MasterKeyModel.fromJson(Map json) { + alias = json['alias']; + aliasN = json['aliasN']; + code = json['code']; + description = json['description']; + detail1 = json['detail1']; + detail2 = json['detail2']; + detail3 = json['detail3']; + detail4 = json['detail4']; + detail5 = json['detail5']; + groupID = json['groupID']; + id = json['id']; + nameAr = json['nameAr']; + nameEn = json['nameEn']; + remarks = json['remarks']; + typeId = json['typeId']; + valueList = json['valueList']; + } + + Map toJson() { + final Map data = new Map(); + data['alias'] = this.alias; + data['aliasN'] = this.aliasN; + data['code'] = this.code; + data['description'] = this.description; + data['detail1'] = this.detail1; + data['detail2'] = this.detail2; + data['detail3'] = this.detail3; + data['detail4'] = this.detail4; + data['detail5'] = this.detail5; + data['groupID'] = this.groupID; + data['id'] = this.id; + data['nameAr'] = this.nameAr; + data['nameEn'] = this.nameEn; + data['remarks'] = this.remarks; + data['typeId'] = this.typeId; + data['valueList'] = this.valueList; + return data; + } +} diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart new file mode 100644 index 00000000..9996b65a --- /dev/null +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -0,0 +1,32 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAllergy { + MasterKeyModel selectedAllergySeverity; + MasterKeyModel selectedAllergy; + String remark; + + MySelectedAllergy( + {this.selectedAllergySeverity, this.selectedAllergy, this.remark}); + + MySelectedAllergy.fromJson(Map json) { + selectedAllergySeverity = json['selectedAllergySeverity'] != null + ? new MasterKeyModel.fromJson(json['selectedAllergySeverity']) + : null; + selectedAllergy = json['selectedAllergy'] != null + ? new MasterKeyModel.fromJson(json['selectedAllergy']) + : null; + remark = json['remark']; + } + + Map toJson() { + final Map data = new Map(); + if (this.selectedAllergySeverity != null) { + data['selectedAllergySeverity'] = this.selectedAllergySeverity.toJson(); + } + if (this.selectedAllergy != null) { + data['selectedAllergy'] = this.selectedAllergy.toJson(); + } + data['remark'] = this.remark; + return data; + } +} diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 9fc21aa1..9dda8c00 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -1,40 +1,42 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class AddAllergiesWidget extends StatefulWidget { + final List myAllergiesList; + + AddAllergiesWidget({Key key, this.myAllergiesList}); + @override _AddAllergiesWidgetState createState() => _AddAllergiesWidgetState(); } class _AddAllergiesWidgetState extends State { + List myAllergiesList; - List allergiesList; - dynamic _referTo; - dynamic _selectedBranch; - dynamic _selectedClinic; - dynamic _selectedDoctor; TextEditingController remarkController = TextEditingController(); - @override Widget build(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; + final screenSize = MediaQuery.of(context).size; return Column( children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), + margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: "Add Allergies", fontSize: 13.5, @@ -49,7 +51,8 @@ class _AddAllergiesWidgetState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase.of(context) + return TranslationBase + .of(context) .emptyMessage; else return null; @@ -62,49 +65,37 @@ class _AddAllergiesWidgetState extends State { margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('White Egg'.toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black), - Texts('Severe'.toUpperCase(), - variant: "bodyText", - bold: true, - color: AppGlobal.appPrimaryColor), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('White Egg'.toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black), - Texts('Severe'.toUpperCase(), - variant: "bodyText", - bold: true, - color: AppGlobal.appPrimaryColor), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - ], + children: widget.myAllergiesList.map((selectedAllergy) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black), + Texts(selectedAllergy.selectedAllergySeverity.nameEn + .toUpperCase(), + variant: "bodyText", + bold: true, + color: AppGlobal.appPrimaryColor), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), SizedBox( + height: 20, + ), + ], + ); + }).toList() + ), ) ], @@ -112,186 +103,230 @@ class _AddAllergiesWidgetState extends State { } openAllergiesList(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - }; showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + return AddAllergies( + addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + },); + }); + } - SizedBox( - height: 16, - ), - AppText( - "Add Allergy", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: allergiesList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: allergiesList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _referTo = selectedValue; - _selectedBranch = null; - _selectedClinic = null; - _selectedDoctor = null; - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Allergy", - _referTo != null ? _referTo['name'] : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: allergiesList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: allergiesList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _referTo = selectedValue; - _selectedBranch = null; - _selectedClinic = null; - _selectedDoctor = null; - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; +} + +class AddAllergies extends StatefulWidget { + final Function addAllergiesFun; + + const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + + @override + _AddAllergiesState createState() => _AddAllergiesState(); +} + +class _AddAllergiesState extends State { + List allergiesList; + List allergySeverityList; + MasterKeyModel _selectedAllergySeverity; + MasterKeyModel _selectedAllergy; + TextEditingController remarkController = TextEditingController(); + + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.listOfAllergies == null) { + await model.getMasterLookup(MasterKeysService.Allergies); + } + if (model.allergySeverityList == null) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox( + height: 16, + ), + AppText( + "Add Allergy", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfAllergies != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfAllergies, + okText: TranslationBase + .of(context) + .ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + _selectedAllergy = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Allergy", + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergySeverityList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.allergySeverityList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedAllergySeverity = + selectedValue; + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Severity", + _selectedAllergySeverity != null + ? _selectedAllergySeverity.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + selectedAllergySeverity: _selectedAllergySeverity); + widget.addAllergiesFun(mySelectedAllergy); }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Severity", - _referTo != null ? _referTo['name'] : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ),SizedBox( - height: 10, - ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () { - }, - ), - ] + ), + ] + ), + ), ), )), - ); - }); + ), + ); } - } + + + diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart index ef08b28d..b83f5f16 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -1,10 +1,15 @@ - import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -111,247 +116,7 @@ class _AddHistoryWidgetState extends State isScrollControlled: true, context: context, builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 10, - ), - PriorityBar(onTap: (activePriority) { - changePageViewIndex(activePriority); - }), - SizedBox( - height: 20, - ), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: [ - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ), - ], - ), - )), - ), - SizedBox( - height: 10, - ), - AppButton( - title: "Add SELECTED HISTORIES".toUpperCase(), - onPressed: () {}, - ), - ], - ), - Container( - child: Center( - child: Texts("eee"), - ), - ), - Container( - child: Center( - child: Texts("cccc"), - ), - ), - ], - ), - ), - ], - ), - )), - ); + return AddHistoryDialog(); }); } } @@ -434,3 +199,305 @@ class _PriorityBarState extends State { ); } } + +class AddHistoryDialog extends StatefulWidget { + final Function changePageViewIndex; + final PageController controller; + + const AddHistoryDialog({Key key, this.changePageViewIndex, this.controller}) + : super(key: key); + + @override + _AddHistoryDialogState createState() => _AddHistoryDialogState(); +} + +class _AddHistoryDialogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + // if (model.listOfAllergies == null) { + await model.getMasterLookup(MasterKeysService.Allergies); + // } + if (model.allergySeverityList == null) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } + }, + builder: (_, model, w) => AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) { + widget.changePageViewIndex(activePriority); + }), + SizedBox( + height: 20, + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: widget.controller, + onPageChanged: (index) { + setState(() { + // currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts('History', + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () {}, + ), + ], + ), + Container( + child: Center( + child: Texts("eee"), + ), + ), + Container( + child: Center( + child: Texts("cccc"), + ), + ), + ], + ), + ), + ], + ), + )), + ), + ), + )); + } +} diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index eafa07c2..74d2aa43 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; @@ -28,15 +29,16 @@ class _SubjectivePageState extends State { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; - + List myAllergiesList = List(); TextEditingController messageController = TextEditingController(); @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), builder: (_, model, w) => AppScaffold( isShowAppBar: false, + baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -211,7 +213,7 @@ class _SubjectivePageState extends State { ), bodyWidget:Column( children: [ - AddAllergiesWidget(), + AddAllergiesWidget(myAllergiesList: myAllergiesList,), SizedBox( height: 30, ), diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart new file mode 100644 index 00000000..a276c4af --- /dev/null +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -0,0 +1,86 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class MasterKeyDailog extends StatefulWidget { + final List list; + final okText; + final Function(MasterKeyModel) okFunction; + MasterKeyModel selectedValue; + + MasterKeyDailog( + {@required this.list, + @required this.okText, + @required this.okFunction}); + + @override + _MasterKeyDailogState createState() => _MasterKeyDailogState(); +} + +class _MasterKeyDailogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.list[0]; + } + + @override + Widget build(BuildContext context) { + return showAlertDialog(context); + } + + showAlertDialog(BuildContext context) { + // set up the buttons + Widget cancelButton = FlatButton( + child: Text(TranslationBase.of(context).cancel), + onPressed: () { + Navigator.of(context).pop(); + }); + Widget continueButton = FlatButton( + child: Text(this.widget.okText), + onPressed: () { + this.widget.okFunction(widget.selectedValue); + Navigator.of(context).pop(); + }); +// set up the AlertDialog + AlertDialog alert = AlertDialog( + // title: Text(widget.title), + content: createDialogList(), + actions: [ + cancelButton, + continueButton, + ], + ); + return alert; + } + + Widget createDialogList() { + return Container( + height: MediaQuery.of(context).size.height * 0.5, + child: SingleChildScrollView( + child: Column( + children: [ + ...widget.list + .map((item) => RadioListTile( + title: Text(item.nameEn.toString()), + groupValue: widget.selectedValue.id.toString(), + value: item.id.toString(), + activeColor: Colors.blue.shade700, + selected: item.id.toString() == widget.selectedValue.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), + ); + } + + static closeAlertDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} From 405ad731c7e643e5ee791d7dcb72b5ed2b55316d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 22 Dec 2020 19:10:26 +0200 Subject: [PATCH 025/421] history list ready --- lib/core/service/SOAP_service.dart | 53 ++- lib/core/viewModel/SOAP_view_model.dart | 17 +- .../SOAP/subjective/add_allergies_widget.dart | 4 +- .../SOAP/subjective/add_history_widget.dart | 445 +++++++++--------- 4 files changed, 275 insertions(+), 244 deletions(-) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index de729be3..1f28e714 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -4,12 +4,30 @@ import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -class SOAPService extends BaseService { +class SOAPService extends BaseService { List get listOfAllergies => _listOfAllergies; - List get allergySeverityList => _allergySeverityList; List _listOfAllergies = []; + + List get allergySeverityList => _allergySeverityList; List _allergySeverityList = []; + List get historyFamilyList => _historyFamilyList; + List _historyFamilyList = []; + + List get historyMedicalList => _historyMedicalList; + List _historyMedicalList = []; + + List get historySportList => _historySportList; + List _historySportList = []; + + List get historySocialList => _historySocialList; + List _historySocialList = []; + + List get historySurgicalList => _historySurgicalList; + List _historySurgicalList = []; + + + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -51,19 +69,38 @@ class SOAPService extends BaseService { }); break; case MasterKeysService.HistoryFamily: - return 36; + _historyFamilyList.clear(); + entryList.forEach((v) { + _historyFamilyList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.HistoryMedical: - return 37; + _historyMedicalList.clear(); + entryList.forEach((v) { + _historyMedicalList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.HistorySocial: - return 38; + historySocialList.clear(); + entryList.forEach((v) { + historySocialList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.HistorySports: - return 39; - break; + _historySportList.clear(); + entryList.forEach((v) { + _historySportList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.HistorySurgical: - return 66; + _historySurgicalList.clear(); + entryList.forEach((v) { + _historySurgicalList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.PhysicalExamination: return 59; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index b48bfcba..1fd239b9 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -12,7 +12,22 @@ class SOAPViewModel extends BaseViewModel { SOAPService _SOAPService = locator(); List get listOfAllergies => _SOAPService.listOfAllergies; - List get allergySeverityList => _SOAPService.allergySeverityList; + + List get allergySeverityList => + _SOAPService.allergySeverityList; + + + List get historyFamilyList => _SOAPService.historyFamilyList; + + List get historyMedicalList => _SOAPService.historyMedicalList; + + List get historySportList => _SOAPService.historySportList; + + List get historySocialList => _SOAPService.historySocialList; + List get historySurgicalList => _SOAPService.historySurgicalList; + List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList]; + + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 9dda8c00..d3260776 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -168,10 +168,10 @@ class _AddAllergiesState extends State { heightFactor: 0.7, child: BaseView( onModelReady: (model) async { - if (model.listOfAllergies == null) { + if (model.listOfAllergies.length == 0) { await model.getMasterLookup(MasterKeysService.Allergies); } - if (model.allergySeverityList == null) { + if (model.allergySeverityList.length == 0) { await model.getMasterLookup(MasterKeysService.AllergySeverity); } }, diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart index b83f5f16..085fa68d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -116,7 +116,7 @@ class _AddHistoryWidgetState extends State isScrollControlled: true, context: context, builder: (context) { - return AddHistoryDialog(); + return AddHistoryDialog(changePageViewIndex:changePageViewIndex, controller: _controller,); }); } } @@ -218,11 +218,8 @@ class _AddHistoryDialogState extends State { heightFactor: 0.7, child: BaseView( onModelReady: (model) async { - // if (model.listOfAllergies == null) { - await model.getMasterLookup(MasterKeysService.Allergies); - // } - if (model.allergySeverityList == null) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); + if (model.historyFamilyList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistoryFamily); } }, builder: (_, model, w) => AppScaffold( @@ -237,8 +234,19 @@ class _AddHistoryDialogState extends State { SizedBox( height: 10, ), - PriorityBar(onTap: (activePriority) { + PriorityBar(onTap: (activePriority) async { widget.changePageViewIndex(activePriority); + if(activePriority ==1) { + if (model.historySurgicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistorySurgical); + await model.getMasterLookup(MasterKeysService.HistorySports); + } + } + if(activePriority ==2) { + if (model.historyMedicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistoryMedical); + } + } }), SizedBox( height: 20, @@ -254,240 +262,211 @@ class _AddHistoryDialogState extends State { }, scrollDirection: Axis.horizontal, children: [ - Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: [ - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: - Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts('History', - variant: "bodyText", - bold: true, - color: Colors.black), + Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.historyFamilyList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: + (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ), - ], - ), - )), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES".toUpperCase(), - onPressed: () {}, + SizedBox( + height: 10, ), - ], + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () {}, + ), + ], + ), ), Container( - child: Center( - child: Texts("eee"), + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.mergeHistorySurgicalWithHistorySportList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: + (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () {}, + ), + ], ), ), Container( - child: Center( - child: Texts("cccc"), + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.historyMedicalList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: true, + activeColor: + Colors.red[800], + onChanged: + (bool newValue) { + setState(() {}); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () {}, + ), + ], ), ), ], From 989c06ae33080e1cdbb398411ea8e778e43dcae9 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 23 Dec 2020 10:29:58 +0300 Subject: [PATCH 026/421] prescription changes --- lib/config/localized_values.dart | 6 ++- lib/util/translations_delegate_base.dart | 2 + lib/widgets/patients/profile/medication.dart | 13 +++++ .../prescription_in_patinets_widget.dart | 47 +++++++++++++++++-- .../prescription_out_patinets_widget.dart | 5 +- 5 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 lib/widgets/patients/profile/medication.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3ba857e0..c4d2f5a5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -305,5 +305,9 @@ const Map> localizedValues = { 'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية' }, - 'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'} + 'patient-target': {'en': 'Target Patient', 'ar': 'الهدف المريض'}, + 'no-priscription-listed': { + 'en': 'No Prescription Listed', + 'ar': 'لا وصفة طبية مدرجة' + } }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1dde64be..497506b3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -338,6 +338,8 @@ class TranslationBase { localizedValues['extend-sickleave'][locale.languageCode]; String get targetPatient => localizedValues['patient-target'][locale.languageCode]; + String get noPrescription => + localizedValues['no-priscription-listed'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/medication.dart b/lib/widgets/patients/profile/medication.dart new file mode 100644 index 00000000..62494d8e --- /dev/null +++ b/lib/widgets/patients/profile/medication.dart @@ -0,0 +1,13 @@ +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class MedicationDetails extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppText('MEDICATION'), + ], + ); + } +} diff --git a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart index a5b9d014..1c9b4462 100644 --- a/lib/widgets/patients/profile/prescription_in_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_in_patinets_widget.dart @@ -1,11 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'large_avatar.dart'; @@ -19,7 +21,41 @@ class PrescriptionInPatientWidget extends StatelessWidget { Widget build(BuildContext context) { return Container( child: prescriptionReportForInPatientList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Prescriptions') + ? Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: + Border.all(color: HexColor('#B8382C'), width: 4), + borderRadius: BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + // openAddPrescription(context); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).noPrescription, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) + ], + ), + )) : Container( margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05, 0, SizeConfig.realScreenWidth * 0.05, 0), @@ -28,9 +64,12 @@ class PrescriptionInPatientWidget extends StatelessWidget { itemBuilder: (BuildContext context, int index) { return InkWell( onTap: () { - Navigator.of(context).pushNamed(IN_PATIENT_PRESCRIPTIONS_DETAILS, arguments: { - 'prescription': prescriptionReportForInPatientList[index] - }); + Navigator.of(context).pushNamed( + IN_PATIENT_PRESCRIPTIONS_DETAILS, + arguments: { + 'prescription': + prescriptionReportForInPatientList[index] + }); }, child: CardWithBgWidgetNew( widget: Column( diff --git a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart index bfb7b8c7..b4ceffb4 100644 --- a/lib/widgets/patients/profile/prescription_out_patinets_widget.dart +++ b/lib/widgets/patients/profile/prescription_out_patinets_widget.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/screens/patients/out_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/medication.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:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; @@ -42,7 +43,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { ), Padding( child: AppText( - TranslationBase.of(context).noSickLeaveApplied, + TranslationBase.of(context).noPrescription, fontWeight: FontWeight.bold, ), padding: EdgeInsets.all(10), @@ -132,7 +133,7 @@ class PrescriptionOutPatientWidget extends StatelessWidget { showModalBottomSheet( context: context, builder: (context) { - return new Container(); + return MedicationDetails(); }); } } From 52554d1aef9ead047f2694c0d228339d75c567ac Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 23 Dec 2020 15:16:54 +0200 Subject: [PATCH 027/421] add and remove allergy --- .../SOAP/subjective/add_allergies_widget.dart | 55 ++--- .../SOAP/subjective/add_history_widget.dart | 194 +++++++++++++----- .../SOAP/subjective/subjective_page.dart | 9 +- 3 files changed, 181 insertions(+), 77 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index d3260776..eaa3889d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -25,7 +25,6 @@ class AddAllergiesWidget extends StatefulWidget { } class _AddAllergiesWidgetState extends State { - List myAllergiesList; TextEditingController remarkController = TextEditingController(); @@ -73,35 +72,45 @@ class _AddAllergiesWidgetState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(selectedAllergy.selectedAllergy.nameEn + Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), + variant: "bodyText", bold: true, color: Colors.black), + Texts( + selectedAllergy.selectedAllergySeverity.nameEn .toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black), - Texts(selectedAllergy.selectedAllergySeverity.nameEn - .toUpperCase(), - variant: "bodyText", - bold: true, - color: AppGlobal.appPrimaryColor), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), SizedBox( - height: 20, - ), + variant: "bodyText", + bold: true, + color: AppGlobal.appPrimaryColor), + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeAllergy(selectedAllergy), + ) ], - ); - }).toList() - - ), + ), + SizedBox( + height: 10, + ), + ], + ); + }).toList()), ) ], ); } + removeAllergy(MySelectedAllergy mySelectedAllergy) { + Iterable allergy = + widget.myAllergiesList.where((element) => mySelectedAllergy == element); + + if (allergy.length > 0) + setState(() { + widget.myAllergiesList.remove(allergy.first); + }); + } + openAllergiesList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart index 085fa68d..1907453d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -16,6 +17,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; class AddHistoryWidget extends StatefulWidget { + final List myHistoryList; + + const AddHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + @override _AddHistoryWidgetState createState() => _AddHistoryWidgetState(); } @@ -69,54 +74,63 @@ class _AddHistoryWidgetState extends State margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Abdomen Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + children: widget.myHistoryList.map((myHistory) { + return Column( children: [ - Texts('Back Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(myHistory.nameEn, + variant: "bodyText", bold: true, color: Colors.black), + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeHistory(myHistory), + ) + ], + ), + SizedBox( + height: 20, + ), ], - ), - ], + ); + }).toList(), ), ) ], ); } + removeHistory(MasterKeyModel masterKey) { + Iterable history = widget.myHistoryList.where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + + if (history.length > 0) + setState(() { + widget.myHistoryList.remove(history.first); + }); + } + openHistoryList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return AddHistoryDialog(changePageViewIndex:changePageViewIndex, controller: _controller,); + return AddHistoryDialog( + changePageViewIndex: changePageViewIndex, + controller: _controller, + myHistoryList: widget.myHistoryList, + addSelectedHistories: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeHistory: (masterKey) => removeHistory(masterKey), + ); }); } } @@ -203,8 +217,12 @@ class _PriorityBarState extends State { class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; final PageController controller; + final List myHistoryList; + final Function addSelectedHistories; + final Function (MasterKeyModel) removeHistory; - const AddHistoryDialog({Key key, this.changePageViewIndex, this.controller}) + const AddHistoryDialog( + {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) : super(key: key); @override @@ -286,12 +304,28 @@ class _AddHistoryDialogState extends State { Row( children: [ Checkbox( - value: true, + value: isServiceSelected( + historyInfo), activeColor: - Colors.red[800], + Colors.red[800], onChanged: (bool newValue) { - setState(() {}); + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); }), Expanded( child: Padding( @@ -325,8 +359,11 @@ class _AddHistoryDialogState extends State { ), if (model.state == ViewState.Idle) AppButton( - title: "Add SELECTED HISTORIES".toUpperCase(), - onPressed: () {}, + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, ), ], ), @@ -355,12 +392,29 @@ class _AddHistoryDialogState extends State { Row( children: [ Checkbox( - value: true, + value: isServiceSelected( + historyInfo), activeColor: Colors.red[800], onChanged: - (bool newValue) { - setState(() {}); + ( + bool newValue) { + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); }), Expanded( child: Padding( @@ -394,8 +448,11 @@ class _AddHistoryDialogState extends State { ), if (model.state == ViewState.Idle) AppButton( - title: "Add SELECTED HISTORIES".toUpperCase(), - onPressed: () {}, + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, ), ], ), @@ -424,12 +481,29 @@ class _AddHistoryDialogState extends State { Row( children: [ Checkbox( - value: true, + value: isServiceSelected( + historyInfo), activeColor: Colors.red[800], onChanged: - (bool newValue) { - setState(() {}); + ( + bool newValue) { + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); }), Expanded( child: Padding( @@ -463,8 +537,13 @@ class _AddHistoryDialogState extends State { ), if (model.state == ViewState.Idle) AppButton( - title: "Add SELECTED HISTORIES".toUpperCase(), - onPressed: () {}, + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + setState(() { + widget.addSelectedHistories(); + }); + }, ), ], ), @@ -474,9 +553,22 @@ class _AddHistoryDialogState extends State { ), ], ), - )), + )), ), ), )); } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable history = + widget + .myHistoryList + .where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + if (history.length > 0) { + return true; + } + return false; + } + } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 74d2aa43..bfea6d35 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -30,6 +31,7 @@ class _SubjectivePageState extends State { bool isHistoryExpand = false; bool isAllergiesExpand = false; List myAllergiesList = List(); + List myHistoryList = List(); TextEditingController messageController = TextEditingController(); @override @@ -143,7 +145,7 @@ class _SubjectivePageState extends State { children: [ Row( children: [ - Texts('History', + Texts('History'.toUpperCase(), variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : false, color: Colors.black), @@ -167,7 +169,7 @@ class _SubjectivePageState extends State { ), bodyWidget: Column( children: [ - AddHistoryWidget() + AddHistoryWidget(myHistoryList: myHistoryList) ], ), isExpand: isHistoryExpand, @@ -189,7 +191,7 @@ class _SubjectivePageState extends State { children: [ Row( children: [ - Texts('Allergies', + Texts('Allergies'.toUpperCase(), variant: isAllergiesExpand ? "bodyText" : '', bold: isAllergiesExpand ? true : false, color: Colors.black), @@ -238,6 +240,7 @@ class _SubjectivePageState extends State { .of(context) .next, onPressed: () { + print( myHistoryList.toString()); widget.changePageViewIndex(1); }, ), From a3dff8c9f8ceb0b2fda9f32e6e56abd8c437f0b5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 23 Dec 2020 17:35:30 +0200 Subject: [PATCH 028/421] Post Allergies service --- lib/config/config.dart | 1 + lib/core/service/SOAP_service.dart | 12 +++ lib/core/viewModel/SOAP_view_model.dart | 13 +++ .../SOAP/post_allergy_request_model.dart | 93 +++++++++++++++++++ .../patients/profile/SOAP/add_SOAP_index.dart | 9 +- .../SOAP/subjective/add_allergies_widget.dart | 6 +- .../SOAP/subjective/subjective_page.dart | 72 +++++++++++--- 7 files changed, 186 insertions(+), 20 deletions(-) create mode 100644 lib/models/SOAP/post_allergy_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 817925f5..783cf811 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -85,6 +85,7 @@ const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; +const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; var selectedPatientType = 1; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 1f28e714..88d44e5a 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; class SOAPService extends BaseService { List get listOfAllergies => _listOfAllergies; @@ -59,6 +60,17 @@ class SOAPService extends BaseService { }, body: body); } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { + + await baseAppClient.post(POST_ALLERGY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postAllergyRequestModel.toJson()); + } + setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { switch (masterKeys) { case MasterKeysService.Allergies: diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 1fd239b9..608b2e3d 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -48,4 +49,16 @@ class SOAPViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postAllergy(postAllergyRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + } diff --git a/lib/models/SOAP/post_allergy_request_model.dart b/lib/models/SOAP/post_allergy_request_model.dart new file mode 100644 index 00000000..6783d885 --- /dev/null +++ b/lib/models/SOAP/post_allergy_request_model.dart @@ -0,0 +1,93 @@ +class PostAllergyRequestModel { + List + listHisProgNotePatientAllergyDiseaseVM; + + PostAllergyRequestModel({this.listHisProgNotePatientAllergyDiseaseVM}); + + PostAllergyRequestModel.fromJson(Map json) { + if (json['listHisProgNotePatientAllergyDiseaseVM'] != null) { + listHisProgNotePatientAllergyDiseaseVM = + new List(); + json['listHisProgNotePatientAllergyDiseaseVM'].forEach((v) { + listHisProgNotePatientAllergyDiseaseVM + .add(new ListHisProgNotePatientAllergyDiseaseVM.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listHisProgNotePatientAllergyDiseaseVM != null) { + data['listHisProgNotePatientAllergyDiseaseVM'] = this + .listHisProgNotePatientAllergyDiseaseVM + .map((v) => v.toJson()) + .toList(); + } + return data; + } +} + +class ListHisProgNotePatientAllergyDiseaseVM { + int patientMRN; + int allergyDiseaseType; + int allergyDiseaseId; + int episodeId; + int appointmentNo; + int severity; + bool isChecked; + bool isUpdatedByNurse; + String remarks; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + + ListHisProgNotePatientAllergyDiseaseVM( + {this.patientMRN, + this.allergyDiseaseType, + this.allergyDiseaseId, + this.episodeId, + this.appointmentNo, + this.severity, + this.isChecked, + this.isUpdatedByNurse, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn}); + + ListHisProgNotePatientAllergyDiseaseVM.fromJson(Map json) { + patientMRN = json['patientMRN']; + allergyDiseaseType = json['allergyDiseaseType']; + allergyDiseaseId = json['allergyDiseaseId']; + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + severity = json['severity']; + isChecked = json['isChecked']; + isUpdatedByNurse = json['isUpdatedByNurse']; + remarks = json['remarks']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + } + + Map toJson() { + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['allergyDiseaseType'] = this.allergyDiseaseType; + data['allergyDiseaseId'] = this.allergyDiseaseId; + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['severity'] = this.severity; + data['isChecked'] = this.isChecked; + data['isUpdatedByNurse'] = this.isUpdatedByNurse; + data['remarks'] = this.remarks; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + return data; + } +} diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 2018a582..9d75b22c 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.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/translations_delegate_base.dart'; @@ -26,7 +28,8 @@ class _AddSOAPIndexState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 0; - + List myAllergiesList= List(); + List myHistoryList = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -60,7 +63,7 @@ class _AddSOAPIndexState extends State padding: const EdgeInsets.all(8.0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, - children: [ + children: [ AvatarWidget( Icon( patient.genderDescription == "Male" @@ -149,7 +152,7 @@ class _AddSOAPIndexState extends State }, scrollDirection: Axis.horizontal, children: [ - SubjectivePage(changePageViewIndex: changePageViewIndex,), + SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), ObjectivePage(changePageViewIndex: changePageViewIndex,), AssessmentPage(changePageViewIndex: changePageViewIndex,), PlanPage(changePageViewIndex: changePageViewIndex,) diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index eaa3889d..7f764a0d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -119,8 +119,10 @@ class _AddAllergiesWidgetState extends State { builder: (context) { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); + setState(() { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + }); },); }); } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index bfea6d35..86a17e89 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -1,8 +1,8 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; @@ -19,8 +19,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class SubjectivePage extends StatefulWidget { final Function changePageViewIndex; + final List myAllergiesList; + final List myHistoryList ; - SubjectivePage({Key key, this.changePageViewIndex}); + SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList}); @override _SubjectivePageState createState() => _SubjectivePageState(); @@ -30,9 +32,9 @@ class _SubjectivePageState extends State { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; - List myAllergiesList = List(); List myHistoryList = List(); - TextEditingController messageController = TextEditingController(); + TextEditingController illnessController = TextEditingController(); + TextEditingController complaintsController = TextEditingController(); @override Widget build(BuildContext context) { @@ -92,10 +94,12 @@ class _SubjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 13, - controller: messageController, + controller: complaintsController, validator: (value) { if (value == null) - return TranslationBase.of(context).emptyMessage; + return TranslationBase + .of(context) + .emptyMessage; else return null; }), @@ -112,10 +116,12 @@ class _SubjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 13, - controller: messageController, + controller: illnessController, validator: (value) { if (value == null) - return TranslationBase.of(context).emptyMessage; + return TranslationBase + .of(context) + .emptyMessage; else return null; }), @@ -215,7 +221,7 @@ class _SubjectivePageState extends State { ), bodyWidget:Column( children: [ - AddAllergiesWidget(myAllergiesList: myAllergiesList,), + AddAllergiesWidget(myAllergiesList: widget.myAllergiesList,), SizedBox( height: 30, ), @@ -239,16 +245,52 @@ class _SubjectivePageState extends State { title: TranslationBase .of(context) .next, - onPressed: () { - print( myHistoryList.toString()); - widget.changePageViewIndex(1); + + onPressed: () async { + addSubjectiveInfo(model: model, + myAllergiesList: widget.myAllergiesList, + myHistoryList: myHistoryList); + }, ), - ], - ), - ), + ], ), + ), + ), ),),); } + addSubjectiveInfo( + {SOAPViewModel model, List myAllergiesList, List< + MasterKeyModel> myHistoryList }) async { + PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + widget.myAllergiesList.forEach((allergy) { + if(postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==null) + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: 2500477, + episodeId: 200011502, + appointmentNo: 2016053271, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: 1485, + createdOn: "2020-08-14T20:37:22.780Z", + editedBy: 1485, + editedOn: "2020-08-14T20:37:22.780Z", + isChecked: false, + isUpdatedByNurse: false + )); + }); + await model.postAllergy(postAllergyRequestModel); + + + widget.changePageViewIndex(1); + + print(postAllergyRequestModel); + + } + } From 7cefbb4dbd249ff4d039f77e39d7ccfe12f1cfdd Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 23 Dec 2020 18:36:29 +0200 Subject: [PATCH 029/421] add referral pages --- lib/client/base_app_client.dart | 11 +- lib/config/config.dart | 6 + lib/config/localized_values.dart | 16 + lib/core/service/base/base_service.dart | 55 ++- .../patient-doctor-referral-service.dart | 145 ++++++ lib/core/service/patient_service.dart | 3 +- .../service/referral_patient_service.dart | 1 + .../service/referred_patient_service.dart | 3 +- lib/core/viewModel/base_view_model.dart | 22 + .../patient-doctor-referral-viewModel.dart | 117 +++++ lib/core/viewModel/patient_view_model.dart | 18 +- lib/locator.dart | 4 + lib/main.dart | 2 +- lib/models/patient/PatientArrivalEntity.dart | 84 ++++ .../patient/my_referral/PendingReferral.dart | 119 +++++ .../my_referred_patient_model.dart | 2 + lib/routes.dart | 6 + lib/screens/dashboard_screen.dart | 399 ++++++---------- lib/screens/patients/patients_screen.dart | 1 + .../referral/my-referral-detail-screen.dart | 147 ++++++ .../referral/my-referral-patient-screen.dart | 98 ++++ .../referral/refer-patient-screen.dart | 445 ++++++++++++++++++ .../referral/referred-patient-screen.dart | 74 +++ lib/util/dr_app_toast_msg.dart | 2 +- lib/util/translations_delegate_base.dart | 16 + .../patient-referral-item-widget.dart | 143 ++++++ .../profile/PatientProfileButton.dart | 86 ++++ .../profile/profile-welcome-widget.dart | 86 ++++ .../profile/profile_medical_info_widget.dart | 91 +--- lib/widgets/shared/borderedButton.dart | 83 ++++ 30 files changed, 1914 insertions(+), 371 deletions(-) create mode 100644 lib/core/service/patient-doctor-referral-service.dart create mode 100644 lib/core/viewModel/patient-doctor-referral-viewModel.dart create mode 100644 lib/models/patient/PatientArrivalEntity.dart create mode 100644 lib/models/patient/my_referral/PendingReferral.dart create mode 100644 lib/screens/patients/profile/referral/my-referral-detail-screen.dart create mode 100644 lib/screens/patients/profile/referral/my-referral-patient-screen.dart create mode 100644 lib/screens/patients/profile/referral/refer-patient-screen.dart create mode 100644 lib/screens/patients/profile/referral/referred-patient-screen.dart create mode 100644 lib/widgets/patients/patient-referral-item-widget.dart create mode 100644 lib/widgets/patients/profile/PatientProfileButton.dart create mode 100644 lib/widgets/patients/profile/profile-welcome-widget.dart create mode 100644 lib/widgets/shared/borderedButton.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..ca1b196a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -45,7 +45,9 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; - body['ProjectID'] = doctorProfile?.projectID; + if(body['ProjectID'] == null){ + body['ProjectID'] = doctorProfile?.projectID; + } if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } @@ -80,9 +82,10 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - await helpers.logout(); - - helpers.showErrorToast('Your session expired Please login agian'); + // TODO commented this and make si success just for test + // await helpers.logout(); + // helpers.showErrorToast('Your session expired Please login again'); + onSuccess(parsed, statusCode); } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..7e7e279e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -57,6 +57,9 @@ const ADD_REFERRED_DOCTOR_REMARKS = const GET_MY_REFERRED_PATIENT = 'Services/DoctorApplication.svc/REST/GtMyReferredPatient'; +const GET_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/PendingReferrals'; + const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; @@ -78,6 +81,9 @@ const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; +const GET_PATIENT_ARRIVAL_LIST = + 'Services/DoctorApplication.svc/REST/PatientArrivalList'; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2b84f389..e29c3b79 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -49,6 +49,7 @@ const Map> localizedValues = { 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, + 'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, @@ -277,4 +278,19 @@ const Map> localizedValues = { 'bed': {'en': 'BED:', 'ar': 'السرير'}, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, + 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, + 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, + 'branch': {'en': "Branch", 'ar': 'الفرع'}, + 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, + 'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'}, + 'refer': {'en': "REFER", 'ar': 'إحالة'}, + 'approved': {'en': "Approved", 'ar': 'موافق عليه'}, + 'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, + 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, + 'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'}, + 'dr': {'en': "DR.", 'ar': 'د.'}, + 'previewHealth': {'en': "Preview Health", 'ar': 'معاينة الصحة'}, + 'summaryReport': {'en': "Summary Report", 'ar': 'تقرير موجز'}, + 'accept': {'en': "ACCEPT", 'ar': 'قبول'}, + 'reject': {'en': "REJECT", 'ar': 'رفض'}, }; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index c4cb240d..1867cf99 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,8 +1,61 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; class BaseService { String error; bool hasError = false; BaseAppClient baseAppClient = BaseAppClient(); - //TODO add the user login model when we need it + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + DoctorProfileModel doctorProfile; + + List patientArrivalList = []; + +//TODO add the user login model when we need it + Future getDoctorProfile() async { + if (doctorProfile == null) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + return null; + } else { + return doctorProfile; + } + } + + Future getPatientArrivalList(String date) async{ + hasError = false; + Map body = Map(); + body['VidaAuthTokenID'] = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiYjVjZTZkZGEtNDA0OC00N2U4LWFhMmMtYmY5NDJiNjg0MGI0IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODU1MDQiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODU1MDE2OSwiZXhwIjoxNjA5NDE0MTY5LCJpYXQiOjE2MDg1NTAxNjl9.mBoylGXXcfoeZcf61R2m7OfjRHnt8MmzLMG74VcotQ8"; + body['From'] = date; + body['To'] = date; + body['PageIndex'] = 0; + body['PageSize'] = 0; + + await baseAppClient.post( + GET_PATIENT_ARRIVAL_LIST, + onSuccess: (dynamic response, int statusCode) { + patientArrivalList.clear(); + + response['patientArrivalList']['entityList'].forEach((v) { + PatientArrivalEntity item = PatientArrivalEntity.fromJson(v); + patientArrivalList.add(item); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + this.error = error; + }, + body: body, + ); + } + } diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart new file mode 100644 index 00000000..66db83c6 --- /dev/null +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -0,0 +1,145 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; +import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; +import 'package:doctor_app_flutter/models/patient/request_my_referral_patient_model.dart'; + +class PatientReferralService extends BaseService { + List projectsList = []; + List clinicsList = []; + List doctorsList = []; + List listMyReferredPatientModel = []; + List pendingReferralList = []; + + Future getProjectsList() async { + hasError = false; + const url = GET_PROJECTS; + var info = { + "LanguageID": 1, + "stamp": "2020-02-26T13:51:44.111Z", + "IPAdress": "11.11.11.11", + "VersionID": 1.2, + "Channel": 9, + "TokenID": "", + "SessionID": "i1UJwCTSqt", + "IsLoginForDoctorApp": true + }; + dynamic localRes; + + await baseAppClient.post(url, onSuccess: (response, statusCode) async { + if (response['MessageStatus'] == 1) { + projectsList = response['ListProject']; + } else { + // handel error + projectsList = ListProject; + } + }, onFailure: (String error, int statusCode) { + projectsList = ListProject; + }, body: info); + } + + Future getClinicsList(int projectId) async { + hasError = false; + ClinicByProjectIdRequest _clinicByProjectIdRequest = + ClinicByProjectIdRequest(); + _clinicByProjectIdRequest.projectID = projectId; + + await baseAppClient.post( + PATIENT_GET_CLINIC_BY_PROJECT_URL, + onSuccess: (dynamic response, int statusCode) { + clinicsList = []; + clinicsList = response['List_Clinic_All']; + print(response['List_Clinic_All']); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _clinicByProjectIdRequest.toJson(), + ); + } + + Future getDoctorsList(String clinicId) async { + hasError = false; + DoctorsByClinicIdRequest _doctorsByClinicIdRequest = + DoctorsByClinicIdRequest(); + + _doctorsByClinicIdRequest.clinicID = clinicId; + await baseAppClient.post( + PATIENT_GET_DOCTOR_BY_CLINIC_URL, + onSuccess: (dynamic response, int statusCode) { + doctorsList = []; + doctorsList = response['List_Doctors_All']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _doctorsByClinicIdRequest.toJson(), + ); + } + + Future getMyReferredPatient() async { + hasError = false; + RequestMyReferralPatientModel _requestMyReferralPatient = + RequestMyReferralPatientModel(); + DoctorProfileModel doctorProfile = await getDoctorProfile(); + + await baseAppClient.post( + GET_MY_REFERRED_PATIENT, + onSuccess: (dynamic response, int statusCode) { + listMyReferredPatientModel.clear(); + + response['List_MyReferredPatient'].forEach((v) { + MyReferredPatientModel item = MyReferredPatientModel.fromJson(v); + if (doctorProfile != null) { + item.isReferralDoctorSameBranch = + doctorProfile.projectID == item.projectId; + } else { + item.isReferralDoctorSameBranch = false; + } + listMyReferredPatientModel.add(item); + }); + // print(response['List_MyReferredPatient']); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: _requestMyReferralPatient.toJson(), + ); + } + + Future getPendingReferralList() async { + hasError = false; + DoctorProfileModel doctorProfile = await getDoctorProfile(); + Map body = Map(); + body['ClinicID'] = 0; + body['DoctorID'] = doctorProfile.doctorID; + body['VidaAuthTokenID'] = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiYjVjZTZkZGEtNDA0OC00N2U4LWFhMmMtYmY5NDJiNjg0MGI0IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODU1MDQiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODU1MDE2OSwiZXhwIjoxNjA5NDE0MTY5LCJpYXQiOjE2MDg1NTAxNjl9.mBoylGXXcfoeZcf61R2m7OfjRHnt8MmzLMG74VcotQ8"; + + await baseAppClient.post( + GET_PENDING_REFERRAL_PATIENT, + onSuccess: (dynamic response, int statusCode) { + pendingReferralList.clear(); + + response['PendingReferralList'].forEach((v) { + PendingReferral item = PendingReferral.fromJson(v); + item.isReferralDoctorSameBranch = + item.targetProjectId == item.sourceProjectId; + pendingReferralList.add(item); + }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } +} diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index b16753f5..9aa52923 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; +import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart'; import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart'; import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart'; @@ -82,8 +83,6 @@ class PatientService extends BaseService { ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; - RequestSchedule _requestSchedule = RequestSchedule(); - Future getPatientList(PatientModel patient, patientType) async { hasError = false; int val = int.parse(patientType); diff --git a/lib/core/service/referral_patient_service.dart b/lib/core/service/referral_patient_service.dart index 088e40ca..e3ca6fae 100644 --- a/lib/core/service/referral_patient_service.dart +++ b/lib/core/service/referral_patient_service.dart @@ -24,6 +24,7 @@ class ReferralPatientService extends BaseService { response['List_MyReferralPatient'].forEach((v) { listMyReferralPatientModel.add(MyReferralPatientModel.fromJson(v)); }); + print(response['List_MyReferralPatient']); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/service/referred_patient_service.dart b/lib/core/service/referred_patient_service.dart index 0fb3de64..7285d904 100644 --- a/lib/core/service/referred_patient_service.dart +++ b/lib/core/service/referred_patient_service.dart @@ -11,8 +11,6 @@ class ReferredPatientService extends BaseService { List get listMyReferredPatientModel => _listMyReferredPatientModel; - Helpers helpers = Helpers(); - RequestMyReferralPatientModel _requestMyReferralPatient = RequestMyReferralPatientModel(); VerifyReferralDoctorRemarks _verifyreferraldoctorremarks = @@ -26,6 +24,7 @@ class ReferredPatientService extends BaseService { response['List_MyReferredPatient'].forEach((v) { listMyReferredPatientModel.add(MyReferredPatientModel.fromJson(v)); }); + // print(response['List_MyReferredPatient']); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/base_view_model.dart b/lib/core/viewModel/base_view_model.dart index 29acdd42..d8591660 100644 --- a/lib/core/viewModel/base_view_model.dart +++ b/lib/core/viewModel/base_view_model.dart @@ -1,17 +1,39 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/material.dart'; class BaseViewModel extends ChangeNotifier { + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + DoctorProfileModel doctorProfile; + ViewState _state = ViewState.Idle; bool isInternetConnection = true; ViewState get state => _state; String error = ""; + //TODO add the user login model when we need it void setState(ViewState viewState) { _state = viewState; notifyListeners(); } + + Future getDoctorProfile() async { + if (doctorProfile == null) { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + if (profile != null) { + doctorProfile = DoctorProfileModel.fromJson(profile); + if (doctorProfile != null) { + return doctorProfile; + } + } + return null; + } else { + return doctorProfile; + } + } } diff --git a/lib/core/viewModel/patient-doctor-referral-viewModel.dart b/lib/core/viewModel/patient-doctor-referral-viewModel.dart new file mode 100644 index 00000000..bd7bc549 --- /dev/null +++ b/lib/core/viewModel/patient-doctor-referral-viewModel.dart @@ -0,0 +1,117 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient-doctor-referral-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; + +import '../../locator.dart'; + +class PatientReferralViewModel extends BaseViewModel { + PatientReferralService _referralPatientService = + locator(); + + List get branchesList => _referralPatientService.projectsList; + + List get clinicsList => _referralPatientService.clinicsList; + + List get doctorsList => _referralPatientService.doctorsList; + + List get listMyReferredPatientModel => + _referralPatientService.listMyReferredPatientModel; + + List get pendingReferral => + _referralPatientService.pendingReferralList; + + List get patientArrivalList => _referralPatientService.patientArrivalList; + + Future getBranches() async { + setState(ViewState.Busy); + await _referralPatientService.getProjectsList(); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getClinics(int projectId) async { + setState(ViewState.Busy); + await _referralPatientService.getClinicsList(projectId); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getClinicDoctors(String clinicId) async { + setState(ViewState.Busy); + await _referralPatientService.getDoctorsList(clinicId); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getDoctorBranch() async { + DoctorProfileModel doctorProfile = await getDoctorProfile(); + if (doctorProfile != null) { + dynamic _selectedBranch = { + "ID": doctorProfile.projectID, + "Desciption": doctorProfile.projectName + }; + return _selectedBranch; + } + return null; + } + + Future getMyReferredPatient() async { + setState(ViewState.Busy); + await _referralPatientService.getMyReferredPatient(); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + MyReferredPatientModel getReferredPatientItem(int index){ + return listMyReferredPatientModel[index]; + } + + Future getPendingReferralPatients() async { + setState(ViewState.Busy); + await _referralPatientService.getPendingReferralList(); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getPatientArrivalList(String date) async { + setState(ViewState.Busy); + await _referralPatientService.getPatientArrivalList(date); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + List getAppointmentsByPatientName(String patientName){ + List appointments = []; + patientArrivalList.forEach((element) { + if(element.patientName == patientName){ + appointments.add(element.toJson()); + } + }); + return appointments; + } + +} diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 6fdbde32..e03e0853 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -43,12 +43,15 @@ class PatientViewModel extends BaseViewModel { get patientProgressNoteList => _patientService.patientProgressNoteList; List get clinicsList => _patientService.clinicsList; + List get doctorsList => _patientService.doctorsList; - List get referralFrequencyList => _patientService.referalFrequancyList; + + List get referralFrequencyList => + _patientService.referalFrequancyList; Future getPatientList(PatientModel patient, patientType, {bool isBusyLocal = false}) async { - if(isBusyLocal) { + if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); @@ -56,11 +59,12 @@ class PatientViewModel extends BaseViewModel { return _patientService.getPatientList(patient, patientType); if (_patientService.hasError) { error = _patientService.error; - if(isBusyLocal) { + if (isBusyLocal) { setState(ViewState.ErrorLocal); } else { setState(ViewState.Error); - } } else + } + } else setState(ViewState.Idle); } @@ -183,8 +187,9 @@ class PatientViewModel extends BaseViewModel { } List getDoctorNameList() { - var doctorNamelist = - _patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList(); + var doctorNamelist = _patientService.doctorsList + .map((value) => value['DoctorName'].toString()) + .toList(); return doctorNamelist; } @@ -194,6 +199,7 @@ class PatientViewModel extends BaseViewModel { .toList(); return clinicsNameslist; } + Future getReferralFrequancyList() async { setState(ViewState.Busy); await _patientService.getReferralFrequancyList(); diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..90a06bc9 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -4,11 +4,13 @@ import 'package:get_it/get_it.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; +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/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; +import 'core/viewModel/patient-doctor-referral-viewModel.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -24,6 +26,7 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => PatientReferralService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +35,5 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => PatientReferralViewModel()); } diff --git a/lib/main.dart b/lib/main.dart index 06d0ecfa..87de7057 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -60,7 +60,7 @@ class MyApp extends StatelessWidget { buttonColor: HexColor('#B8382C'), fontFamily: 'WorkSans', dividerColor: Colors.grey[350], - backgroundColor: Color.fromRGBO(255,255,255, 1) + backgroundColor: Color.fromRGBO(255,255,255, 1), ), initialRoute: INIT_ROUTE, routes: routes, diff --git a/lib/models/patient/PatientArrivalEntity.dart b/lib/models/patient/PatientArrivalEntity.dart new file mode 100644 index 00000000..54622cd7 --- /dev/null +++ b/lib/models/patient/PatientArrivalEntity.dart @@ -0,0 +1,84 @@ +class PatientArrivalEntity { + String age; + String appointmentDate; + int appointmentNo; + String appointmentType; + String arrivedOn; + String companyName; + String endTime; + int episodeNo; + int fallRiskScore; + String gender; + int medicationOrders; + String mobileNumber; + String nationality; + int patientMRN; + String patientName; + int rowCount; + String startTime; + String visitType; + + PatientArrivalEntity( + {this.age, + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.companyName, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.gender, + this.medicationOrders, + this.mobileNumber, + this.nationality, + this.patientMRN, + this.patientName, + this.rowCount, + this.startTime, + this.visitType}); + + PatientArrivalEntity.fromJson(Map json) { + age = json['age']; + appointmentDate = json['appointmentDate']; + appointmentNo = json['appointmentNo']; + appointmentType = json['appointmentType']; + arrivedOn = json['arrivedOn']; + companyName = json['companyName']; + endTime = json['endTime']; + episodeNo = json['episodeNo']; + fallRiskScore = json['fallRiskScore']; + gender = json['gender']; + medicationOrders = json['medicationOrders']; + mobileNumber = json['mobileNumber']; + nationality = json['nationality']; + patientMRN = json['patientMRN']; + patientName = json['patientName']; + rowCount = json['rowCount']; + startTime = json['startTime']; + visitType = json['visitType']; + } + + Map toJson() { + final Map data = new Map(); + data['age'] = this.age; + data['appointmentDate'] = this.appointmentDate; + data['appointmentNo'] = this.appointmentNo; + data['appointmentType'] = this.appointmentType; + data['arrivedOn'] = this.arrivedOn; + data['companyName'] = this.companyName; + data['endTime'] = this.endTime; + data['episodeNo'] = this.episodeNo; + data['fallRiskScore'] = this.fallRiskScore; + data['gender'] = this.gender; + data['medicationOrders'] = this.medicationOrders; + data['mobileNumber'] = this.mobileNumber; + data['nationality'] = this.nationality; + data['patientMRN'] = this.patientMRN; + data['patientName'] = this.patientName; + data['rowCount'] = this.rowCount; + data['startTime'] = this.startTime; + data['visitType'] = this.visitType; + return data; + } +} \ No newline at end of file diff --git a/lib/models/patient/my_referral/PendingReferral.dart b/lib/models/patient/my_referral/PendingReferral.dart new file mode 100644 index 00000000..9da17985 --- /dev/null +++ b/lib/models/patient/my_referral/PendingReferral.dart @@ -0,0 +1,119 @@ +class PendingReferral { + String responded; + String answerFromTarget; + String createdOn; + int data; + String editedOn; + int interBranchReferral; + int patientID; + String patientName; + int patientType; + int referralNo; + String referralStatus; + String referredByDoctorInfo; + String referredFromBranchName; + String referredOn; + String referredType; + String remarksFromSource; + String respondedOn; + int sourceAppointmentNo; + int sourceProjectId; + String sourceSetupID; + String startDate; + int targetAppointmentNo; + String targetClinicID; + String targetDoctorID; + int targetProjectId; + String targetSetupID; + bool isReferralDoctorSameBranch; + + PendingReferral( + {this.responded, + this.answerFromTarget, + this.createdOn, + this.data, + this.editedOn, + this.interBranchReferral, + this.patientID, + this.patientName, + this.patientType, + this.referralNo, + this.referralStatus, + this.referredByDoctorInfo, + this.referredFromBranchName, + this.referredOn, + this.referredType, + this.remarksFromSource, + this.respondedOn, + this.sourceAppointmentNo, + this.sourceProjectId, + this.sourceSetupID, + this.startDate, + this.targetAppointmentNo, + this.targetClinicID, + this.targetDoctorID, + this.targetProjectId, + this.targetSetupID, + this.isReferralDoctorSameBranch, + }); + + PendingReferral.fromJson(Map json) { + responded = json['Responded']; + answerFromTarget = json['answerFromTarget']; + createdOn = json['createdOn']; + data = json['data']; + editedOn = json['editedOn']; + interBranchReferral = json['interBranchReferral']; + patientID = json['patientID']; + patientName = json['patientName']; + patientType = json['patientType']; + referralNo = json['referralNo']; + referralStatus = json['referralStatus']; + referredByDoctorInfo = json['referredByDoctorInfo']; + referredFromBranchName = json['referredFromBranchName']; + referredOn = json['referredOn']; + referredType = json['referredType']; + remarksFromSource = json['remarksFromSource']; + respondedOn = json['respondedOn']; + sourceAppointmentNo = json['sourceAppointmentNo']; + sourceProjectId = json['sourceProjectId']; + sourceSetupID = json['sourceSetupID']; + startDate = json['startDate']; + targetAppointmentNo = json['targetAppointmentNo']; + targetClinicID = json['targetClinicID']; + targetDoctorID = json['targetDoctorID']; + targetProjectId = json['targetProjectId']; + targetSetupID = json['targetSetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['Responded'] = this.responded; + data['answerFromTarget'] = this.answerFromTarget; + data['createdOn'] = this.createdOn; + data['data'] = this.data; + data['editedOn'] = this.editedOn; + data['interBranchReferral'] = this.interBranchReferral; + data['patientID'] = this.patientID; + data['patientName'] = this.patientName; + data['patientType'] = this.patientType; + data['referralNo'] = this.referralNo; + data['referralStatus'] = this.referralStatus; + data['referredByDoctorInfo'] = this.referredByDoctorInfo; + data['referredFromBranchName'] = this.referredFromBranchName; + data['referredOn'] = this.referredOn; + data['referredType'] = this.referredType; + data['remarksFromSource'] = this.remarksFromSource; + data['respondedOn'] = this.respondedOn; + data['sourceAppointmentNo'] = this.sourceAppointmentNo; + data['sourceProjectId'] = this.sourceProjectId; + data['sourceSetupID'] = this.sourceSetupID; + data['startDate'] = this.startDate; + data['targetAppointmentNo'] = this.targetAppointmentNo; + data['targetClinicID'] = this.targetClinicID; + data['targetDoctorID'] = this.targetDoctorID; + data['targetProjectId'] = this.targetProjectId; + data['targetSetupID'] = this.targetSetupID; + return data; + } +} \ No newline at end of file diff --git a/lib/models/patient/my_referral/my_referred_patient_model.dart b/lib/models/patient/my_referral/my_referred_patient_model.dart index 9ecfdb2f..850c29cb 100644 --- a/lib/models/patient/my_referral/my_referred_patient_model.dart +++ b/lib/models/patient/my_referral/my_referred_patient_model.dart @@ -59,6 +59,7 @@ class MyReferredPatientModel { this.priorityDescription, this.referralClinicDescription, this.referralDoctorName, + this.isReferralDoctorSameBranch, }); int projectId; @@ -111,6 +112,7 @@ class MyReferredPatientModel { String priorityDescription; String referralClinicDescription; String referralDoctorName; + bool isReferralDoctorSameBranch; factory MyReferredPatientModel.fromJson(Map json) => MyReferredPatientModel( projectId: json["ProjectID"], diff --git a/lib/routes.dart b/lib/routes.dart index dff02129..4c9e53a3 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -37,6 +37,8 @@ import './screens/settings/settings_screen.dart'; import 'landing_page.dart'; import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; +import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; +import 'screens/patients/profile/referral/refer-patient-screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; @@ -65,6 +67,8 @@ const String PRESCRIPTIONS = 'patients/prescription'; const String RADIOLOGY = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; const String REFER_PATIENT = 'patients/refer-patient'; +const String MY_REFERRAL_DETAIL = 'my_referral_detail'; +const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor'; const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; @@ -102,6 +106,7 @@ var routes = { RADIOLOGY: (_) => RadiologyScreen(), PROGRESS_NOTE: (_) => ProgressNoteScreen(), REFER_PATIENT: (_) => ReferPatientScreen(), + REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), @@ -110,4 +115,5 @@ var routes = { // VIDEO_CALL: (_) => VideoCallPage(patientData: null), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() + MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 80697352..0c1c4812 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -7,9 +7,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -23,6 +25,7 @@ import 'doctor/doctor_reply_screen.dart'; import 'doctor/my_referral_patient_screen.dart'; import 'doctor/my_referred_patient_screen.dart'; import 'medicine/medicine_search_screen.dart'; +import 'patients/profile/referral/referred-patient-screen.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -80,133 +83,56 @@ class _DashboardScreenState extends State { Stack(children: [ Column( children: [ - Container( - height: 140, - color: HexColor('#515B5D'), - width: double.infinity, - child: FractionallySizedBox( - widthFactor: 0.9, + ProfileWelcomeWidget( + InkWell( + onTap: () async { + showCupertinoPicker( + decKey: '', + context: context, + actionList: projectsProvider.doctorClinicsList); + }, child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase - .of(context) - .welcome, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - 'Dr. ${authProvider.doctorProfile.doctorName}', - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.white, - ) - ], - ), - SizedBox( - height: 4, - ), - InkWell( - onTap: () async { - showCupertinoPicker( - decKey: '', - context: context, - actionList: projectsProvider - .doctorClinicsList); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - child: AppText( - authProvider.selectedClinicName != - null - ? authProvider.selectedClinicName - : authProvider.doctorProfile - .clinicDescription, - fontSize: - SizeConfig.textMultiplier * 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - - child: Container( - margin: EdgeInsets.only( - left: 5, - top: projectsProvider - .isArabic ? 0 : 5, - right: 10, - bottom: projectsProvider - .isArabic ? 15 : 7), - child: Icon( - DoctorApp.sync_icon, - - color: Colors.white, - size: SizeConfig - .textMultiplier * - 1.8, - )), - ), - ], - ), - ]), + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: AppText( + authProvider.selectedClinicName != null + ? authProvider.selectedClinicName + : authProvider + .doctorProfile.clinicDescription, + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.white, + textAlign: TextAlign.center, ), - - ], - ), - Expanded( - child: Column( + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, + ), + Row( mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - decoration: BoxDecoration( - color: Theme - .of(context) - .backgroundColor, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - ), - height: 50, - width: 60, - child: Image.network( - authProvider.doctorProfile - .doctorImageURL, -// fit: BoxFit.fill, - ), + InkWell( + child: Container( + margin: EdgeInsets.only( + left: 5, + top: projectsProvider.isArabic + ? 0 + : 5, + right: 10, + bottom: projectsProvider.isArabic + ? 15 + : 7), + child: Icon( + DoctorApp.sync_icon, + color: Colors.white, + size: SizeConfig.textMultiplier * 1.8, + )), ), ], ), - ), - ], - ), + ]), ), ), Container( @@ -246,18 +172,18 @@ class _DashboardScreenState extends State { center: Column( mainAxisAlignment: MainAxisAlignment.center, children: [ - AppText("38", - fontSize: - SizeConfig.textMultiplier * 3.7, + AppText( + "38", + fontSize: SizeConfig.textMultiplier * 3.7, color: HexColor('#5D4C35'), - fontWeight: FontWeight.bold,), - AppText(TranslationBase - .of(context) - .outPatients, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 1.4, - color: HexColor('#5D4C35'), - ), + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).outPatients, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 1.4, + color: HexColor('#5D4C35'), + ), ], ), circularStrokeCap: CircularStrokeCap.butt, @@ -418,15 +344,12 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .labResult, + TranslationBase.of(context).labResult, color: Colors.white, ) ], ), ), - ], ), imageName: '1.png', @@ -446,7 +369,6 @@ class _DashboardScreenState extends State { ), Container( margin: EdgeInsets.only(bottom: 10), - child: Column( children: [ AppText( @@ -455,15 +377,12 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .radiology, + TranslationBase.of(context).radiology, color: Colors.white, ) ], ), ), - ], ), imageName: '2.png', @@ -481,10 +400,8 @@ class _DashboardScreenState extends State { color: Colors.white, ), ), - Container( margin: EdgeInsets.only(bottom: 10), - child: Column( children: [ AppText( @@ -493,20 +410,16 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .referral, + TranslationBase.of(context).referral, color: Colors.white, ) ], ), ), - ], ), imageName: '3.png', opacity: 0.9, - ), ], ), @@ -522,7 +435,7 @@ class _DashboardScreenState extends State { padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( children: [ @@ -542,9 +455,7 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .inPatient, + TranslationBase.of(context).inPatient, color: Colors.white, ) ], @@ -555,28 +466,18 @@ class _DashboardScreenState extends State { imageName: '4.png', color: HexColor('#B8382C'), hasBorder: false, - width: MediaQuery - .of(context) - .size - .width * 0.44, - height: MediaQuery - .of(context) - .orientation == Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * 0.13: - MediaQuery - .of(context) - .size - .height * 0.25, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.13 + : MediaQuery.of(context).size.height * 0.25, ), DashboardItem( child: Padding( padding: const EdgeInsets.all(8.0), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, children: [ Column( children: [ @@ -596,9 +497,7 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase - .of(context) - .operations, + TranslationBase.of(context).operations, color: Colors.white, ) ], @@ -609,21 +508,11 @@ class _DashboardScreenState extends State { imageName: '5.png', color: HexColor('#B8382C'), hasBorder: false, - width: MediaQuery - .of(context) - .size - .width * 0.44, - height: MediaQuery - .of(context) - .orientation == Orientation.portrait - ? MediaQuery - .of(context) - .size - .height * 0.13: - MediaQuery - .of(context) - .size - .height * 0.25, + width: MediaQuery.of(context).size.width * 0.44, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.13 + : MediaQuery.of(context).size.height * 0.25, ), ], ), @@ -633,9 +522,7 @@ class _DashboardScreenState extends State { Row( children: [ AppText( - TranslationBase - .of(context) - .patientServices, + TranslationBase.of(context).patientServices, fontSize: SizeConfig.textMultiplier * 3, ), ], @@ -691,16 +578,12 @@ class _DashboardScreenState extends State { Column( children: [ AppText( - TranslationBase - .of(context) - .theDoctor, + TranslationBase.of(context).theDoctor, textAlign: TextAlign.center, color: Colors.black, ), AppText( - TranslationBase - .of(context) - .reply, + TranslationBase.of(context).reply, textAlign: TextAlign.center, color: Colors.black, ), @@ -713,8 +596,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - DoctorReplyScreen(), + builder: (context) => DoctorReplyScreen(), ), ); }, @@ -729,9 +611,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .searchMedicine, + TranslationBase.of(context).searchMedicine, color: Colors.black, textAlign: TextAlign.center, ) @@ -742,8 +622,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MedicineSearchScreen(), + builder: (context) => MedicineSearchScreen(), ), ); }, @@ -777,12 +656,8 @@ class _DashboardScreenState extends State { ), AppText( projectsProvider.isArabic - ? TranslationBase - .of(context) - .qr - : TranslationBase - .of(context) - .reader, + ? TranslationBase.of(context).qr + : TranslationBase.of(context).reader, color: Colors.black, textAlign: TextAlign.center, ), @@ -806,9 +681,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .myReferralPatient, + TranslationBase.of(context).myReferralPatient, textAlign: TextAlign.center, color: Colors.black, ) @@ -820,7 +693,7 @@ class _DashboardScreenState extends State { context, MaterialPageRoute( builder: (context) => - MyReferralPatient(), + MyReferralPatientScreen(), ), ); }, @@ -835,9 +708,7 @@ class _DashboardScreenState extends State { color: Colors.black, ), AppText( - TranslationBase - .of(context) - .myReferredPatient, + TranslationBase.of(context).myReferredPatient, color: Colors.black, textAlign: TextAlign.center, ) @@ -848,8 +719,8 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MyReferredPatient(), + builder: (context) => ReferredPatientScreen(), + // MyReferredPatient(), ), ); }, @@ -890,21 +761,17 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ CupertinoButton( - child: AppText(TranslationBase - .of(context) - .cancel - // style: TextStyle(context) - ), + child: AppText(TranslationBase.of(context).cancel + // style: TextStyle(context) + ), onPressed: () { Navigator.pop(context); }, ), CupertinoButton( - child: AppText(TranslationBase - .of(context) - .done - // style: textStyle(context), - ), + child: AppText(TranslationBase.of(context).done + // style: textStyle(context), + ), onPressed: () { Navigator.pop(context); // onSelectFun(cupertinoPickerIndex); @@ -927,8 +794,7 @@ class _DashboardScreenState extends State { child: AppText( e.clinicName, fontSize: - SizeConfig.textMultiplier * - 1.9, + SizeConfig.textMultiplier * 1.9, )), ), )) @@ -969,19 +835,20 @@ class _DashboardScreenState extends State { }); } } + // TODO Move to it file class DashboardItem extends StatelessWidget { - const DashboardItem({ - this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4 - }) : super(key: key); + const DashboardItem( + {this.hasBorder = false, + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4}) + : super(key: key); final bool hasBorder; final String imageName; final Widget child; @@ -996,38 +863,34 @@ class DashboardItem extends StatelessWidget { return InkWell( onTap: onTap, child: Container( - width: width != null ? width : MediaQuery - .of(context) - .size - .width * 0.29, - height: height != null ? height : MediaQuery - .of(context) - .orientation == Orientation.portrait ? MediaQuery - .of(context) - .size - .height * 0.19 : MediaQuery - .of(context) - .size - .height * 0.35, - + width: width != null ? width : MediaQuery.of(context).size.width * 0.29, + height: height != null + ? height + : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( - color: !hasBorder ? color != null ? color : HexColor('#050705') - .withOpacity(opacity) : Colors - .white, + color: !hasBorder + ? color != null + ? color + : HexColor('#050705').withOpacity(opacity) + : Colors.white, borderRadius: BorderRadius.circular(6.0), - border: hasBorder ? Border.all( - width: 1.0, color: const Color(0xffcccccc)) : Border.all( - width: 0.0, color: Colors.transparent), - image: imageName != null ? DecorationImage( - image: AssetImage('assets/images/dashboard/${imageName}'), - fit: BoxFit.cover, - colorFilter: new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn), - - ) : null, - + border: hasBorder + ? Border.all(width: 1.0, color: const Color(0xffcccccc)) + : Border.all(width: 0.0, color: Colors.transparent), + image: imageName != null + ? DecorationImage( + image: AssetImage('assets/images/dashboard/${imageName}'), + fit: BoxFit.cover, + colorFilter: new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn), + ) + : null, + ), + child: Center( + child: child, ), - child: Center(child: child,), ), ); } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4ca3e587..6ec180e9 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -293,6 +293,7 @@ class _PatientsScreenState extends State { } }); }).catchError((error) { + setState(() { _isError = true; _isLoading = false; diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart new file mode 100644 index 00000000..3d2b5202 --- /dev/null +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -0,0 +1,147 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-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/borderedButton.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class MyReferralDetailScreen extends StatelessWidget { + PendingReferral pendingReferral; + + @override + Widget build(BuildContext context) { + final gridHeight = (MediaQuery.of(context).size.width * 0.3) * 1.8; + + AuthViewModel authProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + pendingReferral = routeArgs['referral']; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + body: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ProfileWelcomeWidget( + AppText( + authProvider.selectedClinicName != null + ? authProvider.selectedClinicName + : authProvider.doctorProfile.clinicDescription, + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.white, + textAlign: TextAlign.center, + ), + height: 100, + ), + SizedBox( + height: 16, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: AppText( + TranslationBase.of(context).myReferralPatient, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + PatientReferralItemWidget( + patientName: pendingReferral.patientName, + referralStatus: null, + isReferredTo: false, + isSameBranch: pendingReferral.isReferralDoctorSameBranch, + referralDoctorName: pendingReferral.referredByDoctorInfo, + clinicDescription: null, + remark: pendingReferral.remarksFromSource, + ), + SizedBox( + child: GridView.count( + childAspectRatio: 1.8, + crossAxisSpacing: 8, + mainAxisSpacing: 10, + controller: new ScrollController(keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + crossAxisCount: 2, + children: [ + PatientProfileButton( + key: key, + // patient: patient, + // route: RADIOLOGY, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + // patient: patient, + // route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), + PatientProfileButton( + key: key, + // patient: patient, + // route: VITAL_SIGN_DETAILS, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + icon: 'heartbeat.png'), + ], + ), + ), + ], + ), + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Row( + children: [ + Expanded( + child: BorderedButton( + TranslationBase.of(context).accept, + backgroundColor: Color(0xFF4BA821), + textColor: Colors.white, + fontSize: 16, + hPadding: 8, + vPadding: 12, + handler: null, + ), + ), + SizedBox( + height: 8, + ), + Expanded( + child: BorderedButton( + TranslationBase.of(context).reject, + backgroundColor: Color(0xFFB9382C), + textColor: Colors.white, + fontSize: 16, + hPadding: 8, + vPadding: 12, + handler: null, + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart new file mode 100644 index 00000000..5a91ac51 --- /dev/null +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -0,0 +1,98 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-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:flutter/material.dart'; +import 'package:provider/provider.dart'; + +import '../../../../routes.dart'; + +class MyReferralPatientScreen extends StatelessWidget { + // previous design page is: MyReferralPatient + @override + Widget build(BuildContext context) { + AuthViewModel authProvider = Provider.of(context); + + return BaseView( + onModelReady: (model) => model.getPendingReferralPatients(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + body: model.pendingReferral == null || + model.pendingReferral.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ProfileWelcomeWidget( + AppText( + authProvider.selectedClinicName != null + ? authProvider.selectedClinicName + : authProvider.doctorProfile.clinicDescription, + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.white, + textAlign: TextAlign.center, + ), + height: 100, + ), + SizedBox( + height: 16, + ), + Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: AppText( + TranslationBase.of(context).myReferralPatient, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + ...List.generate( + model.pendingReferral.length, + (index) => PatientReferralItemWidget( + patientName: model.pendingReferral[index].patientName, + referralStatus: null, + isReferredTo: false, + isSameBranch: model.pendingReferral[index] + .isReferralDoctorSameBranch, + referralDoctorName: + model.pendingReferral[index].referredByDoctorInfo, + clinicDescription: null, + remark: + model.pendingReferral[index].remarksFromSource, + infoIcon: InkWell( + onTap: () { + Navigator.of(context).pushNamed( + MY_REFERRAL_DETAIL, + arguments: { + 'referral': model.pendingReferral[index] + }); + }, + child: Icon( + Icons.info_outline, + color: Colors.black, + size: 30, + ), + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart new file mode 100644 index 00000000..ec8aaf93 --- /dev/null +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -0,0 +1,445 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart'; +import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../QR_reader_screen.dart'; + +class PatientMakeReferralScreen extends StatefulWidget { + // previous design page is: ReferPatientScreen + @override + _PatientMakeReferralScreenState createState() => + _PatientMakeReferralScreenState(); +} + +class _PatientMakeReferralScreenState extends State { + PatiantInformtion patient; + List referToList; + dynamic _referTo; + dynamic _selectedBranch; + dynamic _selectedClinic; + dynamic _selectedDoctor; + DateTime appointmentDate; + final _remarksController = TextEditingController(); + PatientArrivalEntity _selectedPatientArrivalEntity; + + @override + void initState() { + super.initState(); + referToList = List(); + dynamic sameBranch = {"id": 1, "name": "Same Branch"}; + dynamic otherBranch = {"id": 2, "name": "Other Branch"}; + referToList.add(sameBranch); + referToList.add(otherBranch); + appointmentDate = DateTime.now(); + } + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + + final screenSize = MediaQuery.of(context).size; + + return BaseView( + onModelReady: (model) => model.getBranches(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + body: SingleChildScrollView( + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + children: [ + Container( + height: 75, + child: AppText( + "This is where upper view for avatar.. etc placed", + fontWeight: FontWeight.normal, + fontSize: 16, + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 2, + indent: 0, + endIndent: 0, + ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).referPatient, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: referToList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: referToList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + model + .getDoctorBranch() + .then((value) { + _selectedBranch = value; + if (_referTo['id'] == 1) { + model.getClinics( + _selectedBranch['ID']); + } + }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).referTo, + _referTo != null ? _referTo['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.branchesList != null && + model.branchesList.length > 0 && + _referTo != null && + _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.branchesList, + attributeName: 'Desciption', + attributeValueId: 'ID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + model.getClinics( + _selectedBranch['ID']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).branch, + _selectedBranch != null + ? _selectedBranch['Desciption'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedBranch != null && + model.clinicsList != null && + model.clinicsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.clinicsList, + attributeName: 'ClinicDescription', + attributeValueId: 'ClinicID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = null; + _selectedClinic = selectedValue; + model.getClinicDoctors( + _selectedClinic['ClinicID'] + .toString()); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).clinic, + _selectedClinic != null + ? _selectedClinic['ClinicDescription'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doctor, + _selectedDoctor != null + ? _selectedDoctor['DoctorName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => _selectDate(context, model), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .chooseAppointment, + _selectedPatientArrivalEntity != null + ? "${TranslationBase.of(context).appointmentNo} ${_selectedPatientArrivalEntity.appointmentNo}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).remarks, + null, + false), + enabled: true, + controller: _remarksController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_LETTERS)) + ], + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + ], + ), + ), + ], + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + color: HexColor("#B8382B"), + onPressed: () => { + /*referToDoctor(context, model)*/ + }, + ), + ) + ], + ), + ), + ), + ), + ); + } + + _selectDate(BuildContext context, PatientReferralViewModel model) async { + // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference + // https://stackoverflow.com/a/63147062/6246772 to customize a date picker + final DateTime picked = await showDatePicker( + context: context, + initialDate: appointmentDate, + firstDate: DateTime(2000), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != appointmentDate) { + appointmentDate = picked; + model + .getPatientArrivalList(DateUtils.convertStringToDateFormat( + appointmentDate.toString(), "yyyy-MM-dd")) + .then((_) { + if (model.patientArrivalList != null && + model.patientArrivalList.length > 0) { + List appointments = model.getAppointmentsByPatientName("${patient.firstName} ${patient.middleName} ${patient.lastName}"); + if(appointments.length > 0){ + ListSelectDialog dialog = + ListSelectDialog( + list: appointments, + attributeName: 'appointmentNo', + attributeValueId: 'appointmentNo', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedPatientArrivalEntity = PatientArrivalEntity.fromJson(selectedValue); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + }else { + setState(() { + _selectedPatientArrivalEntity = null; + }); + DrAppToastMsg.showErrorToast("There is no appointments for ${patient.firstName} ${patient.middleName} ${patient.lastName}"); + } + }else { + setState(() { + _selectedPatientArrivalEntity = null; + }); + DrAppToastMsg.showErrorToast("There is no appointments for ${patient.firstName} ${patient.middleName} ${patient.lastName}"); + } + }); + } + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 2.0, + )), + ); + } +} diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart new file mode 100644 index 00000000..9fc5b4f8 --- /dev/null +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -0,0 +1,74 @@ +import 'package:doctor_app_flutter/core/viewModel/patient-doctor-referral-viewModel.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-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:flutter/material.dart'; + +class ReferredPatientScreen extends StatelessWidget { + // previous design page is: MyReferredPatient + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getMyReferredPatient(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).referPatient, + body: model.listMyReferredPatientModel == null || + model.listMyReferredPatientModel.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : SingleChildScrollView( + child: Container( + child: Column( + children: [ + Container( + height: 75, + child: AppText( + "This is where upper view for avatar.. etc placed", + fontWeight: FontWeight.normal, + fontSize: 16, + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 2, + indent: 0, + endIndent: 0, + ), + ...List.generate( + model.listMyReferredPatientModel.length, + (index) => PatientReferralItemWidget( + patientName: + "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", + referralStatus: + "${model.getReferredPatientItem(index).referralStatus}", + isReferredTo: true, + isSameBranch: model + .getReferredPatientItem(index) + .isReferralDoctorSameBranch, + referralDoctorName: model + .getReferredPatientItem(index) + .referralDoctorName, + clinicDescription: model + .getReferredPatientItem(index) + .referralClinicDescription, + remark: model + .getReferredPatientItem(index) + .referringDoctorRemarks, + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index fd1baa01..09259b45 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -41,7 +41,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; timeInSeconds: 1); } - void showTopShortToast(msg) { + static void showTopShortToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b520fd6f..940e0617 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -80,6 +80,7 @@ class TranslationBase { String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get referPatient => localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; @@ -297,6 +298,21 @@ class TranslationBase { String get area => localizedValues['area'][locale.languageCode]; String get room => localizedValues['room'][locale.languageCode]; String get bed => localizedValues['bed'][locale.languageCode]; + String get referTo => localizedValues['referTo'][locale.languageCode]; + String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; + String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; + String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get refer => localizedValues['refer'][locale.languageCode]; + String get approved => localizedValues['approved'][locale.languageCode]; + String get rejected => localizedValues['rejected'][locale.languageCode]; + String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String get dr => localizedValues['dr'][locale.languageCode]; + String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; + String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; + String get reject => localizedValues['reject'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart new file mode 100644 index 00000000..662e7fee --- /dev/null +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -0,0 +1,143 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class PatientReferralItemWidget extends StatelessWidget { + final String patientName; + final String referralStatus; + final isReferredTo; + final isSameBranch; + final String referralDoctorName; + final String clinicDescription; + final String remark; + final Widget infoIcon; + + PatientReferralItemWidget({ + this.patientName, + this.referralStatus, + this.isReferredTo = false, + this.isSameBranch, + this.referralDoctorName, + this.clinicDescription, + this.remark, + this.infoIcon, + }); + + @override + Widget build(BuildContext context) { + return Container( + margin: EdgeInsets.all(16.0), + child: Column( + children: [ + Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Center( + child: AppText( + patientName, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + if (referralStatus != null) + Container( + color: Color(0xFF4BA821), + padding: EdgeInsets.all(4), + child: AppText( + referralStatus == "46" + ? TranslationBase.of(context).approved + : TranslationBase.of(context).rejected, + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + SizedBox( + height: 8, + ), + Row( + children: [ + AppText( + isReferredTo + ? "${TranslationBase.of(context).referTo}: " + : "${TranslationBase.of(context).referredFrom}: ", + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, + color: Colors.grey, + fontWeight: FontWeight.normal, + fontSize: 12, + ), + ], + ), + SizedBox( + height: 8, + ), + AppText( + "${TranslationBase.of(context).dr} $referralDoctorName", + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + SizedBox( + height: 8, + ), + if (clinicDescription != null) + Row( + children: [ + AppText( + "${TranslationBase.of(context).clinic}: ", + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + clinicDescription, + color: Colors.grey, + fontWeight: FontWeight.normal, + fontSize: 12, + ), + ], + ), + SizedBox( + height: 8, + ), + AppText( + remark, + color: Colors.grey, + fontWeight: FontWeight.normal, + fontSize: 12, + ), + SizedBox( + height: 16, + ), + ], + ), + ), + if (infoIcon != null) infoIcon, + ], + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 8, + ), + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart new file mode 100644 index 00000000..dab1f9de --- /dev/null +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -0,0 +1,86 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class PatientProfileButton extends StatelessWidget { + final String nameLine1; + final String nameLine2; + final String icon; + final dynamic route; + final PatiantInformtion patient; + final String url = "assets/images/"; + PatientProfileButton( + {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) + : super(key: key); + @override + Widget build(BuildContext context) { + return new Container( + margin: new EdgeInsets.symmetric(horizontal: 4.0), + child: InkWell( + onTap: () { + navigator(context, this.route); + }, + child: Column(children: [ + Container( + alignment: Alignment.topLeft, + padding: EdgeInsets.all(5), + child: + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + this.nameLine1, + color: Color(0xFFB9382C), + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontSize: SizeConfig.textMultiplier * 2, + ), + AppText( + this.nameLine2, + color: Colors.black, + fontWeight: FontWeight.w600, + textAlign: TextAlign.left, + fontSize: SizeConfig.textMultiplier * 2, + ), + ], + ), + ), + Expanded( + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(10), + child: new Image.asset(url + icon)) + ], + )), + ) + ]), + ), + decoration: BoxDecoration( + // border: Border.all(), + color: Colors.white, + borderRadius: BorderRadius.all(Radius.circular(10)), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + boxShadow: [ + BoxShadow( + color: Colors.grey.withOpacity(0.2), + spreadRadius: 5, + blurRadius: 7, + offset: Offset(0, 3), // changes position of shadow + ), + ], + ), + padding: EdgeInsets.fromLTRB(5, 10, 5, 5), + ); + } + + void navigator(BuildContext context, route) { + Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart new file mode 100644 index 00000000..fae705f4 --- /dev/null +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -0,0 +1,86 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class ProfileWelcomeWidget extends StatelessWidget { + + final Widget clinicWidget; +final double height; + + ProfileWelcomeWidget(this.clinicWidget, {this.height = 140}); + + @override + Widget build(BuildContext context) { + AuthViewModel authProvider = Provider.of(context); + + return Container( + height: height, + color: HexColor('#515B5D'), + width: double.infinity, + child: FractionallySizedBox( + widthFactor: 0.9, + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context).welcome, + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.white, + ) + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + 'Dr. ${authProvider.doctorProfile.doctorName}', + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + color: Colors.white, + ) + ], + ), + SizedBox( + height: 4, + ), + clinicWidget, + ], + ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + color: Theme.of(context).backgroundColor, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + ), + height: 50, + width: 60, + child: Image.network( + authProvider.doctorProfile.doctorImageURL, +// fit: BoxFit.fill, + ), + ), + ], + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b8136026..76a26fac 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -6,9 +6,10 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; -import '../../shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'PatientProfileButton.dart'; + /* *@author: Elham Rababah *@Date:22/4/2020 @@ -52,8 +53,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: RADIOLOGY, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5, @@ -78,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: PatientProfileButton( key: key, patient: patient, - route: REFER_PATIENT, + route: REFER_PATIENT_TO_DOCTOR, nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'note.png')), @@ -143,85 +144,3 @@ class CircleAvatarWidget extends StatelessWidget { ); } } - -class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; - final String icon; - final dynamic route; - final PatiantInformtion patient; - final String url = "assets/images/"; - PatientProfileButton( - {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) - : super(key: key); - @override - Widget build(BuildContext context) { - return new Container( - margin: new EdgeInsets.symmetric(horizontal: 4.0), - child: InkWell( - onTap: () { - navigator(context, this.route); - }, - child: Column(children: [ - Container( - alignment: Alignment.topLeft, - padding: EdgeInsets.all(5), - child: - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - this.nameLine1, - color: Color(0xFFB9382C), - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, - ), - AppText( - this.nameLine2, - color: Colors.black, - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, - ), - ], - ), - ), - Expanded( - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(10), - child: new Image.asset(url + icon)) - ], - )), - ) - ]), - ), - decoration: BoxDecoration( - // border: Border.all(), - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(10)), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ], - ), - padding: EdgeInsets.fromLTRB(5, 10, 5, 5), - ); - } - - void navigator(BuildContext context, route) { - Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); - } -} diff --git a/lib/widgets/shared/borderedButton.dart b/lib/widgets/shared/borderedButton.dart new file mode 100644 index 00000000..5ccf4544 --- /dev/null +++ b/lib/widgets/shared/borderedButton.dart @@ -0,0 +1,83 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/material.dart'; + +class BorderedButton extends StatelessWidget { + final String text; + final Function handler; + final Color textColor; + final bool hasBorder; + final Color borderColor; + final Color backgroundColor; + final double vPadding; + final double hPadding; + final double radius; + final double lPadding; + final double tPadding; + final double rPadding; + final double bPadding; + final double fontSize; + final Widget icon; + final FontWeight fontWeight; + + BorderedButton( + this.text, { + this.handler, + this.textColor, + this.hasBorder = false, + this.borderColor, + this.backgroundColor, + this.vPadding = 0, + this.hPadding = 0, + this.radius = 4.0, + this.lPadding = 4.0, + this.tPadding = 0.0, + this.rPadding = 4.0, + this.bPadding = 0.0, + this.fontSize = 0, + this.icon, + this.fontWeight, + }); + + @override + Widget build(BuildContext context) { + return GestureDetector( + onTap: () { + handler(); + }, + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: backgroundColor ?? Colors.white, + borderRadius: BorderRadius.circular(radius), + border: Border.fromBorderSide(BorderSide( + color: hasBorder ? borderColor : Colors.white, + width: 0.8, + )), + ), + child: Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + icon != null ? icon : Container(), + Container( + padding: (hPadding > 0 || vPadding > 0) + ? EdgeInsets.symmetric( + vertical: vPadding, horizontal: hPadding) + : EdgeInsets.fromLTRB( + lPadding, tPadding, rPadding, bPadding), + child: Text( + text, + textAlign: TextAlign.center, + style: TextStyle( + fontSize: fontSize == 0 ? SizeConfig.textMultiplier * 1.6 : fontSize, + fontWeight: fontWeight != null ? fontWeight : FontWeight.normal, + color: textColor ?? Color(0xffc4aa54)), + ), + ), + ], + ), + ), + ), + ); + } +} From 9bb396c30972b08f7a81d261ba469098acd39c3f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 23 Dec 2020 18:38:10 +0200 Subject: [PATCH 030/421] fix error in base app --- lib/client/base_app_client.dart | 22 +++++++++++++++---- .../SOAP/subjective/subjective_page.dart | 6 ++++- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index cc77681f..9d621755 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -3,11 +3,9 @@ import 'dart:convert'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:http/http.dart' as http; -import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -84,10 +82,26 @@ class BaseAppClient { await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian'); - } else if (parsed['MessageStatus'] == 1) { + } else + if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { - onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + String error = + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; + + if (parsed["ValidationErrors"] != null) { + if (parsed["ValidationErrors"]["ValidationErrors"] != null && + parsed["ValidationErrors"]["ValidationErrors"].length != 0) { + error =''; + for (var i = 0; + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { + error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n"; + } + } + } + + onFailure(error, statusCode); } } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 86a17e89..a78f6d0b 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; @@ -286,7 +288,9 @@ class _SubjectivePageState extends State { }); await model.postAllergy(postAllergyRequestModel); - + if(model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } widget.changePageViewIndex(1); print(postAllergyRequestModel); From cb80ce778523c8ec8fa5588a568a3ab4c2d00b93 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 23 Dec 2020 18:38:41 +0200 Subject: [PATCH 031/421] isAuthunticated behaviour --- lib/client/base_app_client.dart | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ca1b196a..f7498cc8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -82,10 +82,8 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - // TODO commented this and make si success just for test - // await helpers.logout(); - // helpers.showErrorToast('Your session expired Please login again'); - onSuccess(parsed, statusCode); + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login again'); } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { From d2550df08cfd6981836587c628223366beae79a8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 23 Dec 2020 19:06:14 +0200 Subject: [PATCH 032/421] adding shared lockup service --- lib/core/service/SOAP_service.dart | 98 +---------------------- lib/core/service/base/lockup-service.dart | 98 +++++++++++++++++++++++ 2 files changed, 102 insertions(+), 94 deletions(-) create mode 100644 lib/core/service/base/lockup-service.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 88d44e5a..67fa380b 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -5,37 +5,17 @@ import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart' import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -class SOAPService extends BaseService { - List get listOfAllergies => _listOfAllergies; - List _listOfAllergies = []; - - List get allergySeverityList => _allergySeverityList; - List _allergySeverityList = []; - - List get historyFamilyList => _historyFamilyList; - List _historyFamilyList = []; - - List get historyMedicalList => _historyMedicalList; - List _historyMedicalList = []; - - List get historySportList => _historySportList; - List _historySportList = []; - - List get historySocialList => _historySocialList; - List _historySocialList = []; - - List get historySurgicalList => _historySurgicalList; - List _historySurgicalList = []; - +import 'base/lockup-service.dart'; +class SOAPService extends LockupService { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, onSuccess: (dynamic response, int statusCode) { - _listOfAllergies.clear(); + listOfAllergies.clear(); response['List_Allergies']['entityList'].forEach((v) { - _listOfAllergies.add(MasterKeyModel.fromJson(v)); + listOfAllergies.add(MasterKeyModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -46,20 +26,6 @@ class SOAPService extends BaseService { ); } - Future getMasterLookup(MasterKeysService masterKeys) async { - Map body = { - "MasterInput": masterKeys.getMasterKeyService() - }; - await baseAppClient.post(GET_MASTER_LOOKUP_LIST, - onSuccess: (dynamic response, int statusCode) { - setMasterLookupInCorrectArray( - response['MasterLookUpList']['entityList'], masterKeys); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); - } - Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { await baseAppClient.post(POST_ALLERGY, @@ -70,60 +36,4 @@ class SOAPService extends BaseService { super.error = error; }, body: postAllergyRequestModel.toJson()); } - - setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { - switch (masterKeys) { - case MasterKeysService.Allergies: - _listOfAllergies.clear(); - entryList.forEach((v) { - _listOfAllergies - .add(MasterKeyModel.fromJson(v)); - }); - break; - case MasterKeysService.HistoryFamily: - _historyFamilyList.clear(); - entryList.forEach((v) { - _historyFamilyList - .add(MasterKeyModel.fromJson(v)); - }); - break; - case MasterKeysService.HistoryMedical: - _historyMedicalList.clear(); - entryList.forEach((v) { - _historyMedicalList - .add(MasterKeyModel.fromJson(v)); - }); - break; - case MasterKeysService.HistorySocial: - historySocialList.clear(); - entryList.forEach((v) { - historySocialList - .add(MasterKeyModel.fromJson(v)); - }); - break; - case MasterKeysService.HistorySports: - _historySportList.clear(); - entryList.forEach((v) { - _historySportList - .add(MasterKeyModel.fromJson(v)); - }); break; - case MasterKeysService.HistorySurgical: - _historySurgicalList.clear(); - entryList.forEach((v) { - _historySurgicalList - .add(MasterKeyModel.fromJson(v)); - }); - break; - case MasterKeysService.PhysicalExamination: - return 59; - break; - case MasterKeysService.AllergySeverity: - _allergySeverityList.clear(); - entryList.forEach((v) { - _allergySeverityList - .add(MasterKeyModel.fromJson(v)); - }); - break; - } - } } diff --git a/lib/core/service/base/lockup-service.dart b/lib/core/service/base/lockup-service.dart new file mode 100644 index 00000000..2d52d3d9 --- /dev/null +++ b/lib/core/service/base/lockup-service.dart @@ -0,0 +1,98 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +import 'base_service.dart'; + +class LockupService extends BaseService { + + List listOfAllergies = []; + + List get allergySeverityList => _allergySeverityList; + List _allergySeverityList = []; + + List get historyFamilyList => _historyFamilyList; + List _historyFamilyList = []; + + List get historyMedicalList => _historyMedicalList; + List _historyMedicalList = []; + + List get historySportList => _historySportList; + List _historySportList = []; + + List get historySocialList => _historySocialList; + List _historySocialList = []; + + List get historySurgicalList => _historySurgicalList; + List _historySurgicalList = []; + + Future getMasterLookup(MasterKeysService masterKeys) async { + Map body = { + "MasterInput": masterKeys.getMasterKeyService() + }; + await baseAppClient.post(GET_MASTER_LOOKUP_LIST, + onSuccess: (dynamic response, int statusCode) { + setMasterLookupInCorrectArray( + response['MasterLookUpList']['entityList'], masterKeys); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { + switch (masterKeys) { + case MasterKeysService.Allergies: + listOfAllergies.clear(); + entryList.forEach((v) { + listOfAllergies + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.HistoryFamily: + _historyFamilyList.clear(); + entryList.forEach((v) { + _historyFamilyList + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.HistoryMedical: + _historyMedicalList.clear(); + entryList.forEach((v) { + _historyMedicalList + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.HistorySocial: + historySocialList.clear(); + entryList.forEach((v) { + historySocialList + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.HistorySports: + _historySportList.clear(); + entryList.forEach((v) { + _historySportList + .add(MasterKeyModel.fromJson(v)); + }); break; + case MasterKeysService.HistorySurgical: + _historySurgicalList.clear(); + entryList.forEach((v) { + _historySurgicalList + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.PhysicalExamination: + return 59; + break; + case MasterKeysService.AllergySeverity: + _allergySeverityList.clear(); + entryList.forEach((v) { + _allergySeverityList + .add(MasterKeyModel.fromJson(v)); + }); + break; + } + } +} \ No newline at end of file From 25063b95902b4b8d697fa8fe4c8c7e58a2ca1a93 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 23 Dec 2020 19:07:53 +0200 Subject: [PATCH 033/421] adding lookup service --- lib/core/service/SOAP_service.dart | 2 +- lib/core/service/base/lockup-service.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 67fa380b..739152ea 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'base/lockup-service.dart'; -class SOAPService extends LockupService { +class SOAPService extends LookupService { Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( diff --git a/lib/core/service/base/lockup-service.dart b/lib/core/service/base/lockup-service.dart index 2d52d3d9..1e46d13a 100644 --- a/lib/core/service/base/lockup-service.dart +++ b/lib/core/service/base/lockup-service.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'base_service.dart'; -class LockupService extends BaseService { +class LookupService extends BaseService { List listOfAllergies = []; From 8ffb37257310f1535adc466eaf544b9beba976b8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 23 Dec 2020 19:12:42 +0200 Subject: [PATCH 034/421] rename llokup file --- lib/core/service/SOAP_service.dart | 2 +- .../service/base/{lockup-service.dart => lookup-service.dart} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename lib/core/service/base/{lockup-service.dart => lookup-service.dart} (100%) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 739152ea..56645184 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart' import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'base/lockup-service.dart'; +import 'base/lookup-service.dart'; class SOAPService extends LookupService { diff --git a/lib/core/service/base/lockup-service.dart b/lib/core/service/base/lookup-service.dart similarity index 100% rename from lib/core/service/base/lockup-service.dart rename to lib/core/service/base/lookup-service.dart From 9b0731d5c83c0f70290f2831205a577e29d73fd6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 24 Dec 2020 13:14:39 +0200 Subject: [PATCH 035/421] check activation code --- lib/client/base_app_client.dart | 4 +- lib/config/config.dart | 5 ++ lib/config/shared_pref_kay.dart | 8 +++ lib/core/viewModel/auth_view_model.dart | 24 +++++++ .../check_activation_code_request_model.dart | 64 +++++++++++++++++++ lib/widgets/auth/verfiy_account.dart | 35 +++++++++- lib/widgets/auth/verification_methods.dart | 10 ++- 7 files changed, 144 insertions(+), 6 deletions(-) create mode 100644 lib/models/auth/check_activation_code_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 9d621755..6157aea8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -61,7 +61,9 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiZjcwMTUyYzktMjAwNy00Y2FjLTkzMWUtOGI0MDlhMWFkNjc4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1ODU1MzAiLCJDbGluaWNJZCI6IjE3Iiwicm9sZSI6IkRPQ1RPUlMiLCJuYmYiOjE2MDg1NTMxMDAsImV4cCI6MTYwOTQxNzEwMCwiaWF0IjoxNjA4NTUzMTAwfQ.lydDI-nsHlmb4Z4vesnckCU1i3hnNayoWVacc3E5_XM"; + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/config/config.dart b/lib/config/config.dart index 2db503fe..fd1fb33a 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -78,6 +78,11 @@ const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; + +const CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP = + 'Services/DoctorApplication.svc/REST/CheckActivationCodeForDoctorApp'; + + const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 18b58c28..c41859e6 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -1,5 +1,13 @@ final TOKEN = 'token'; final PROJECT_ID = 'projectID'; +final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID'; +final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID'; +final LOGIN_TOKEN_ID = 'LogInToken'; + + +// set VidaAuthTokenID +// VidaRefreshTokenID +// LogInTokenIDPROJECT_ID = 'projectID'; //===========amjad============ final DOCTOR_ID = 'doctorID'; //======================= diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index fc76fbc3..120642bf 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; +import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -158,6 +159,29 @@ class AuthViewModel with ChangeNotifier { } } + + Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { + try { + dynamic localRes; + await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + selectedClinicName = + ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; + + response['List_DoctorsClinic'].forEach((v) { + doctorsClinicList.add(new ClinicModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: checkActivationCodeRequestModel.toJson()); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } + /* *@author: Elham Rababah *@Date:17/5/2020 diff --git a/lib/models/auth/check_activation_code_request_model.dart b/lib/models/auth/check_activation_code_request_model.dart new file mode 100644 index 00000000..856f1c43 --- /dev/null +++ b/lib/models/auth/check_activation_code_request_model.dart @@ -0,0 +1,64 @@ +class CheckActivationCodeRequestModel { + String mobileNumber; + String zipCode; + int doctorID; + String iPAdress; + int channel; + int languageID; + int projectID; + double versionID; + String generalid; + String logInTokenID; + String activationCode; + String vidaAuthTokenID; + String vidaRefreshTokenID; + + CheckActivationCodeRequestModel( + {this.mobileNumber, + this.zipCode, + this.doctorID, + this.iPAdress, + this.channel, + this.languageID, + this.projectID, + this.versionID, + this.generalid, + this.logInTokenID, + this.activationCode, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); + + CheckActivationCodeRequestModel.fromJson(Map json) { + mobileNumber = json['MobileNumber']; + zipCode = json['ZipCode']; + doctorID = json['DoctorID']; + iPAdress = json['IPAdress']; + channel = json['Channel']; + languageID = json['LanguageID']; + projectID = json['ProjectID']; + versionID = json['VersionID']; + generalid = json['generalid']; + logInTokenID = json['LogInTokenID']; + activationCode = json['activationCode']; + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['MobileNumber'] = this.mobileNumber; + data['ZipCode'] = this.zipCode; + data['DoctorID'] = this.doctorID; + data['IPAdress'] = this.iPAdress; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['ProjectID'] = this.projectID; + data['VersionID'] = this.versionID; + data['generalid'] = this.generalid; + data['LogInTokenID'] = this.logInTokenID; + data['activationCode'] = this.activationCode; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + return data; + } +} diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 43e9e988..295a3feb 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -1,6 +1,7 @@ import 'dart:async'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; @@ -363,7 +364,37 @@ class _VerifyAccountState extends State { "IsSilentLogIN": false }; - authProv.memberCheckActivationCodeNew(model).then((res) async{ + // "MobileNumber": "0541696495", + // + // "ZipCode": "966", + // + // "DoctorID": 1485, + // "IPAdress": "10.10.10.10", + // + // "Channel": 9, + // + // "LanguageID": 2, + // + // "ProjectID": 15, + // + // "VersionID": 1.2, + // + // "generalid": "Cs2020@2016$2958", + // + // "LogInTokenID": "+C16+k1lMkOwG2Zynd0nDQ==", + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( + zipCode: _loggedUser['ZipCode'], + mobileNumber: _loggedUser['MobileNumber'], + projectID: await sharedPref.getInt(PROJECT_ID), + logInTokenID: await sharedPref.getInt(LOGIN_TOKEN_ID), + doctorID: 1485, + // TODO do it dynamic + activationCode: activationCode, + generalid: "Cs2020@2016\$2958" + ); + + authProv.checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp) + .then((res) async { if (res['MessageStatus'] == 1) { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { @@ -371,7 +402,7 @@ class _VerifyAccountState extends State { res['List_DoctorProfile'][0], changeLoadingStata); } else { ClinicModel clinic = - ClinicModel.fromJson(res['List_DoctorsClinic'][0]); + ClinicModel.fromJson(res['List_DoctorsClinic'][0]); getDocProfiles(clinic, changeLoadingStata); } } else { diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index cb6cb62e..6959d45a 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -267,17 +267,18 @@ class _VerificationMethodsState extends State { *@return: *@desc: send Activation Code By Otp Notification Type */ - sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) { + sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) async { // TODO : build enum for verfication method if (oTPSendType == 1 || oTPSendType == 2) { widget.changeLoadingStata(true); - + int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( - facilityId: 15, + facilityId: projectID, generalid: "Cs2020@2016\$2958", memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], + password: widget.password); Map model = { @@ -292,6 +293,9 @@ class _VerificationMethodsState extends State { widget.changeLoadingStata(false); if (res['MessageStatus'] == 1) { + sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); + sharedPref.setString(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); + sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, arguments: {'model': model}); } else { From bb651478a06bb088760af22bb9c99ad65df38ea2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 26 Dec 2020 20:05:30 +0200 Subject: [PATCH 036/421] Finish subjective --- lib/client/base_app_client.dart | 25 +- lib/config/config.dart | 2 + lib/config/localized_values.dart | 7 +- lib/core/service/SOAP_service.dart | 32 ++- lib/core/service/base/lookup-service.dart | 1 + lib/core/viewModel/SOAP_view_model.dart | 22 ++ .../post_chief_complaint_request_model.dart | 48 ++++ .../SOAP/post_histories_request_model.dart | 64 +++++ lib/util/translations_delegate_base.dart | 1 + .../SOAP/subjective/subjective_page.dart | 246 +++++++++++------- lib/widgets/shared/TextFields.dart | 2 +- lib/widgets/shared/app_buttons_widget.dart | 98 ++++--- 12 files changed, 407 insertions(+), 141 deletions(-) create mode 100644 lib/models/SOAP/post_chief_complaint_request_model.dart create mode 100644 lib/models/SOAP/post_histories_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 9d621755..d9abcd5e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -61,7 +61,8 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.e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gUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4ODE0MDcyLCJleHAiOjE2MDk2NzgwNzIsImlhdCI6MTYwODgxNDA3Mn0.u23f3ifrNMQrK0ReTZWs9olaZCEYuf06ZZZJsBWJ5LI"; print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -78,25 +79,27 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (!parsed['IsAuthenticated']) { - await helpers.logout(); - - helpers.showErrorToast('Your session expired Please login agian'); - } else - if (parsed['MessageStatus'] == 1) { + // if (!parsed['IsAuthenticated']) { + // await helpers.logout(); + // + // helpers.showErrorToast('Your session expired Please login agian'); + // } else + if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { + error = + parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - error =''; for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n"; + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { + error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n"; } } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 783cf811..a79daa45 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -86,6 +86,8 @@ const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; +const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e205bb4e..ffd3c822 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -280,7 +280,10 @@ const Map> localizedValues = { 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, "empty-message": { - "en": "Please enter message", - "ar": "يرجى ادخال الموضوع" + "en": "Please enter Value", + "ar": "يرجى ادخال القيمه" + },"chiefComplaintLength": { + "en": "Chief Complaint length should be greater than 25", + "ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25" }, }; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 56645184..1a8c91a1 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,14 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'base/lookup-service.dart'; class SOAPService extends LookupService { - Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -27,13 +26,38 @@ class SOAPService extends LookupService { } Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { + hasError = false; await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); + print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: postAllergyRequestModel.toJson()); } + + Future postHistories( + PostHistoriesRequestModel postHistoriesRequestModel) async { + hasError = false; + await baseAppClient.post(POST_HISTORY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postHistoriesRequestModel.toJson()); + } + + Future postChiefComplaint( + PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + hasError = false; + await baseAppClient.post(POST_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postChiefComplaintRequestModel.toJson()); + } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 1e46d13a..18353c82 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -27,6 +27,7 @@ class LookupService extends BaseService { List _historySurgicalList = []; Future getMasterLookup(MasterKeysService masterKeys) async { + hasError = false; Map body = { "MasterInput": masterKeys.getMasterKeyService() }; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 608b2e3d..5131e086 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -60,5 +62,25 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postHistories(postHistoriesRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart new file mode 100644 index 00000000..bedf2978 --- /dev/null +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -0,0 +1,48 @@ +class PostChiefComplaintRequestModel { + int appointmentNo; + int episodeID; + int patientMRN; + String chiefComplaint; + String hopi; + String currentMedication; + bool ispregnant; + bool isLactation; + int numberOfWeeks; + + PostChiefComplaintRequestModel( + {this.appointmentNo, + this.episodeID, + this.patientMRN, + this.chiefComplaint, + this.hopi, + this.currentMedication, + this.ispregnant, + this.isLactation, + this.numberOfWeeks}); + + PostChiefComplaintRequestModel.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + patientMRN = json['PatientMRN']; + chiefComplaint = json['chiefComplaint']; + hopi = json['Hopi']; + currentMedication = json['CurrentMedication']; + ispregnant = json['ispregnant']; + isLactation = json['isLactation']; + numberOfWeeks = json['numberOfWeeks']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['PatientMRN'] = this.patientMRN; + data['chiefComplaint'] = this.chiefComplaint; + data['Hopi'] = this.hopi; + data['CurrentMedication'] = this.currentMedication; + data['ispregnant'] = this.ispregnant; + data['isLactation'] = this.isLactation; + data['numberOfWeeks'] = this.numberOfWeeks; + return data; + } +} diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart new file mode 100644 index 00000000..baa428fd --- /dev/null +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -0,0 +1,64 @@ +class PostHistoriesRequestModel { + List listMedicalHistoryVM; + + PostHistoriesRequestModel({this.listMedicalHistoryVM}); + + PostHistoriesRequestModel.fromJson(Map json) { + if (json['listMedicalHistoryVM'] != null) { + listMedicalHistoryVM = new List(); + json['listMedicalHistoryVM'].forEach((v) { + listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listMedicalHistoryVM != null) { + data['listMedicalHistoryVM'] = + this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListMedicalHistoryVM { + int patientMRN; + int historyType; + int historyId; + int episodeId; + int appointmentNo; + bool isChecked; + String remarks; + + ListMedicalHistoryVM( + {this.patientMRN, + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); + + ListMedicalHistoryVM.fromJson(Map json) { + patientMRN = json['patientMRN']; + historyType = json['historyType']; + historyId = json['historyId']; + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + isChecked = json['isChecked']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['historyType'] = this.historyType; + data['historyId'] = this.historyId; + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['isChecked'] = this.isChecked; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7292492d..3f483480 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -300,6 +300,7 @@ class TranslationBase { String get next => localizedValues['next'][locale.languageCode]; String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index a78f6d0b..ae024b10 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; @@ -34,9 +36,9 @@ class _SubjectivePageState extends State { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; - List myHistoryList = List(); TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); + final formKey = GlobalKey(); @override Widget build(BuildContext context) { @@ -83,56 +85,64 @@ class _SubjectivePageState extends State { isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) ], ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Chief Complaints", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: complaintsController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "History of Present Illness", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: illnessController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - AddMedication(), - ]), + bodyWidget: Form( + key: formKey, + child: Column(children: [ + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Chief Complaints", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: complaintsController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else if (value.length < 25) + return TranslationBase + .of(context) + .chiefComplaintLength; + //""; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "History of Present Illness", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: illnessController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + AddMedication(), + ]), + ), isExpand: isChiefExpand, ), @@ -177,7 +187,7 @@ class _SubjectivePageState extends State { ), bodyWidget: Column( children: [ - AddHistoryWidget(myHistoryList: myHistoryList) + AddHistoryWidget(myHistoryList: widget.myHistoryList) ], ), isExpand: isHistoryExpand, @@ -243,58 +253,118 @@ class _SubjectivePageState extends State { SizedBox( height: 30, ), - AppButton( - title: TranslationBase - .of(context) - .next, - - onPressed: () async { - addSubjectiveInfo(model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: myHistoryList); - - }, - ), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, + myAllergiesList: widget.myAllergiesList, + myHistoryList: widget.myHistoryList); + }, + ), ], ), ), ), - ),),); + ), + ), + ); } addSubjectiveInfo( - {SOAPViewModel model, List myAllergiesList, List< - MasterKeyModel> myHistoryList }) async { - PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + {SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { + await postChiefComplaint(model: model); + if (myHistoryList.length != 0) + await postHistories(model: model, myHistoryList: myHistoryList); + if (myAllergiesList.length != 0) + await postAllergy(myAllergiesList: myAllergiesList, model: model); + + widget.changePageViewIndex(1); + } + + postAllergy( + {List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = + new PostAllergyRequestModel(); widget.myAllergiesList.forEach((allergy) { - if(postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == + null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: 2500477, - episodeId: 200011502, - appointmentNo: 2016053271, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 1485, - createdOn: "2020-08-14T20:37:22.780Z", - editedBy: 1485, - editedOn: "2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false - )); + //TODO: make static value dynamic + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM + .add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: 1485, + // + createdOn: "2020-08-14T20:37:22.780Z", + editedBy: 1485, + editedOn: "2020-08-14T20:37:22.780Z", + isChecked: false, + isUpdatedByNurse: false)); }); await model.postAllergy(postAllergyRequestModel); - if(model.state == ViewState.ErrorLocal) { + if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } - widget.changePageViewIndex(1); + } - print(postAllergyRequestModel); + postHistories( + {List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = + new PostHistoriesRequestModel(); + widget.myHistoryList.forEach((history) { + if (postHistoriesRequestModel.listMedicalHistoryVM == null) + postHistoriesRequestModel.listMedicalHistoryVM = []; + //TODO: make static value dynamic + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + remarks: "", + historyId: history.id, + historyType: history.typeId, + isChecked: false, + )); + }); + await model.postHistories(postHistoriesRequestModel); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } } + postChiefComplaint({SOAPViewModel model}) async { + formKey.currentState.save(); + if(formKey.currentState.validate()){ + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + //TODO: make static value dynamic + new PostChiefComplaintRequestModel( + patientMRN: 3120690, + episodeID: 200012117, + appointmentNo: 2016054573, + chiefComplaint: complaintsController.text, + currentMedication: "currentMedication", + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + numberOfWeeks: 22); + + await model.postChiefComplaint(postChiefComplaintRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } + } + + } } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index e41b4379..fec58e89 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -157,7 +157,7 @@ class _TextFieldsState extends State { : Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]), - errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), + errorStyle: TextStyle(fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index d01fe5af..85b0483d 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -14,50 +14,78 @@ class AppButton extends StatefulWidget { final Color color; final double fontSize; final double padding; + final bool loading; + final bool disabled; - AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2, this.padding = 13}); + AppButton( + {@required this.onPressed, + this.title, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.loading = false, + this.disabled = false}); _AppButtonState createState() => _AppButtonState(); - } class _AppButtonState extends State{ @override Widget build(BuildContext context) { - return - RawMaterialButton( - fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Icon( - widget.icon, - color: Colors.white, - ), - if (widget.icon != null) - SizedBox( - width: 5.0, - ), - AppText( - widget.title.toUpperCase(), - color: Colors.white, - fontSize: SizeConfig.textMultiplier * widget.fontSize , - ), - ], + return + IgnorePointer( + ignoring: widget.loading, + child: RawMaterialButton( + fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Icon( + widget.icon, + color: Colors.white, + ), + if (widget.icon != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: + AlwaysStoppedAnimation( + Colors.grey[300], + ), + ), + ), + ) + : AppText( + widget.title.toUpperCase(), + color: Colors.white, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + ), + ], + ), ), + onPressed: widget.onPressed, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), ), - onPressed: widget.onPressed, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))), - ); + ); } } \ No newline at end of file From e96d38454c9c78db18c1e1a054eb406e0725fd40 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 26 Dec 2020 20:53:27 +0200 Subject: [PATCH 037/421] First step from examination --- lib/core/service/base/lookup-service.dart | 10 +- lib/core/viewModel/SOAP_view_model.dart | 1 + .../patients/profile/SOAP/add_SOAP_index.dart | 3 +- .../patients/profile/SOAP/objective_page.dart | 624 +++++++++--------- 4 files changed, 317 insertions(+), 321 deletions(-) diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 18353c82..11623880 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -26,6 +26,10 @@ class LookupService extends BaseService { List get historySurgicalList => _historySurgicalList; List _historySurgicalList = []; + + List get physicalExaminationList => _physicalExaminationList; + List _physicalExaminationList = []; + Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; Map body = { @@ -85,7 +89,11 @@ class LookupService extends BaseService { }); break; case MasterKeysService.PhysicalExamination: - return 59; + _physicalExaminationList.clear(); + entryList.forEach((v) { + _physicalExaminationList + .add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.AllergySeverity: _allergySeverityList.clear(); diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 5131e086..3ff33389 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -29,6 +29,7 @@ class SOAPViewModel extends BaseViewModel { List get historySocialList => _SOAPService.historySocialList; List get historySurgicalList => _SOAPService.historySurgicalList; List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList]; + List get physicalExaminationList => _SOAPService.physicalExaminationList; diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 9d75b22c..4e8c0873 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -30,6 +30,7 @@ class _AddSOAPIndexState extends State int _currentIndex = 0; List myAllergiesList= List(); List myHistoryList = List(); + List myExaminationList = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -153,7 +154,7 @@ class _AddSOAPIndexState extends State scrollDirection: Axis.horizontal, children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,), + ObjectivePage(changePageViewIndex: changePageViewIndex,myExaminationList:myExaminationList), AssessmentPage(changePageViewIndex: changePageViewIndex,), PlanPage(changePageViewIndex: changePageViewIndex,) ], diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index b2cd920f..c3e8d5db 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -1,4 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; @@ -7,15 +12,16 @@ 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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; + final List myExaminationList; - ObjectivePage({Key key, this.changePageViewIndex}); + ObjectivePage({Key key, this.changePageViewIndex, this.myExaminationList}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -117,115 +123,136 @@ class _ObjectivePageState extends State { SizedBox( height: 20, ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Abdomen'.toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ + Column( + children: widget.myExaminationList.map((examination) { + return Container( + margin: EdgeInsets.only( + left: 15, right: 15, top: 15), + child: Column(children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - Colors.white,Colors.grey - ), - child: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - "Normal", - style: TextStyle( - fontSize: 12, - color: - Colors.black, //Colors.black, - fontWeight: FontWeight.bold, + Texts(examination.nameEn.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + Colors.white, + Colors.grey), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Normal", + style: TextStyle( + fontSize: 12, + color: + Colors.black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), ), - ), - ), - )), + )), + ), + onTap: () {}), + SizedBox( + width: 12, ), - onTap: () { - - }), - SizedBox(width: 12,), - InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - Color(0xFF515A5D), Colors.black - ), - child: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - "Abnormal", - style: TextStyle( - fontSize: 12, - color: - Colors.white, //Colors.black, - fontWeight: FontWeight.bold, + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + Color(0xFF515A5D), + Colors.black), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Abnormal", + style: TextStyle( + fontSize: 12, + color: + Colors.white, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), ), - ), - ), - )), - ), - onTap: () { - - }), + )), + ), + onTap: () {}), + ], + ), + InkWell( + + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: ()=>removeExamination(examination), + ) ], ), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarksController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - ], - ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarksController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + ])); + }).toList(), ) ], ) @@ -249,10 +276,23 @@ class _ObjectivePageState extends State { )); } + removeExamination(MasterKeyModel masterKey) { + Iterable history = widget.myExaminationList.where( + (element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + + if (history.length > 0) + setState(() { + widget.myExaminationList.remove(history.first); + }); + } + openExaminationList(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -275,228 +315,174 @@ class _ObjectivePageState extends State { ); } - ; showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Examinations", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( + return AddExaminationDailog( + myExaminationList: widget.myExaminationList, + addSelectedExamination: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeExamination: (masterKey) => removeExamination(masterKey),); + }); + } +} + +class AddExaminationDailog extends StatefulWidget { + final List myExaminationList; + final Function addSelectedExamination; + final Function (MasterKeyModel) removeExamination; + + const AddExaminationDailog( + {Key key, this.myExaminationList, this.addSelectedExamination, this.removeExamination}) + : super(key: key); + + @override + _AddExaminationDailogState createState() => _AddExaminationDailogState(); +} + +class _AddExaminationDailogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup( + MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => + AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + AppText( + "Examinations", + fontWeight: FontWeight.bold, + fontSize: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery + .of(context) + .size + .height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius + .circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model + .physicalExaminationList + .map((examinationInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + examinationInfo), + activeColor: + Colors.red[800], + onChanged: + ( + bool newValue) { + setState(() { + if (isServiceSelected( + examinationInfo + )) { + widget + .removeExamination( + examinationInfo + ); + } + else { + widget + .myExaminationList + .add( + examinationInfo); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + examinationInfo + .nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 10, ), - DividerWithSpacesAround(), - ], - ), - ], - ), - )), - ), - SizedBox( - height: 10, - ), - AppButton( - title: "Add SELECTED Examinations".toUpperCase(), - onPressed: () {}, - ), - ]), - )), - ); - }); + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED Examinations" + .toUpperCase(), + onPressed: () { + widget.addSelectedExamination(); + }, + ), + ]), + ))), + )), + ); } -} + isServiceSelected(MasterKeyModel masterKey) { + Iterable history = + widget + .myExaminationList + .where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + if (history.length > 0) { + return true; + } + return false; + } +} From 9a614b25b5dd6b3866abf79cfa18c1ab40769bba Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 12:18:01 +0200 Subject: [PATCH 038/421] Finish the login --- lib/widgets/auth/verfiy_account.dart | 2 +- lib/widgets/auth/verification_methods.dart | 29 ++-------------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 295a3feb..56c2ba09 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -386,7 +386,7 @@ class _VerifyAccountState extends State { zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], projectID: await sharedPref.getInt(PROJECT_ID), - logInTokenID: await sharedPref.getInt(LOGIN_TOKEN_ID), + logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), doctorID: 1485, // TODO do it dynamic activationCode: activationCode, diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 6959d45a..32c541a3 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -293,6 +293,7 @@ class _VerificationMethodsState extends State { widget.changeLoadingStata(false); if (res['MessageStatus'] == 1) { + print("VerificationCode : "+ res["VerificationCode"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); @@ -311,33 +312,7 @@ class _VerificationMethodsState extends State { }); } catch (e) {} - // Map model = { - // "LogInTokenID": _loggedUser['LogInTokenID'], - // "Channel": 9, - // "MobileNumber": _loggedUser['MobileNumber'], - // "IPAdress": "11.11.11.11", - // "LanguageID": 2, - // "ProjectID": 15, //TODO : this should become daynamci - // "ZipCode": _loggedUser['ZipCode'], - // "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], - // "OTP_SendType": oTPSendType - // }; - // authProv.sendActivationCodeByOtpNotificationType(model).then((res) { - // widget.changeLoadingStata(false); - // - // if (res['MessageStatus'] == 1) { - // Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, - // arguments: {'model': model}); - // } else { - // print(res['ErrorEndUserMessage']); - // helpers.showErrorToast(res['ErrorEndUserMessage']); - // } - // }).catchError((err) { - // print('$err'); - // widget.changeLoadingStata(false); - // - // helpers.showErrorToast(); - // }); + } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) { From 2658694b70c2109b9a17955397ad260596e6b58a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 12:22:17 +0200 Subject: [PATCH 039/421] remove static value --- lib/widgets/auth/verfiy_account.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 56c2ba09..35332198 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -387,8 +387,6 @@ class _VerifyAccountState extends State { mobileNumber: _loggedUser['MobileNumber'], projectID: await sharedPref.getInt(PROJECT_ID), logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), - doctorID: 1485, - // TODO do it dynamic activationCode: activationCode, generalid: "Cs2020@2016\$2958" ); From abbe89167306642693e8c97f830fb66e13f7412d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 12:26:02 +0200 Subject: [PATCH 040/421] improve code quality --- lib/config/shared_pref_kay.dart | 7 ------- lib/widgets/auth/login_form.dart | 7 ------- lib/widgets/auth/verfiy_account.dart | 19 ------------------- 3 files changed, 33 deletions(-) diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index c41859e6..7fd0eba2 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -3,14 +3,7 @@ final PROJECT_ID = 'projectID'; final VIDA_AUTH_TOKEN_ID = 'VidaAuthTokenID'; final VIDA_REFRESH_TOKEN_ID = 'VidaRefreshTokenID'; final LOGIN_TOKEN_ID = 'LogInToken'; - - -// set VidaAuthTokenID -// VidaRefreshTokenID -// LogInTokenIDPROJECT_ID = 'projectID'; -//===========amjad============ final DOCTOR_ID = 'doctorID'; -//======================= final SLECTED_PATIENT_TYPE = 'slectedPatientType'; final APP_Language = 'language'; final DOCTOR_PROFILE = 'doctorProfile'; diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index d7eaeeb6..808b1763 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -225,10 +225,6 @@ class _LoginFormState extends State { login(context, AuthViewModel authProv, Function changeLoadingStata) { FocusScopeNode currentFocus = FocusScope.of(context); - - // if (!currentFocus.hasPrimaryFocus) { - // currentFocus.unfocus(); - // } changeLoadingStata(true); if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); @@ -242,13 +238,10 @@ class _LoginFormState extends State { sharedPref.setString(TOKEN, res['LogInTokenID']); print("token" + res['LogInTokenID']); Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); - // Navigator.of(context).pushReplacementNamed(VERIFICATION_METHODS); } else { // handel error - // widget.showCenterShortLoadingToast("watting"); helpers.showErrorToast(res['ErrorEndUserMessage']); } - // Navigator.of(context).pushNamed(HOME); }).catchError((err) { print('$err'); changeLoadingStata(false); diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 35332198..e72e1317 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -363,25 +363,6 @@ class _VerifyAccountState extends State { "IsLoginForDoctorApp": true, "IsSilentLogIN": false }; - - // "MobileNumber": "0541696495", - // - // "ZipCode": "966", - // - // "DoctorID": 1485, - // "IPAdress": "10.10.10.10", - // - // "Channel": 9, - // - // "LanguageID": 2, - // - // "ProjectID": 15, - // - // "VersionID": 1.2, - // - // "generalid": "Cs2020@2016$2958", - // - // "LogInTokenID": "+C16+k1lMkOwG2Zynd0nDQ==", CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], From f6ddf7a9eb44e574e8a53c5f07df540e7589e560 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 27 Dec 2020 13:58:21 +0200 Subject: [PATCH 041/421] make logout button close all screen stack and push to login --- lib/util/helpers.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 41c0b4f7..0c3f1b5f 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -348,6 +348,7 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + // Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } } From 4560706d552160d5a26e469202d5630574ab614c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 15:46:29 +0200 Subject: [PATCH 042/421] improve code inside my eam --- lib/client/base_app_client.dart | 11 ++- lib/models/SOAP/my_selected_examination.dart | 33 +++++++ .../post_physical_exam_request_model.dart | 99 +++++++++++++++++++ .../patients/profile/SOAP/add_SOAP_index.dart | 5 +- .../patients/profile/SOAP/objective_page.dart | 50 ++++++---- 5 files changed, 172 insertions(+), 26 deletions(-) create mode 100644 lib/models/SOAP/my_selected_examination.dart create mode 100644 lib/models/SOAP/post_physical_exam_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index d9abcd5e..043753b2 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -79,11 +79,12 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - // if (!parsed['IsAuthenticated']) { - // await helpers.logout(); - // - // helpers.showErrorToast('Your session expired Please login agian'); - // } else + if (!parsed['IsAuthenticated']) { + // TODO: return it back when IsAuthenticated work fine in all service + // await helpers.logout(); + + helpers.showErrorToast('Your session expired Please login agian'); + } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart new file mode 100644 index 00000000..3b6685c8 --- /dev/null +++ b/lib/models/SOAP/my_selected_examination.dart @@ -0,0 +1,33 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedExamination { + MasterKeyModel selectedExamination; + String remark; + bool isNormal; + bool isAbnormal; + + MySelectedExamination( + {this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false}); + + MySelectedExamination.fromJson(Map json) { + + selectedExamination = json['selectedExamination'] != null + ? new MasterKeyModel.fromJson(json['selectedExamination']) + : null; + remark = json['remark']; + remark = json['isNormal']; + remark = json['isAbnormal']; + } + + Map toJson() { + final Map data = new Map(); + + if (this.selectedExamination != null) { + data['selectedExamination'] = this.selectedExamination.toJson(); + } + data['remark'] = this.remark; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + return data; + } +} diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart new file mode 100644 index 00000000..f9f23897 --- /dev/null +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -0,0 +1,99 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class PostPhysicalExamRequestModel { + List listHisProgNotePhysicalVM; + + PostPhysicalExamRequestModel({this.listHisProgNotePhysicalVM}); + + PostPhysicalExamRequestModel.fromJson(Map json) { + if (json['listHisProgNotePhysicalVM'] != null) { + listHisProgNotePhysicalVM = new List(); + json['listHisProgNotePhysicalVM'].forEach((v) { + listHisProgNotePhysicalVM + .add(new ListHisProgNotePhysicalVM.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listHisProgNotePhysicalVM != null) { + data['listHisProgNotePhysicalVM'] = + this.listHisProgNotePhysicalVM.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListHisProgNotePhysicalVM { + int episodeId; + int appointmentNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + String remarks; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool notExamined; + MasterKeyModel masterDescription; + + ListHisProgNotePhysicalVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.notExamined, + this.masterDescription}); + + ListHisProgNotePhysicalVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + remarks = json['remarks']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + notExamined = json['notExamined']; + masterDescription = json['masterDescription'] != null + ? new MasterKeyModel.fromJson(json['masterDescription']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['remarks'] = this.remarks; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['notExamined'] = this.notExamined; + if (this.masterDescription != null) { + data['masterDescription'] = this.masterDescription.toJson(); + } + return data; + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 4e8c0873..705bc85f 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; @@ -30,7 +31,7 @@ class _AddSOAPIndexState extends State int _currentIndex = 0; List myAllergiesList= List(); List myHistoryList = List(); - List myExaminationList = List(); + List mySelectedExamination = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -154,7 +155,7 @@ class _AddSOAPIndexState extends State scrollDirection: Axis.horizontal, children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,myExaminationList:myExaminationList), + ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), AssessmentPage(changePageViewIndex: changePageViewIndex,), PlanPage(changePageViewIndex: changePageViewIndex,) ], diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index c3e8d5db..a1b91864 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -19,9 +20,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; - final List myExaminationList; + final List mySelectedExamination; - ObjectivePage({Key key, this.changePageViewIndex, this.myExaminationList}); + ObjectivePage( + {Key key, this.changePageViewIndex, this.mySelectedExamination}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -29,7 +31,6 @@ class ObjectivePage extends StatefulWidget { class _ObjectivePageState extends State { bool isSysExaminationExpand = false; - List examinationsList; TextEditingController remarksController = TextEditingController(); BoxDecoration containerBorderDecoration( @@ -124,7 +125,8 @@ class _ObjectivePageState extends State { height: 20, ), Column( - children: widget.myExaminationList.map((examination) { + children: + widget.mySelectedExamination.map((examination) { return Container( margin: EdgeInsets.only( left: 15, right: 15, top: 15), @@ -133,7 +135,10 @@ class _ObjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(examination.nameEn.toUpperCase(), + Texts( + examination + .selectedExamination.nameEn + .toUpperCase(), variant: "bodyText", bold: true, color: Colors.black) @@ -216,13 +221,14 @@ class _ObjectivePageState extends State { ], ), InkWell( - + child: Icon( FontAwesomeIcons.trash, color: Colors.grey, size: 20, ), - onTap: ()=>removeExamination(examination), + onTap: () => removeExamination( + examination.selectedExamination), ) ], ), @@ -277,13 +283,15 @@ class _ObjectivePageState extends State { } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.myExaminationList.where( + Iterable history = widget.mySelectedExamination + .where( (element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) setState(() { - widget.myExaminationList.remove(history.first); + widget.mySelectedExamination.remove(history.first); }); } @@ -321,7 +329,7 @@ class _ObjectivePageState extends State { context: context, builder: (context) { return AddExaminationDailog( - myExaminationList: widget.myExaminationList, + mySelectedExamination: widget.mySelectedExamination, addSelectedExamination: () { setState(() { Navigator.of(context).pop(); @@ -333,12 +341,12 @@ class _ObjectivePageState extends State { } class AddExaminationDailog extends StatefulWidget { - final List myExaminationList; + final List mySelectedExamination; final Function addSelectedExamination; final Function (MasterKeyModel) removeExamination; const AddExaminationDailog( - {Key key, this.myExaminationList, this.addSelectedExamination, this.removeExamination}) + {Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) : super(key: key); @override @@ -422,10 +430,13 @@ class _AddExaminationDailogState extends State { ); } else { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: examinationInfo + ); widget - .myExaminationList + .mySelectedExamination .add( - examinationInfo); + mySelectedExamination); } }); }), @@ -475,12 +486,13 @@ class _AddExaminationDailogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = + Iterable exam = widget - .myExaminationList + .mySelectedExamination .where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); - if (history.length > 0) { + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + if (exam.length > 0) { return true; } return false; From 26a25f44e09a41c7cf73a98f25018e1064a8866c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 10:42:24 +0200 Subject: [PATCH 043/421] fix error null thing --- lib/client/base_app_client.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 7aeeba29..2fda496a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -93,8 +93,9 @@ class BaseAppClient { parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { - error = - parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + // TODO : return it back after check the StatusMessage it not null + // error = + // parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { From 749e870ea2ed937efbdbcabda36fc2afb0dacc0a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 28 Dec 2020 10:47:29 +0200 Subject: [PATCH 044/421] get procedures get prescription --- lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 9 + lib/config/localized_values.dart | 20 +- .../model/post_prescrition_req_model.dart | 106 +++++ lib/core/model/prescription_model.dart | 157 +++++++ lib/core/model/prescription_req_model.dart | 18 + .../model/procedure/get_procedure_model.dart | 89 ++++ .../procedure/get_procedure_req_model.dart | 40 ++ .../procedure/post_procedure_req_model.dart | 87 ++++ lib/core/service/prescription_service.dart | 45 ++ lib/core/service/procedure_service.dart | 48 ++ .../viewModel/prescription_view_model.dart | 38 ++ lib/core/viewModel/procedure_View_model.dart | 23 + lib/landing_page.dart | 4 +- lib/locator.dart | 8 + ...list_doctor_working_hours_table_model.dart | 12 +- lib/routes.dart | 7 + .../patients/patient_search_screen.dart | 2 +- .../prescription/add_prescription_form.dart | 212 +++++++++ .../prescription_authorazation_form.dart | 0 .../prescription/prescription_screen.dart | 405 ++++++++++++++++ .../prescription/prescription_warnings.dart | 168 +++++++ lib/screens/procedures/procedure_screen.dart | 440 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 30 +- lib/widgets/doctor/my_schedule_widget.dart | 86 ++-- .../profile/profile_medical_info_widget.dart | 28 +- lib/widgets/shared/TextFields.dart | 302 ++++++++---- lib/widgets/shared/app_buttons_widget.dart | 37 +- lib/widgets/shared/app_text_form_field.dart | 87 ++-- lib/widgets/shared/app_texts_widget.dart | 39 +- 30 files changed, 2307 insertions(+), 242 deletions(-) create mode 100644 lib/core/model/post_prescrition_req_model.dart create mode 100644 lib/core/model/prescription_model.dart create mode 100644 lib/core/model/prescription_req_model.dart create mode 100644 lib/core/model/procedure/get_procedure_model.dart create mode 100644 lib/core/model/procedure/get_procedure_req_model.dart create mode 100644 lib/core/model/procedure/post_procedure_req_model.dart create mode 100644 lib/core/service/prescription_service.dart create mode 100644 lib/core/service/procedure_service.dart create mode 100644 lib/core/viewModel/prescription_view_model.dart create mode 100644 lib/core/viewModel/procedure_View_model.dart create mode 100644 lib/screens/prescription/add_prescription_form.dart create mode 100644 lib/screens/prescription/prescription_authorazation_form.dart create mode 100644 lib/screens/prescription/prescription_screen.dart create mode 100644 lib/screens/prescription/prescription_warnings.dart create mode 100644 lib/screens/procedures/procedure_screen.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 454f4d04..d540a4ee 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -30,7 +30,7 @@ Helpers helpers = new Helpers(); * */ class BaseAppClient { //TODO change the post fun to nun static when you change all service - post( + post( String endPoint, { Map body, Function(dynamic response, int statusCode) onSuccess, diff --git a/lib/config/config.dart b/lib/config/config.dart index 8af0a4a5..226da593 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -77,6 +77,13 @@ const GET_DOC_PROFILES = 'Services/Doctors.svc/REST/GetDocProfiles'; const TRANSFERT_TO_ADMIN = 'LiveCareApi/DoctorApp/TransferToAdmin'; const END_CALL = 'LiveCareApi/DoctorApp/EndCall'; const END_CALL_WITH_CHARGE = 'LiveCareApi/DoctorApp/CompleteCallWithCharge'; +const GET_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/GetPrescription'; + +const POST_PRESCRIPTION_LIST = + 'Services/DoctorApplication.svc/REST/PostPrescription'; +const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; var selectedPatientType = 1; @@ -131,6 +138,8 @@ const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; const PATIENT_OUT_SA = false; +const VIDA_AUTH = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiMmI5ZTZlYmYtZmYzMC00ZmEyLTgwYjUtZGJlODM2MmZlNmNhIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1NzU3MTYiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwNzk3Mjk1MCwiZXhwIjoxNjA4ODM2OTUwLCJpYXQiOjE2MDc5NzI5NTB9.nHDltbMuIA3o4Gqa7mQ88fowDy6Oey9fG1zF45dumec'; /// Timer Info const TIMER_MIN = 10; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d766a5d2..c42d0c06 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -255,17 +255,13 @@ const Map> localizedValues = { 'ar': 'لا يوجد اي نتائج' }, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' }, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '}, - 'replySuccessfully': { - 'en': 'Reply Successfully', - 'ar': 'تم الرد بنجاح' - }, + 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, @@ -274,5 +270,17 @@ const Map> localizedValues = { 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, - 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, + 'noPrescriptionListed': { + 'en': 'NO PRESCRIPTION LISTED', + 'ar': 'لم يتم سرد أي وصف' + }, + 'addNow': {'en': 'ADD Now', 'ar': 'اضف الآن'}, + 'orderType': {'en': 'Order Type', 'ar': 'نوع الطلب'}, + 'strength': {'en': 'Strength', 'ar': 'شدة'}, + 'doseTime': {'en': 'Dose Time', 'ar': 'وقت الجرعة'}, + 'indication': {'en': 'Indication', 'ar': 'دواعي الاستخدام'}, + 'duration': {'en': 'Duration', 'ar': 'المدة الزمنية'}, + 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, + 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, + 'route': {'en': 'Route', 'ar': 'المسار'}, }; diff --git a/lib/core/model/post_prescrition_req_model.dart b/lib/core/model/post_prescrition_req_model.dart new file mode 100644 index 00000000..892854aa --- /dev/null +++ b/lib/core/model/post_prescrition_req_model.dart @@ -0,0 +1,106 @@ +class PostPrescriptionReqModel { + String vidaAuthTokenID; + int clinicID; + int episodeID; + int appointmentNo; + int patientMRN; + List prescriptionRequestModel; + + PostPrescriptionReqModel( + {this.vidaAuthTokenID = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiYTYxZjAyZjItNzUwZS00MTZkLWEzOTQtZTRjZmViZGVjMDE5IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUzNTIiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODUzMDAyNywiZXhwIjoxNjA5Mzk0MDI3LCJpYXQiOjE2MDg1MzAwMjd9.M1NTREPgz5vQH_GTZ_KGb0xQW5HEDs47AtNR3jbqnms", + this.clinicID = 1, + this.episodeID = 200012117, + this.appointmentNo = 2016054573, + this.patientMRN = 3120690, + this.prescriptionRequestModel}); + + PostPrescriptionReqModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + clinicID = json['ClinicID']; + episodeID = json['EpisodeID']; + appointmentNo = json['AppointmentNo']; + patientMRN = json['PatientMRN']; + if (json['prescriptionRequestModel'] != null) { + prescriptionRequestModel = new List(); + json['prescriptionRequestModel'].forEach((v) { + prescriptionRequestModel.add(new PrescriptionRequestModel.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['ClinicID'] = this.clinicID; + data['EpisodeID'] = this.episodeID; + data['AppointmentNo'] = this.appointmentNo; + data['PatientMRN'] = this.patientMRN; + if (this.prescriptionRequestModel != null) { + data['prescriptionRequestModel'] = + this.prescriptionRequestModel.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class PrescriptionRequestModel { + int itemId; + String doseStartDate; + int duration; + int dose; + int doseUnitId; + int route; + int frequency; + int doseTime; + bool covered; + bool approvalRequired; + String remarks; + String icdcode10Id; + + PrescriptionRequestModel( + {this.itemId = 4, + this.doseStartDate = "2020-12-20T13:07:41.769Z", + this.duration = 2, + this.dose = 1, + this.doseUnitId = 1, + this.route = 1, + this.frequency = 1, + this.doseTime = 1, + this.covered = true, + this.approvalRequired = true, + this.remarks = "test1", + this.icdcode10Id = "test3"}); + + PrescriptionRequestModel.fromJson(Map json) { + itemId = json['itemId']; + doseStartDate = json['doseStartDate']; + duration = json['duration']; + dose = json['dose']; + doseUnitId = json['doseUnitId']; + route = json['route']; + frequency = json['frequency']; + doseTime = json['doseTime']; + covered = json['covered']; + approvalRequired = json['approvalRequired']; + remarks = json['remarks']; + icdcode10Id = json['icdcode10Id']; + } + + Map toJson() { + final Map data = new Map(); + data['itemId'] = this.itemId; + data['doseStartDate'] = this.doseStartDate; + data['duration'] = this.duration; + data['dose'] = this.dose; + data['doseUnitId'] = this.doseUnitId; + data['route'] = this.route; + data['frequency'] = this.frequency; + data['doseTime'] = this.doseTime; + data['covered'] = this.covered; + data['approvalRequired'] = this.approvalRequired; + data['remarks'] = this.remarks; + data['icdcode10Id'] = this.icdcode10Id; + return data; + } +} diff --git a/lib/core/model/prescription_model.dart b/lib/core/model/prescription_model.dart new file mode 100644 index 00000000..9fcf3050 --- /dev/null +++ b/lib/core/model/prescription_model.dart @@ -0,0 +1,157 @@ +class PrescriptionModel { + List entityList; + dynamic rowcount; + dynamic statusMessage; + + PrescriptionModel({this.entityList, this.rowcount, this.statusMessage}); + + PrescriptionModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + dynamic appointmentNo; + dynamic clinicName; + dynamic createdBy; + dynamic createdOn; + dynamic doctorName; + dynamic doseDailyQuantity; + dynamic doseDailyUnitID; + dynamic doseDetail; + dynamic doseDurationDays; + dynamic doseTimingID; + dynamic episodeID; + dynamic frequencyID; + dynamic icdCode10ID; + dynamic indication; + dynamic isDispensed; + dynamic isMedicineCovered; + dynamic isSIG; + dynamic medicationName; + dynamic medicationPrice; + dynamic medicineCode; + dynamic orderTypeDescription; + dynamic qty; + dynamic quantity; + dynamic remarks; + dynamic routeID; + dynamic startDate; + dynamic status; + dynamic stopDate; + dynamic uom; + + EntityList( + {this.appointmentNo, + this.clinicName, + this.createdBy, + this.createdOn, + this.doctorName, + this.doseDailyQuantity, + this.doseDailyUnitID, + this.doseDetail, + this.doseDurationDays, + this.doseTimingID, + this.episodeID, + this.frequencyID, + this.icdCode10ID, + this.indication, + this.isDispensed, + this.isMedicineCovered, + this.isSIG, + this.medicationName, + this.medicationPrice, + this.medicineCode, + this.orderTypeDescription, + this.qty, + this.quantity, + this.remarks, + this.routeID, + this.startDate, + this.status, + this.stopDate, + this.uom}); + + EntityList.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + clinicName = json['clinicName']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + doseDailyQuantity = json['doseDailyQuantity']; + doseDailyUnitID = json['doseDailyUnitID']; + doseDetail = json['doseDetail']; + doseDurationDays = json['doseDurationDays']; + doseTimingID = json['doseTimingID']; + episodeID = json['episodeID']; + frequencyID = json['frequencyID']; + icdCode10ID = json['icdCode10ID']; + indication = json['indication']; + isDispensed = json['isDispensed']; + isMedicineCovered = json['isMedicineCovered']; + isSIG = json['isSIG']; + medicationName = json['medicationName']; + medicationPrice = json['medicationPrice']; + medicineCode = json['medicineCode']; + orderTypeDescription = json['orderTypeDescription']; + qty = json['qty']; + quantity = json['quantity']; + remarks = json['remarks']; + routeID = json['routeID']; + startDate = json['startDate']; + status = json['status']; + stopDate = json['stopDate']; + uom = json['uom']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['clinicName'] = this.clinicName; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['doseDailyQuantity'] = this.doseDailyQuantity; + data['doseDailyUnitID'] = this.doseDailyUnitID; + data['doseDetail'] = this.doseDetail; + data['doseDurationDays'] = this.doseDurationDays; + data['doseTimingID'] = this.doseTimingID; + data['episodeID'] = this.episodeID; + data['frequencyID'] = this.frequencyID; + data['icdCode10ID'] = this.icdCode10ID; + data['indication'] = this.indication; + data['isDispensed'] = this.isDispensed; + data['isMedicineCovered'] = this.isMedicineCovered; + data['isSIG'] = this.isSIG; + data['medicationName'] = this.medicationName; + data['medicationPrice'] = this.medicationPrice; + data['medicineCode'] = this.medicineCode; + data['orderTypeDescription'] = this.orderTypeDescription; + data['qty'] = this.qty; + data['quantity'] = this.quantity; + data['remarks'] = this.remarks; + data['routeID'] = this.routeID; + data['startDate'] = this.startDate; + data['status'] = this.status; + data['stopDate'] = this.stopDate; + data['uom'] = this.uom; + return data; + } +} diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart new file mode 100644 index 00000000..3accb428 --- /dev/null +++ b/lib/core/model/prescription_req_model.dart @@ -0,0 +1,18 @@ +class PrescriptionReqModel { + String vidaAuthTokenID; + dynamic patientMRN; + + PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN}); + + PrescriptionReqModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientMRN']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + return data; + } +} diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart new file mode 100644 index 00000000..bdb69b1c --- /dev/null +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -0,0 +1,89 @@ +class GetProcedureModel { + List entityList; + int rowcount; + dynamic statusMessage; + + GetProcedureModel({this.entityList, this.rowcount, this.statusMessage}); + + GetProcedureModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + bool allowedClinic; + String category; + String categoryID; + String genderValidation; + String group; + String orderedValidation; + int price; + String procedureId; + String procedureName; + String specialPermission; + String subGroup; + String template; + + EntityList( + {this.allowedClinic, + this.category, + this.categoryID, + this.genderValidation, + this.group, + this.orderedValidation, + this.price, + this.procedureId, + this.procedureName, + this.specialPermission, + this.subGroup, + this.template}); + + EntityList.fromJson(Map json) { + allowedClinic = json['allowedClinic']; + category = json['category']; + categoryID = json['categoryID']; + genderValidation = json['genderValidation']; + group = json['group']; + orderedValidation = json['orderedValidation']; + price = json['price']; + procedureId = json['procedureId']; + procedureName = json['procedureName']; + specialPermission = json['specialPermission']; + subGroup = json['subGroup']; + template = json['template']; + } + + Map toJson() { + final Map data = new Map(); + data['allowedClinic'] = this.allowedClinic; + data['category'] = this.category; + data['categoryID'] = this.categoryID; + data['genderValidation'] = this.genderValidation; + data['group'] = this.group; + data['orderedValidation'] = this.orderedValidation; + data['price'] = this.price; + data['procedureId'] = this.procedureId; + data['procedureName'] = this.procedureName; + data['specialPermission'] = this.specialPermission; + data['subGroup'] = this.subGroup; + data['template'] = this.template; + return data; + } +} diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart new file mode 100644 index 00000000..1769f43f --- /dev/null +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -0,0 +1,40 @@ +class GetProcedureReqModel { + int clinicId; + int patientMRN; + int pageSize; + int pageIndex; + List search; + dynamic categoryId; + String vidaAuthTokenID; + + GetProcedureReqModel( + {this.clinicId, + this.patientMRN, + this.pageSize, + this.pageIndex, + this.search, + this.categoryId, + this.vidaAuthTokenID}); + + GetProcedureReqModel.fromJson(Map json) { + clinicId = json['ClinicId']; + patientMRN = json['PatientMRN']; + pageSize = json['PageSize']; + pageIndex = json['PageIndex']; + search = json['Search'].cast(); + categoryId = json['CategoryId']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicId'] = this.clinicId; + data['PatientMRN'] = this.patientMRN; + data['PageSize'] = this.pageSize; + data['PageIndex'] = this.pageIndex; + data['Search'] = this.search; + data['CategoryId'] = this.categoryId; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart new file mode 100644 index 00000000..52f62a11 --- /dev/null +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -0,0 +1,87 @@ +class PostProcedureReqModel { + int patientMRN; + int appointmentNo; + int episodeID; + List procedures; + String vidaAuthTokenID; + + PostProcedureReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeID, + this.procedures, + this.vidaAuthTokenID}); + + PostProcedureReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + if (json['Procedures'] != null) { + procedures = new List(); + json['Procedures'].forEach((v) { + procedures.add(new Procedures.fromJson(v)); + }); + } + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + if (this.procedures != null) { + data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + } + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} + +class Procedures { + String procedure; + String category; + List controls; + + Procedures({this.procedure, this.category, this.controls}); + + Procedures.fromJson(Map json) { + procedure = json['Procedure']; + category = json['Category']; + if (json['Controls'] != null) { + controls = new List(); + json['Controls'].forEach((v) { + controls.add(new Controls.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['Procedure'] = this.procedure; + data['Category'] = this.category; + if (this.controls != null) { + data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Controls { + String code; + String controlValue; + + Controls({this.code, this.controlValue}); + + Controls.fromJson(Map json) { + code = json['Code']; + controlValue = json['ControlValue']; + } + + Map toJson() { + final Map data = new Map(); + data['Code'] = this.code; + data['ControlValue'] = this.controlValue; + return data; + } +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart new file mode 100644 index 00000000..46b93481 --- /dev/null +++ b/lib/core/service/prescription_service.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; +import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class PrescriptionService extends BaseService { + List _prescriptionList = List(); + List get prescriptionList => _prescriptionList; + + PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( + patientMRN: 1231755, + vidaAuthTokenID: + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", + ); + + PostPrescriptionReqModel _postPrescriptionReqModel = + PostPrescriptionReqModel(); + + Future getPrescription() async { + hasError = false; + _prescriptionList.clear(); + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + _prescriptionList + .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _prescriptionReqModel.toJson()); + } + + Future postPrescription() async { + hasError = false; + //_prescriptionList.clear(); + await baseAppClient.post(POST_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + _prescriptionList + .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _postPrescriptionReqModel.toJson()); + } +} diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart new file mode 100644 index 00000000..4c795baf --- /dev/null +++ b/lib/core/service/procedure_service.dart @@ -0,0 +1,48 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class ProcedureService extends BaseService { + List _procedureList = List(); + List get procedureList => _procedureList; + + GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( + clinicId: 0, + pageSize: 10, + pageIndex: 1, + patientMRN: 0, + //categoryId: null, + vidaAuthTokenID: + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", + + search: ["lab"], + ); + + PostProcedureReqModel _postProcedureReqModel = PostProcedureReqModel(); + + Future getProcedure() async { + hasError = false; + _procedureList.clear(); + await baseAppClient.post(GET_PROCEDURE_LIST, + onSuccess: (dynamic response, int statusCode) { + _procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getProcedureReqModel.toJson()); + } + + Future postProcedure() async { + hasError = false; + _procedureList.clear(); + await baseAppClient.post(POST_PROCEDURE_LIST, + onSuccess: (dynamic response, int statusCode) { + _procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _postProcedureReqModel.toJson()); + } +} diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart new file mode 100644 index 00000000..4ab4b3f7 --- /dev/null +++ b/lib/core/viewModel/prescription_view_model.dart @@ -0,0 +1,38 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; + +class PrescriptionViewModel extends BaseViewModel { + bool hasError = false; + PrescriptionService _prescriptionService = locator(); + + List get prescriptionList => + _prescriptionService.prescriptionList; + + Future getPrescription() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _prescriptionService.getPrescription(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postPrescription() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _prescriptionService.postPrescription(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart new file mode 100644 index 00000000..f65c0b2e --- /dev/null +++ b/lib/core/viewModel/procedure_View_model.dart @@ -0,0 +1,23 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; +import 'package:doctor_app_flutter/core/service/procedure_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; + +class ProcedureViewModel extends BaseViewModel { + bool hasError = false; + ProcedureService _procedureService = locator(); + List get procedureList => _procedureService.procedureList; + + Future getProcedure() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.getProcedure(); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 9461e3a3..edfc496c 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/screens/dashboard_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/bottom_nav_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/app_showcase_widget.dart'; @@ -64,7 +65,8 @@ class _LandingPageState extends State { builder: Builder(builder: (context) => DashboardScreen()), ), MessagesScreen(), - MyScheduleScreen(), + //MyScheduleScreen(), + NewPrescriptionScreen(), ServicesScreen() ], ), diff --git a/lib/locator.dart b/lib/locator.dart index 550b4666..a12cc138 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,5 +1,9 @@ import 'package:doctor_app_flutter/core/service/patient_service.dart'; +import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:get_it/get_it.dart'; import 'core/service/doctor_reply_service.dart'; @@ -24,6 +28,8 @@ void setupLocator() { locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => MedicineService()); locator.registerLazySingleton(() => PatientService()); + locator.registerLazySingleton(() => PrescriptionService()); + locator.registerLazySingleton(() => ProcedureService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -32,4 +38,6 @@ void setupLocator() { locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => MedicineViewModel()); locator.registerFactory(() => PatientViewModel()); + locator.registerFactory(() => PrescriptionViewModel()); + locator.registerFactory(() => ProcedureViewModel()); } diff --git a/lib/models/doctor/list_doctor_working_hours_table_model.dart b/lib/models/doctor/list_doctor_working_hours_table_model.dart index cb103c8a..5f1630bc 100644 --- a/lib/models/doctor/list_doctor_working_hours_table_model.dart +++ b/lib/models/doctor/list_doctor_working_hours_table_model.dart @@ -5,10 +5,14 @@ class ListDoctorWorkingHoursTable { String dayName; String workingHours; - ListDoctorWorkingHoursTable({this.date, this.dayName, this.workingHours}); + ListDoctorWorkingHoursTable({ + this.date, + this.dayName, + this.workingHours, + }); ListDoctorWorkingHoursTable.fromJson(Map json) { - date = Helpers.convertStringToDate(json['Date']) ; + date = Helpers.convertStringToDate(json['Date']); dayName = json['DayName']; workingHours = json['WorkingHours']; } @@ -18,6 +22,7 @@ class ListDoctorWorkingHoursTable { data['Date'] = this.date; data['DayName'] = this.dayName; data['WorkingHours'] = this.workingHours; + return data; } } @@ -25,6 +30,5 @@ class ListDoctorWorkingHoursTable { class WorkingHours { String from; String to; - WorkingHours({this.from,this.to}); - + WorkingHours({this.from, this.to}); } diff --git a/lib/routes.dart b/lib/routes.dart index dff02129..13e1e31f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; +import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; @@ -37,6 +38,7 @@ import './screens/settings/settings_screen.dart'; import 'landing_page.dart'; import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; +import 'screens/prescription/prescription_screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; @@ -73,6 +75,8 @@ const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; +const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; +const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; var routes = { ROOT: (_) => RootPage(), @@ -109,5 +113,8 @@ var routes = { IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), LIVECARE_PENDING_LIST: (_) => LiveCarePandingListScreen(), + ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), + ORDER_PROCEDURE: (_) => ProcedureScreen(), + // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 204d2336..de61b8a5 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -545,7 +545,7 @@ class _PatientSearchScreenState extends State { ), ], ), - ) + ), ], )); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart new file mode 100644 index 00000000..40704009 --- /dev/null +++ b/lib/screens/prescription/add_prescription_form.dart @@ -0,0 +1,212 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +void addPrescriptionForm(context) { + final GlobalKey _formKey = GlobalKey(); + final double spaceBetweenTextFileds = 12; + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext bc) { + return SingleChildScrollView( + child: Container( + height: 700, + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: _formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: + TranslationBase.of(context).searchMedicine, + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + ), + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).orderType, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).strength, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).route, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).frequency, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).doseTime, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).indication, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).fromDate, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: TranslationBase.of(context).duration, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: + TranslationBase.of(context).instruction, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + TranslationBase.of(context).addMedication, + onPressed: () { + Navigator.pop(context); + prescriptionWarning(context); + }, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ); + }); +} diff --git a/lib/screens/prescription/prescription_authorazation_form.dart b/lib/screens/prescription/prescription_authorazation_form.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart new file mode 100644 index 00000000..4ccebf39 --- /dev/null +++ b/lib/screens/prescription/prescription_screen.dart @@ -0,0 +1,405 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class NewPrescriptionScreen extends StatefulWidget { + @override + _NewPrescriptionScreenState createState() => _NewPrescriptionScreenState(); +} + +class _NewPrescriptionScreenState extends State { + int testNum = 0; + PatiantInformtion patient; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getPrescription(), + builder: (BuildContext context, PrescriptionViewModel model, + Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + if (model.prescriptionList.length > 0) + Row( + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + if (model.prescriptionList.length != 0) + SizedBox( + height: model.prescriptionList[0].rowcount == 0 + ? 200.0 + : 10.0), + //model.prescriptionList == null + if (model.prescriptionList.length != 0) + model.prescriptionList[0].rowcount == 0 + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm(context); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context) + .noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(12.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey), + borderRadius: + BorderRadius.circular(10.0), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + ' Add more medication', + fontWeight: FontWeight.w100, + fontSize: 12.5, + ), + Icon( + Icons.add, + color: Color(0XFFB8382C), + ) + ], + ), + ), + ), + onTap: () { + addPrescriptionForm(context); + }, + ), + SizedBox( + height: 15.0, + ), + ...List.generate( + model.prescriptionList[0].rowcount, + (index) => Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: + MediaQuery.of(context) + .size + .height * + 0.2, + width: + MediaQuery.of(context) + .size + .width * + 0.09, + child: Column( + children: [ + AppText( + '8\nDEC', + color: Colors.green, + ) + ], + ), + ), + Container( + height: + MediaQuery.of(context) + .size + .height * + 0.24, + width: + MediaQuery.of(context) + .size + .width * + 0.81, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: + FontWeight + .w900, + fontSize: 15.0, + ), + AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .startDate, + fontSize: 11.0, + ), + SizedBox( + width: 6.0, + ), + AppText( + 'Order Type:', + fontWeight: + FontWeight + .w900, + fontSize: 15.0, + ), + AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .orderTypeDescription, + fontSize: 13.0, + ), + ], + ), + SizedBox( + height: 2.5, + ), + Row( + children: [ + Container( + child: Expanded( + child: + AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .medicationName, + ), + ), + ) + ], + ), + Row( + children: [ + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .doseDetail, + fontSize: + 13.0, + ), + ) + ], + ), + SizedBox( + height: 3.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: + FontWeight + .w900, + ), + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .indication, + fontSize: + 12.9), + ) + ], + ), + SizedBox( + height: 15.0, + ), + Row( + children: [ + AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .doctorName, + fontWeight: + FontWeight + .w900, + ) + ], + ), + Row( + children: [ + AppText(model + .prescriptionList[ + 0] + .entityList[ + index] + .remarks), + ], + ), + SizedBox( + height: 15.0, + ), + + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, + ), + // SizedBox( + // height: 40, + // ), + ], + ), + ), + ], + ), + ], + ), + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + )), + ); + } +} diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart new file mode 100644 index 00000000..44bcab0c --- /dev/null +++ b/lib/screens/prescription/prescription_warnings.dart @@ -0,0 +1,168 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +void prescriptionWarning(context) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(12.0), + child: Container( + height: 600, + child: Column( + children: [ + ...List.generate( + 5, + (index) => Container( + child: ExpansionTile( + title: AppText('Prescription warning and alerts(0)'), + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + 'DOSESCREENINGRESULTFORETCETC', + color: Color(0XFFB8382C), + ) + ], + ) + ], + ), + ), + ), + SizedBox( + height: 10.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: + Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Remarks', + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox( + height: 95.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'CONTINUE', + onPressed: () { + Navigator.pop(context); + authorizationForm(context); + }, + ), + ], + ), + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + color: Colors.white, + title: 'remove', + fontColor: Colors.red, + onPressed: () { + Navigator.pop(context); + prescriptionWarning(context); + }, + ), + ], + ), + ), + ], + ), + ), + )); + }); +} + +void authorizationForm(context) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return Container( + height: 500, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Prescription authorization'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 30.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Auth ID', + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Password', + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + obscureText: true, + ), + ), + SizedBox( + height: 190.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'CONTINUE', + onPressed: () { + Navigator.pop(context); + authorizationForm(context); + }, + ), + ], + ), + ), + ], + ), + ), + )); + }); +} diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart new file mode 100644 index 00000000..3af63004 --- /dev/null +++ b/lib/screens/procedures/procedure_screen.dart @@ -0,0 +1,440 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class ProcedureScreen extends StatefulWidget { + @override + _ProcedureScreenState createState() => _ProcedureScreenState(); +} + +class _ProcedureScreenState extends State { + int testNum = 1; + PatiantInformtion patient; + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getProcedure(), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'ORDER PROCEDURE', + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(12.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + if (model.procedureList.length != 0) + SizedBox( + height: model.procedureList[0].rowcount == 0 + ? 200.0 + : 10.0), + //model.prescriptionList == null + if (model.procedureList.length != 0) + model.procedureList[0].rowcount == 0 + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addSelectedProcedure(context); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), + ), + ), + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + 'NO ORDER FOR PROCEDURE LISTED', + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(16.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey), + borderRadius: + BorderRadius.circular(10.0), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + ' Add more procedure', + fontWeight: FontWeight.w100, + fontSize: 12.5, + ), + Icon( + Icons.add, + color: Color(0XFFB8382C), + ) + ], + ), + ), + ), + onTap: () { + addSelectedProcedure(context); + }, + ), + // Container( + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // child: AppTextFormField( + // labelText: 'Add more procedure', + // borderColor: Colors.white, + // //suffixIcon: Icons.search, + // + // //textInputType: TextInputType.number, + // inputFormatter: ONLY_NUMBERS, + // onTap: () { + // addSelectedProcedure(context); + // }, + // ), + // ), + SizedBox( + height: 35.0, + ), + ...List.generate( + model.procedureList[0].rowcount, + (index) => Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: 120.0, + width: 45.0, + child: Column( + children: [ + AppText( + '8\nDEC', + color: Colors.green, + ) + ], + ), + ), + Container( + height: 120, + width: 325.0, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Code #: ', + fontWeight: + FontWeight + .w900, + fontSize: 15.0, + ), + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .procedureId + .toString(), + fontSize: 13.0, + ), + SizedBox( + width: 12.0, + ), + AppText( + 'Order Type: ', + fontWeight: + FontWeight + .w900, + fontSize: 15.0, + ), + AppText( + 'Urgent', + fontSize: 13.0, + color: + Colors.red, + ), + ], + ), + Row( + children: [ + Container( + child: Expanded( + child: + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .procedureName, + fontWeight: + FontWeight + .w800, + ), + ), + ) + ], + ), + + Row( + children: [ + AppText( + 'Price: ', + fontWeight: + FontWeight + .w900, + ), + Expanded( + child: AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .price + .toString(), + fontSize: + 13.0), + ) + ], + ), + SizedBox( + height: 10.0, + ), + + Row( + children: [ + AppText( + 'Some short remark about the procedure', + fontSize: 13.5, + ), + ], + ), + SizedBox( + height: 10.0, + ), + + Divider( + height: 5.0, + thickness: 1.0, + color: Colors.grey, + ) + // SizedBox( + // height: 40, + // ), + ], + ), + ), + Container( + width: 30, + height: 120, + child: Column( + children: [ + Icon(Icons.edit) + ], + ), + ) + ], + ), + ], + ), + ), + ), + ], + ), + ), + ) + ], + ), + ), + ), + )), + ); + } +} + +void addSelectedProcedure(context) { + showModalBottomSheet( + context: context, + builder: (BuildContext bc) { + return SingleChildScrollView( + child: Container( + height: 490, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Select Procedure'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 9.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Add Delected Procedures'.toUpperCase(), + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + ), + ), + SizedBox( + height: 280.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).addMedication, + // onPressed: () { + // Navigator.pop(context); + // prescriptionWarning(context); + // }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }); +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 8a8fca1a..0449a050 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -33,7 +33,8 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; @@ -79,7 +80,8 @@ class TranslationBase { localizedValues['patientServices'][locale.languageCode]; String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; @@ -119,8 +121,10 @@ class TranslationBase { String get lab => localizedValues['lab'][locale.languageCode]; String get result => localizedValues['result'][locale.languageCode]; String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; String get bodyMeasurements => @@ -142,7 +146,8 @@ class TranslationBase { String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode]; String get note => localizedValues['note'][locale.languageCode]; String get searchNote => localizedValues['searchNote'][locale.languageCode]; @@ -286,7 +291,8 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; - String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get admissionDetail => + localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; String get losNo => localizedValues['losNo'][locale.languageCode]; @@ -295,6 +301,18 @@ class TranslationBase { String get bed => localizedValues['bed'][locale.languageCode]; String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; + String get noPrescriptionListed => + localizedValues['noPrescriptionListed'][locale.languageCode]; + String get addNow => localizedValues['addNow'][locale.languageCode]; + String get orderType => localizedValues['orderType'][locale.languageCode]; + String get strength => localizedValues['strength'][locale.languageCode]; + String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String get indication => localizedValues['indication'][locale.languageCode]; + String get duration => localizedValues['duration'][locale.languageCode]; + String get instruction => localizedValues['instruction'][locale.languageCode]; + String get addMedication => + localizedValues['addMedication'][locale.languageCode]; + String get route => localizedValues['route'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 8011e6dc..4e4c6b8c 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -13,15 +13,23 @@ class MyScheduleWidget extends StatelessWidget { @override Widget build(BuildContext context) { - List workingHours = - Helpers.getWorkingHours(workingHoursTable.workingHours); + List workingHours = Helpers.getWorkingHours( + workingHoursTable.workingHours, + ); return CardWithBgWidgetNew( widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( - children: [Text('${workingHoursTable.date.day}')], + children: [ + Divider( + height: 10, + color: Colors.grey, + thickness: 1.0, + ), + Text('${workingHoursTable.date.day}') + ], ), Row( children: [ @@ -36,63 +44,39 @@ class MyScheduleWidget extends StatelessWidget { ), ], ), - SizedBox( - height: 8, - ), Column( crossAxisAlignment: CrossAxisAlignment.start, children: workingHours.map((work) { return Container( child: Column( children: [ - Divider(color: Colors.grey), Row( children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'From', - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), - AppText( - work.from, - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - ), - Container( - height: SizeConfig.realScreenWidth * 0.1, - width: 0.8, - color: Colors.grey, - margin: EdgeInsets.only(left: 15, right: 15), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + AppText( + work.from + ' - ', + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'To', - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), - AppText( - work.to, - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + AppText( + work.to, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ), + ], ), ], ) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b8136026..027ea51e 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -71,6 +71,20 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).approvals, icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: 'Order', + nameLine2: 'Prescription', + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PROCEDURE, + nameLine1: 'Order Test', + nameLine2: 'Or Procedures', + icon: 'lab.png'), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5 && @@ -152,7 +166,12 @@ class PatientProfileButton extends StatelessWidget { final PatiantInformtion patient; final String url = "assets/images/"; PatientProfileButton( - {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) + {Key key, + this.patient, + this.nameLine1, + this.nameLine2, + this.icon, + this.route}) : super(key: key); @override Widget build(BuildContext context) { @@ -166,18 +185,17 @@ class PatientProfileButton extends StatelessWidget { Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), - child: - Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppText( + AppText( this.nameLine1, color: Color(0xFFB9382C), fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 2, ), - AppText( + AppText( this.nameLine2, color: Colors.black, fontWeight: FontWeight.w600, diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 269ad660..bd06c1dc 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -2,21 +2,88 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} +final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - - TextFields({Key key, this.type, this.hintText, this.suffixIcon, this.autoFocus, this.onChanged, this.initialValue, this.minLines, this.maxLines, this.inputFormatters, this.padding, this.focus=false, this.maxLengthEnforced=true, - this.suffixIconColor, this.inputAction, this.onSubmit, this.keepPadding=true, this.textCapitalization = TextCapitalization.none, this.onTap, this.controller, this.keyboardType, this.validator, this.borderOnlyError=false, - this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false}) : super(key: key); + TextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.fillColor, + this.hintColor}) + : super(key: key); final String hintText; + final String initialValue; final String type; final bool autoFocus; final IconData suffixIcon; final Color suffixIconColor; - final IconData prefixIcon; + final Icon prefixIcon; final VoidCallback onTap; final TextEditingController controller; final TextInputType keyboardType; @@ -41,6 +108,8 @@ class TextFields extends StatefulWidget { final EdgeInsets padding; final bool focus; final bool borderOnlyError; + final Color hintColor; + final Color fillColor; @override _TextFieldsState createState() => _TextFieldsState(); @@ -63,8 +132,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus) - _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -77,25 +145,50 @@ class _TextFieldsState extends State { Widget _buildSuffixIcon() { switch (widget.type) { case "password": - { return Padding( + return Padding( padding: const EdgeInsets.only(right: 8.0), - child: view ? - InkWell(onTap: () {this.setState(() { view= false; });}, child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) - : - InkWell(onTap: () {this.setState(() { view= true; });}, child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500])) - );} - - break; + child: view + ? InkWell( + onTap: () { + this.setState( + () { + view = false; + }, + ); + }, + child: Icon( + EvaIcons.eye, + size: 24.0, + color: Color.fromRGBO(78, 62, 253, 1.0), + ), + ) + : InkWell( + onTap: () { + this.setState(() { + view = true; + }); + }, + child: Icon(EvaIcons.eyeOff, + size: 24.0, color: Colors.grey[500]), + ), + ); default: - if (widget.suffixIcon!=null) - return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor!=null ? widget.suffixIconColor : Colors.grey[500])); + if (widget.suffixIcon != null) + return InkWell( + onTap: widget.onSuffixTap, + child: Icon(widget.suffixIcon, + size: 22.0, + color: widget.suffixIconColor != null + ? widget.suffixIconColor + : Colors.grey[500]), + ); else return null; } } bool _determineReadOnly() { - if (widget.readOnly!=null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); return true; } else { @@ -105,81 +198,106 @@ class _TextFieldsState extends State { @override Widget build(BuildContext context) { - return ( - AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration: widget.bare ? null :BoxDecoration( - boxShadow: [BoxShadow(color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0)] - ), - child: TextFormField( - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction==TextInputAction.next ? (widget.onSubmit!=null ? widget.onSubmit : (val) { _focusNode.nextFocus(); }) : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - initialValue: widget.initialValue, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type=="password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context).textTheme.body2.copyWith( fontSize: widget.fontSize, fontWeight: widget.fontWeight ), - inputFormatters: widget.inputFormatters, - decoration: InputDecoration( - counterText: "", - hintText: widget.hintText, - hintStyle: TextStyle(fontSize: widget.fontSize, fontWeight: widget.fontWeight, color: Theme.of(context).hintColor), - - contentPadding: widget.padding!=null ? widget.padding : EdgeInsets.symmetric(vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, horizontal: 16.0), - filled: true, - fillColor: widget.bare ? Colors.transparent : Theme.of(context).backgroundColor, - - suffixIcon: _buildSuffixIcon(), - prefixIcon: widget.type!="search" ? - widget.prefixIcon!=null ? - Padding( - padding: EdgeInsets.only(left: 28.0, top: 14.0, bottom: 14.0, right: 0), - child: Text("\$", style: TextStyle( fontSize: 14, fontWeight: FontWeight.w800),), - ) - : - null - : - Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]), - - errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), - errorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) - ), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Theme.of(context).dividerColor.withOpacity(widget.bare ? 0.0 : 1.0 ), width: 2.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) - ) - + return (AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration: widget.bare + ? null + : BoxDecoration(boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO(70, 68, 167, focus ? 0.20 : 0), + // offset: Offset(0.0, 13.0), + // blurRadius: focus ? 34.0 : 12.0) + BoxShadow( + color: Color.fromRGBO(110, 68, 80, focus ? 0.20 : 0), + offset: Offset(0.0, 13.0), + blurRadius: focus ? 34.0 : 12.0) + ]), + child: TextFormField( + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + initialValue: widget.initialValue, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + counterText: "", + hintText: widget.hintText, + hintStyle: TextStyle( + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: widget.hintColor ?? Theme.of(context).hintColor, + ), + contentPadding: widget.padding != null + ? widget.padding + : EdgeInsets.symmetric( + vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, + horizontal: 16.0), + filled: true, + fillColor: widget.bare + ? Colors.transparent + : Theme.of(context).backgroundColor, + suffixIcon: _buildSuffixIcon(), + prefixIcon: widget.prefixIcon, + errorStyle: TextStyle( + fontSize: 14.0, + fontWeight: widget.fontWeight, + height: widget.borderOnlyError ? 0.0 : null), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), ), ), - ) - ); + ), + )); } } diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index d01fe5af..78d0bfc4 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -4,28 +4,32 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'app_texts_widget.dart'; - -class AppButton extends StatefulWidget { - +class AppButton extends StatefulWidget { final GestureTapCallback onPressed; final String title; final IconData icon; final Color color; final double fontSize; final double padding; + final Color fontColor; - AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2, this.padding = 13}); + AppButton( + {@required this.onPressed, + this.title, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.fontColor = Colors.white}); _AppButtonState createState() => _AppButtonState(); - } - class _AppButtonState extends State{ +class _AppButtonState extends State { @override Widget build(BuildContext context) { - return - RawMaterialButton( + return RawMaterialButton( fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), splashColor: widget.color, child: Padding( @@ -50,14 +54,15 @@ class AppButton extends StatefulWidget { ), AppText( widget.title.toUpperCase(), - color: Colors.white, - fontSize: SizeConfig.textMultiplier * widget.fontSize , - ), - ], - ), + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + ), + ], ), - onPressed: widget.onPressed, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))), + ), + onPressed: widget.onPressed, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index a0e91748..4af8595e 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -15,6 +15,7 @@ class AppTextFormField extends FormField { FormFieldValidator validator, ValueChanged onChanged, GestureTapCallback onTap, + bool obscureText = false, TextEditingController controller, bool autovalidate = true, TextInputType textInputType, @@ -24,6 +25,7 @@ class AppTextFormField extends FormField { ValueChanged onFieldSubmitted, IconButton prefix, String labelText, + IconData suffixIcon, borderColor}) : super( onSaved: onSaved, @@ -33,44 +35,53 @@ class AppTextFormField extends FormField { return Column( children: [ SizedBox( - height: 40.0, - child: TextFormField( - focusNode: focusNode, - keyboardType: textInputType, - inputFormatters: [WhitelistingTextInputFormatter(RegExp(inputFormatter)), - ],onChanged: onChanged?? (value){ - state.didChange(value); - }, - textInputAction: textInputAction, - onFieldSubmitted: onFieldSubmitted, - decoration: InputDecoration( - hintText: hintText, - suffixIcon: prefix, - hintStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.8,), - contentPadding: EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), - labelText: labelText, - labelStyle: TextStyle( - fontSize: SizeConfig.textMultiplier * 1.7,), - enabledBorder: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(6)), - borderSide: BorderSide( - color: borderColor != null ? borderColor : HexColor( - "#CCCCCC")), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide( - color: borderColor != null ? borderColor : HexColor( - "#CCCCCC")), - borderRadius: BorderRadius.all(Radius.circular(6)), - ) - //BorderRadius.all(Radius.circular(20)); - ), - onTap: onTap, - controller: controller, - ), - ), - state.hasError + height: 40.0, + child: TextFormField( + obscureText: obscureText, + focusNode: focusNode, + keyboardType: textInputType, + inputFormatters: [ + WhitelistingTextInputFormatter(RegExp(inputFormatter)), + ], + onChanged: onChanged ?? + (value) { + state.didChange(value); + }, + textInputAction: textInputAction, + onFieldSubmitted: onFieldSubmitted, + decoration: InputDecoration( + hintText: hintText, + suffixIcon: prefix, + hintStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.8, + ), + contentPadding: + EdgeInsets.fromLTRB(20.0, 0.0, 20.0, 0.0), + labelText: labelText, + labelStyle: TextStyle( + fontSize: SizeConfig.textMultiplier * 1.7, + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(6)), + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide( + color: borderColor != null + ? borderColor + : HexColor("#CCCCCC")), + borderRadius: BorderRadius.all(Radius.circular(6)), + ) + //BorderRadius.all(Radius.circular(20)); + ), + onTap: onTap, + controller: controller, + ), + ), + state.hasError ? Text( state.errorText, style: TextStyle(color: Colors.red), diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index e52dab51..53527e40 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -42,28 +42,25 @@ class AppText extends StatefulWidget { class _AppTextState extends State { @override Widget build(BuildContext context) { - return Visibility( - visible: widget.visibility, - child: Container( - margin: widget.margin != null - ? EdgeInsets.all(widget.margin) - : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft), - child: Text( - widget.data, - textAlign: widget.textAlign, - overflow: TextOverflow.clip, - style: TextStyle( - color: widget.color, - fontWeight: widget.fontWeight, - fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), - fontFamily: widget.fontFamily, + return Container( + margin: widget.margin != null + ? EdgeInsets.all(widget.margin) + : EdgeInsets.only( + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft), + child: Text( + widget.data, + textAlign: widget.textAlign, + overflow: TextOverflow.clip, + style: TextStyle( + color: widget.color, + fontWeight: widget.fontWeight, + fontSize: widget.fontSize ?? (SizeConfig.textMultiplier * 2), + fontFamily: widget.fontFamily, - // backgroundColor:widget.backGroundcolor - ), + // backgroundColor:widget.backGroundcolor ), ), ); From 384c7cd58afd4918b05d31e1e7be045af4d2c4dd Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 28 Dec 2020 12:03:15 +0300 Subject: [PATCH 045/421] code merged --- lib/client/base_app_client.dart | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 4ac1325e..37c459e2 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -40,10 +40,10 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - body["VidaAuthTokenID"] = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiYzNhYWM3NTEtYjdlNS00NTBmLWI2N2ItMTYyNjA2MTJhOGM3IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjA3NSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFU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3ODMsImV4cCI6MTYwOTAwMDc4MywiaWF0IjoxNjA4MTM2NzgzfQ.8cb7axSSZUwbdzQ9AdTDaahtyhoVvAiDCXIGz4F-FuQ"; + // body["VidaRefreshTokenID"] = + // "hapR/0V/AljCVq/j49o4T7Bnee7hN295Xks54jo3ATEKZMqa8k9pXmbwDGycnz0Do6jk1W7YWFl6oy6aKfIjDA=="; body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; @@ -65,8 +65,8 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); - + body['VidaRefreshTokenID'] = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -88,8 +88,7 @@ class BaseAppClient { // await helpers.logout(); onSuccess(parsed, statusCode); helpers.showErrorToast('Your session expired Please login agian'); - } else - if (parsed['MessageStatus'] == 1) { + } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { String error = @@ -98,17 +97,19 @@ class BaseAppClient { if (parsed["ValidationErrors"] != null) { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - error =''; + error = ''; for (var i = 0; i < parsed["ValidationErrors"]["ValidationErrors"].length; i++) { - error = error +parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] +"\n"; + error = error + + parsed["ValidationErrors"]["ValidationErrors"][i] + ["Messages"][0] + + "\n"; } } } - onFailure(error, - statusCode); + onFailure(error, statusCode); } } } else { From 18d58e70378f7d1e972756e7d23ac3d47aba6de5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 11:07:52 +0200 Subject: [PATCH 046/421] remove is Auth for test target --- lib/client/base_app_client.dart | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 2fda496a..597de3b4 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -80,12 +80,12 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - if (!parsed['IsAuthenticated']) { - // TODO: return it back when IsAuthenticated work fine in all service - // await helpers.logout(); - - helpers.showErrorToast('Your session expired Please login agian'); - } else + // if (!parsed['IsAuthenticated']) { + // // TODO: return it back when IsAuthenticated work fine in all service + // // await helpers.logout(); + // + // helpers.showErrorToast('Your session expired Please login agian'); + // } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { @@ -93,9 +93,8 @@ class BaseAppClient { parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { - // TODO : return it back after check the StatusMessage it not null - // error = - // parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + error = + parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { From 1da12873c7c3f25af2e57a05a97bf197e5b5a19c Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 28 Dec 2020 12:52:02 +0300 Subject: [PATCH 047/421] dashboard --- lib/screens/dashboard_screen.dart | 40 +------------------------------ 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index a8c2e014..b6bbc6cf 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -112,18 +112,6 @@ class _DashboardScreenState extends State { ) ], ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - 'Dr. ${authProvider.doctorProfile.doctorName}', - fontWeight: FontWeight.bold, - fontSize: - SizeConfig.textMultiplier * 2.5, - color: Colors.white, - ) - ], - ), SizedBox( height: 4, ), @@ -191,36 +179,12 @@ class _DashboardScreenState extends State { ), ], ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - color: - Theme.of(context).backgroundColor, - borderRadius: BorderRadius.all( - Radius.circular(10.0), - ), - ), - height: 50, - width: 60, - child: Image.network( - authProvider - .doctorProfile.doctorImageURL, -// fit: BoxFit.fill, - ), - ), - ], - ), - ) ]), ), ), Container( color: Colors.white, - height: this.isExpanded ? 150 : 90, + height: this.isExpanded ? 150 : 110, ), ], ), @@ -1102,8 +1066,6 @@ class _DashboardScreenState extends State { } } -getSummaryResult(item) {} - // TODO Move to it file class DashboardItem extends StatelessWidget { const DashboardItem( From cde56a82f2b0601e7c73db92849ab70308dc758f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 26 Dec 2020 20:05:30 +0200 Subject: [PATCH 048/421] Finish subjective --- lib/client/base_app_client.dart | 3 + lib/config/config.dart | 2 + lib/core/service/SOAP_service.dart | 32 ++- lib/core/service/base/lookup-service.dart | 1 + lib/core/viewModel/SOAP_view_model.dart | 22 ++ .../post_chief_complaint_request_model.dart | 48 ++++ .../SOAP/post_histories_request_model.dart | 64 +++++ .../SOAP/subjective/subjective_page.dart | 246 +++++++++++------- lib/widgets/shared/TextFields.dart | 2 +- lib/widgets/shared/app_buttons_widget.dart | 98 ++++--- 10 files changed, 390 insertions(+), 128 deletions(-) create mode 100644 lib/models/SOAP/post_chief_complaint_request_model.dart create mode 100644 lib/models/SOAP/post_histories_request_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index db2c5e76..53117116 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -95,6 +95,9 @@ class BaseAppClient { parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { + error = + parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { error = ''; diff --git a/lib/config/config.dart b/lib/config/config.dart index ff99729a..2c83235b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -112,6 +112,8 @@ const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; +const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; +const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; var selectedPatientType = 1; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 56645184..1a8c91a1 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,14 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'base/lookup-service.dart'; class SOAPService extends LookupService { - Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -27,13 +26,38 @@ class SOAPService extends LookupService { } Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { + hasError = false; await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); + print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: postAllergyRequestModel.toJson()); } + + Future postHistories( + PostHistoriesRequestModel postHistoriesRequestModel) async { + hasError = false; + await baseAppClient.post(POST_HISTORY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postHistoriesRequestModel.toJson()); + } + + Future postChiefComplaint( + PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + hasError = false; + await baseAppClient.post(POST_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postChiefComplaintRequestModel.toJson()); + } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index ca794d91..fd008b26 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -29,6 +29,7 @@ class LookupService extends BaseService { List listOfPhysiotherapyGoals = []; Future getMasterLookup(MasterKeysService masterKeys) async { + hasError = false; Map body = { "MasterInput": masterKeys.getMasterKeyService() }; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 608b2e3d..5131e086 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -60,5 +62,25 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future postHistories(PostHistoriesRequestModel postHistoriesRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postHistories(postHistoriesRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postChiefComplaint(PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart new file mode 100644 index 00000000..bedf2978 --- /dev/null +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -0,0 +1,48 @@ +class PostChiefComplaintRequestModel { + int appointmentNo; + int episodeID; + int patientMRN; + String chiefComplaint; + String hopi; + String currentMedication; + bool ispregnant; + bool isLactation; + int numberOfWeeks; + + PostChiefComplaintRequestModel( + {this.appointmentNo, + this.episodeID, + this.patientMRN, + this.chiefComplaint, + this.hopi, + this.currentMedication, + this.ispregnant, + this.isLactation, + this.numberOfWeeks}); + + PostChiefComplaintRequestModel.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + patientMRN = json['PatientMRN']; + chiefComplaint = json['chiefComplaint']; + hopi = json['Hopi']; + currentMedication = json['CurrentMedication']; + ispregnant = json['ispregnant']; + isLactation = json['isLactation']; + numberOfWeeks = json['numberOfWeeks']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['PatientMRN'] = this.patientMRN; + data['chiefComplaint'] = this.chiefComplaint; + data['Hopi'] = this.hopi; + data['CurrentMedication'] = this.currentMedication; + data['ispregnant'] = this.ispregnant; + data['isLactation'] = this.isLactation; + data['numberOfWeeks'] = this.numberOfWeeks; + return data; + } +} diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart new file mode 100644 index 00000000..baa428fd --- /dev/null +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -0,0 +1,64 @@ +class PostHistoriesRequestModel { + List listMedicalHistoryVM; + + PostHistoriesRequestModel({this.listMedicalHistoryVM}); + + PostHistoriesRequestModel.fromJson(Map json) { + if (json['listMedicalHistoryVM'] != null) { + listMedicalHistoryVM = new List(); + json['listMedicalHistoryVM'].forEach((v) { + listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listMedicalHistoryVM != null) { + data['listMedicalHistoryVM'] = + this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListMedicalHistoryVM { + int patientMRN; + int historyType; + int historyId; + int episodeId; + int appointmentNo; + bool isChecked; + String remarks; + + ListMedicalHistoryVM( + {this.patientMRN, + this.historyType, + this.historyId, + this.episodeId, + this.appointmentNo, + this.isChecked, + this.remarks}); + + ListMedicalHistoryVM.fromJson(Map json) { + patientMRN = json['patientMRN']; + historyType = json['historyType']; + historyId = json['historyId']; + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + isChecked = json['isChecked']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['historyType'] = this.historyType; + data['historyId'] = this.historyId; + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['isChecked'] = this.isChecked; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index a78f6d0b..ae024b10 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; @@ -34,9 +36,9 @@ class _SubjectivePageState extends State { bool isChiefExpand = false; bool isHistoryExpand = false; bool isAllergiesExpand = false; - List myHistoryList = List(); TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); + final formKey = GlobalKey(); @override Widget build(BuildContext context) { @@ -83,56 +85,64 @@ class _SubjectivePageState extends State { isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) ], ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Chief Complaints", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: complaintsController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "History of Present Illness", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: illnessController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - AddMedication(), - ]), + bodyWidget: Form( + key: formKey, + child: Column(children: [ + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Chief Complaints", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: complaintsController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else if (value.length < 25) + return TranslationBase + .of(context) + .chiefComplaintLength; + //""; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "History of Present Illness", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: illnessController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + AddMedication(), + ]), + ), isExpand: isChiefExpand, ), @@ -177,7 +187,7 @@ class _SubjectivePageState extends State { ), bodyWidget: Column( children: [ - AddHistoryWidget(myHistoryList: myHistoryList) + AddHistoryWidget(myHistoryList: widget.myHistoryList) ], ), isExpand: isHistoryExpand, @@ -243,58 +253,118 @@ class _SubjectivePageState extends State { SizedBox( height: 30, ), - AppButton( - title: TranslationBase - .of(context) - .next, - - onPressed: () async { - addSubjectiveInfo(model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: myHistoryList); - - }, - ), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, + myAllergiesList: widget.myAllergiesList, + myHistoryList: widget.myHistoryList); + }, + ), ], ), ), ), - ),),); + ), + ), + ); } addSubjectiveInfo( - {SOAPViewModel model, List myAllergiesList, List< - MasterKeyModel> myHistoryList }) async { - PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + {SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { + await postChiefComplaint(model: model); + if (myHistoryList.length != 0) + await postHistories(model: model, myHistoryList: myHistoryList); + if (myAllergiesList.length != 0) + await postAllergy(myAllergiesList: myAllergiesList, model: model); + + widget.changePageViewIndex(1); + } + + postAllergy( + {List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = + new PostAllergyRequestModel(); widget.myAllergiesList.forEach((allergy) { - if(postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM ==null) + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == + null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( - ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: 2500477, - episodeId: 200011502, - appointmentNo: 2016053271, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 1485, - createdOn: "2020-08-14T20:37:22.780Z", - editedBy: 1485, - editedOn: "2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false - )); + //TODO: make static value dynamic + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM + .add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: 1485, + // + createdOn: "2020-08-14T20:37:22.780Z", + editedBy: 1485, + editedOn: "2020-08-14T20:37:22.780Z", + isChecked: false, + isUpdatedByNurse: false)); }); await model.postAllergy(postAllergyRequestModel); - if(model.state == ViewState.ErrorLocal) { + if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } - widget.changePageViewIndex(1); + } - print(postAllergyRequestModel); + postHistories( + {List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = + new PostHistoriesRequestModel(); + widget.myHistoryList.forEach((history) { + if (postHistoriesRequestModel.listMedicalHistoryVM == null) + postHistoriesRequestModel.listMedicalHistoryVM = []; + //TODO: make static value dynamic + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + remarks: "", + historyId: history.id, + historyType: history.typeId, + isChecked: false, + )); + }); + await model.postHistories(postHistoriesRequestModel); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } } + postChiefComplaint({SOAPViewModel model}) async { + formKey.currentState.save(); + if(formKey.currentState.validate()){ + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + //TODO: make static value dynamic + new PostChiefComplaintRequestModel( + patientMRN: 3120690, + episodeID: 200012117, + appointmentNo: 2016054573, + chiefComplaint: complaintsController.text, + currentMedication: "currentMedication", + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + numberOfWeeks: 22); + + await model.postChiefComplaint(postChiefComplaintRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } + } + + } } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index e41b4379..fec58e89 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -157,7 +157,7 @@ class _TextFieldsState extends State { : Icon(EvaIcons.search, size: 20.0, color: Colors.grey[500]), - errorStyle: TextStyle(fontSize: 14.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), + errorStyle: TextStyle(fontSize: 12.0, fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( borderSide: BorderSide(color: Theme.of(context).errorColor.withOpacity(widget.bare ? 0.0 : 0.5 ), width: 2.0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0) diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index d01fe5af..85b0483d 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -14,50 +14,78 @@ class AppButton extends StatefulWidget { final Color color; final double fontSize; final double padding; + final bool loading; + final bool disabled; - AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2, this.padding = 13}); + AppButton( + {@required this.onPressed, + this.title, + this.icon, + this.color, + this.fontSize = 2, + this.padding = 13, + this.loading = false, + this.disabled = false}); _AppButtonState createState() => _AppButtonState(); - } class _AppButtonState extends State{ @override Widget build(BuildContext context) { - return - RawMaterialButton( - fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Icon( - widget.icon, - color: Colors.white, - ), - if (widget.icon != null) - SizedBox( - width: 5.0, - ), - AppText( - widget.title.toUpperCase(), - color: Colors.white, - fontSize: SizeConfig.textMultiplier * widget.fontSize , - ), - ], + return + IgnorePointer( + ignoring: widget.loading, + child: RawMaterialButton( + fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Icon( + widget.icon, + color: Colors.white, + ), + if (widget.icon != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: + AlwaysStoppedAnimation( + Colors.grey[300], + ), + ), + ), + ) + : AppText( + widget.title.toUpperCase(), + color: Colors.white, + fontSize: SizeConfig.textMultiplier * widget.fontSize, + ), + ], + ), ), + onPressed: widget.onPressed, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), ), - onPressed: widget.onPressed, - shape: const RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(6))), - ); + ); } } \ No newline at end of file From 4df3b1fb402cf22dadd735b3112ada948be04df7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 26 Dec 2020 20:53:27 +0200 Subject: [PATCH 049/421] First step from examination --- lib/core/service/base/lookup-service.dart | 49 +- lib/core/viewModel/SOAP_view_model.dart | 1 + .../patients/profile/SOAP/add_SOAP_index.dart | 3 +- .../patients/profile/SOAP/objective_page.dart | 624 +++++++++--------- 4 files changed, 330 insertions(+), 347 deletions(-) diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index fd008b26..ac03657b 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'base_service.dart'; class LookupService extends BaseService { - List listOfAllergies = []; List get allergySeverityList => _allergySeverityList; @@ -26,7 +25,7 @@ class LookupService extends BaseService { List get historySurgicalList => _historySurgicalList; List _historySurgicalList = []; - List listOfPhysiotherapyGoals = []; + List listOfPhysiotherapyGoals = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -35,12 +34,12 @@ class LookupService extends BaseService { }; await baseAppClient.post(GET_MASTER_LOOKUP_LIST, onSuccess: (dynamic response, int statusCode) { - setMasterLookupInCorrectArray( - response['MasterLookUpList']['entityList'], masterKeys); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: body); + setMasterLookupInCorrectArray( + response['MasterLookUpList']['entityList'], masterKeys); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); } setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { @@ -48,61 +47,57 @@ class LookupService extends BaseService { case MasterKeysService.Allergies: listOfAllergies.clear(); entryList.forEach((v) { - listOfAllergies - .add(MasterKeyModel.fromJson(v)); + listOfAllergies.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.HistoryFamily: _historyFamilyList.clear(); entryList.forEach((v) { - _historyFamilyList - .add(MasterKeyModel.fromJson(v)); + _historyFamilyList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.HistoryMedical: _historyMedicalList.clear(); entryList.forEach((v) { - _historyMedicalList - .add(MasterKeyModel.fromJson(v)); + _historyMedicalList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.HistorySocial: historySocialList.clear(); entryList.forEach((v) { - historySocialList - .add(MasterKeyModel.fromJson(v)); + historySocialList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.HistorySports: _historySportList.clear(); entryList.forEach((v) { - _historySportList - .add(MasterKeyModel.fromJson(v)); - }); break; + _historySportList.add(MasterKeyModel.fromJson(v)); + }); + break; case MasterKeysService.HistorySurgical: _historySurgicalList.clear(); entryList.forEach((v) { - _historySurgicalList - .add(MasterKeyModel.fromJson(v)); + _historySurgicalList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.PhysicalExamination: - return 59; + _physicalExaminationList.clear(); + entryList.forEach((v) { + _physicalExaminationList.add(MasterKeyModel.fromJson(v)); + }); break; case MasterKeysService.AllergySeverity: _allergySeverityList.clear(); entryList.forEach((v) { - _allergySeverityList - .add(MasterKeyModel.fromJson(v)); + _allergySeverityList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.physiotherapyGoals: listOfPhysiotherapyGoals.clear(); entryList.forEach((v) { - listOfPhysiotherapyGoals - .add(MasterKeyModel.fromJson(v)); + listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v)); }); break; } } -} \ No newline at end of file +} diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 5131e086..3ff33389 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -29,6 +29,7 @@ class SOAPViewModel extends BaseViewModel { List get historySocialList => _SOAPService.historySocialList; List get historySurgicalList => _SOAPService.historySurgicalList; List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList]; + List get physicalExaminationList => _SOAPService.physicalExaminationList; diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 9d75b22c..4e8c0873 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -30,6 +30,7 @@ class _AddSOAPIndexState extends State int _currentIndex = 0; List myAllergiesList= List(); List myHistoryList = List(); + List myExaminationList = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -153,7 +154,7 @@ class _AddSOAPIndexState extends State scrollDirection: Axis.horizontal, children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,), + ObjectivePage(changePageViewIndex: changePageViewIndex,myExaminationList:myExaminationList), AssessmentPage(changePageViewIndex: changePageViewIndex,), PlanPage(changePageViewIndex: changePageViewIndex,) ], diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index b2cd920f..c3e8d5db 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -1,4 +1,9 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; @@ -7,15 +12,16 @@ 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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; + final List myExaminationList; - ObjectivePage({Key key, this.changePageViewIndex}); + ObjectivePage({Key key, this.changePageViewIndex, this.myExaminationList}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -117,115 +123,136 @@ class _ObjectivePageState extends State { SizedBox( height: 20, ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Abdomen'.toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ + Column( + children: widget.myExaminationList.map((examination) { + return Container( + margin: EdgeInsets.only( + left: 15, right: 15, top: 15), + child: Column(children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - Colors.white,Colors.grey - ), - child: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - "Normal", - style: TextStyle( - fontSize: 12, - color: - Colors.black, //Colors.black, - fontWeight: FontWeight.bold, + Texts(examination.nameEn.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + Colors.white, + Colors.grey), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Normal", + style: TextStyle( + fontSize: 12, + color: + Colors.black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), ), - ), - ), - )), + )), + ), + onTap: () {}), + SizedBox( + width: 12, ), - onTap: () { - - }), - SizedBox(width: 12,), - InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - Color(0xFF515A5D), Colors.black - ), - child: Center( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - "Abnormal", - style: TextStyle( - fontSize: 12, - color: - Colors.white, //Colors.black, - fontWeight: FontWeight.bold, + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + Color(0xFF515A5D), + Colors.black), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Abnormal", + style: TextStyle( + fontSize: 12, + color: + Colors.white, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), ), - ), - ), - )), - ), - onTap: () { - - }), + )), + ), + onTap: () {}), + ], + ), + InkWell( + + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: ()=>removeExamination(examination), + ) ], ), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarksController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - ], - ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarksController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + ])); + }).toList(), ) ], ) @@ -249,10 +276,23 @@ class _ObjectivePageState extends State { )); } + removeExamination(MasterKeyModel masterKey) { + Iterable history = widget.myExaminationList.where( + (element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + + if (history.length > 0) + setState(() { + widget.myExaminationList.remove(history.first); + }); + } + openExaminationList(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -275,228 +315,174 @@ class _ObjectivePageState extends State { ); } - ; showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Examinations", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( + return AddExaminationDailog( + myExaminationList: widget.myExaminationList, + addSelectedExamination: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeExamination: (masterKey) => removeExamination(masterKey),); + }); + } +} + +class AddExaminationDailog extends StatefulWidget { + final List myExaminationList; + final Function addSelectedExamination; + final Function (MasterKeyModel) removeExamination; + + const AddExaminationDailog( + {Key key, this.myExaminationList, this.addSelectedExamination, this.removeExamination}) + : super(key: key); + + @override + _AddExaminationDailogState createState() => _AddExaminationDailogState(); +} + +class _AddExaminationDailogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup( + MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => + AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + AppText( + "Examinations", + fontWeight: FontWeight.bold, + fontSize: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 16, ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery + .of(context) + .size + .height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius + .circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model + .physicalExaminationList + .map((examinationInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + examinationInfo), + activeColor: + Colors.red[800], + onChanged: + ( + bool newValue) { + setState(() { + if (isServiceSelected( + examinationInfo + )) { + widget + .removeExamination( + examinationInfo + ); + } + else { + widget + .myExaminationList + .add( + examinationInfo); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + examinationInfo + .nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), ), - DividerWithSpacesAround(), - Row( - children: [ - Checkbox( - value: true, - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() {}); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts('Examinations', - variant: "bodyText", - bold: true, - color: Colors.black), - ), - ), - ], + SizedBox( + height: 10, ), - DividerWithSpacesAround(), - ], - ), - ], - ), - )), - ), - SizedBox( - height: 10, - ), - AppButton( - title: "Add SELECTED Examinations".toUpperCase(), - onPressed: () {}, - ), - ]), - )), - ); - }); + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED Examinations" + .toUpperCase(), + onPressed: () { + widget.addSelectedExamination(); + }, + ), + ]), + ))), + )), + ); } -} + isServiceSelected(MasterKeyModel masterKey) { + Iterable history = + widget + .myExaminationList + .where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + if (history.length > 0) { + return true; + } + return false; + } +} From a362901da8221a046ed59391bd77bae38f694d90 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 27 Dec 2020 15:46:29 +0200 Subject: [PATCH 050/421] improve code inside my eam --- lib/models/SOAP/my_selected_examination.dart | 33 +++++++ .../post_physical_exam_request_model.dart | 99 +++++++++++++++++++ .../patients/profile/SOAP/add_SOAP_index.dart | 5 +- .../patients/profile/SOAP/objective_page.dart | 50 ++++++---- 4 files changed, 166 insertions(+), 21 deletions(-) create mode 100644 lib/models/SOAP/my_selected_examination.dart create mode 100644 lib/models/SOAP/post_physical_exam_request_model.dart diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart new file mode 100644 index 00000000..3b6685c8 --- /dev/null +++ b/lib/models/SOAP/my_selected_examination.dart @@ -0,0 +1,33 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedExamination { + MasterKeyModel selectedExamination; + String remark; + bool isNormal; + bool isAbnormal; + + MySelectedExamination( + {this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false}); + + MySelectedExamination.fromJson(Map json) { + + selectedExamination = json['selectedExamination'] != null + ? new MasterKeyModel.fromJson(json['selectedExamination']) + : null; + remark = json['remark']; + remark = json['isNormal']; + remark = json['isAbnormal']; + } + + Map toJson() { + final Map data = new Map(); + + if (this.selectedExamination != null) { + data['selectedExamination'] = this.selectedExamination.toJson(); + } + data['remark'] = this.remark; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + return data; + } +} diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart new file mode 100644 index 00000000..f9f23897 --- /dev/null +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -0,0 +1,99 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class PostPhysicalExamRequestModel { + List listHisProgNotePhysicalVM; + + PostPhysicalExamRequestModel({this.listHisProgNotePhysicalVM}); + + PostPhysicalExamRequestModel.fromJson(Map json) { + if (json['listHisProgNotePhysicalVM'] != null) { + listHisProgNotePhysicalVM = new List(); + json['listHisProgNotePhysicalVM'].forEach((v) { + listHisProgNotePhysicalVM + .add(new ListHisProgNotePhysicalVM.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listHisProgNotePhysicalVM != null) { + data['listHisProgNotePhysicalVM'] = + this.listHisProgNotePhysicalVM.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListHisProgNotePhysicalVM { + int episodeId; + int appointmentNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + String remarks; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + bool notExamined; + MasterKeyModel masterDescription; + + ListHisProgNotePhysicalVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.remarks, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.notExamined, + this.masterDescription}); + + ListHisProgNotePhysicalVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + remarks = json['remarks']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + notExamined = json['notExamined']; + masterDescription = json['masterDescription'] != null + ? new MasterKeyModel.fromJson(json['masterDescription']) + : null; + } + + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['remarks'] = this.remarks; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['notExamined'] = this.notExamined; + if (this.masterDescription != null) { + data['masterDescription'] = this.masterDescription.toJson(); + } + return data; + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 4e8c0873..705bc85f 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; @@ -30,7 +31,7 @@ class _AddSOAPIndexState extends State int _currentIndex = 0; List myAllergiesList= List(); List myHistoryList = List(); - List myExaminationList = List(); + List mySelectedExamination = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -154,7 +155,7 @@ class _AddSOAPIndexState extends State scrollDirection: Axis.horizontal, children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,myExaminationList:myExaminationList), + ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), AssessmentPage(changePageViewIndex: changePageViewIndex,), PlanPage(changePageViewIndex: changePageViewIndex,) ], diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index c3e8d5db..a1b91864 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -19,9 +20,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; - final List myExaminationList; + final List mySelectedExamination; - ObjectivePage({Key key, this.changePageViewIndex, this.myExaminationList}); + ObjectivePage( + {Key key, this.changePageViewIndex, this.mySelectedExamination}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -29,7 +31,6 @@ class ObjectivePage extends StatefulWidget { class _ObjectivePageState extends State { bool isSysExaminationExpand = false; - List examinationsList; TextEditingController remarksController = TextEditingController(); BoxDecoration containerBorderDecoration( @@ -124,7 +125,8 @@ class _ObjectivePageState extends State { height: 20, ), Column( - children: widget.myExaminationList.map((examination) { + children: + widget.mySelectedExamination.map((examination) { return Container( margin: EdgeInsets.only( left: 15, right: 15, top: 15), @@ -133,7 +135,10 @@ class _ObjectivePageState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(examination.nameEn.toUpperCase(), + Texts( + examination + .selectedExamination.nameEn + .toUpperCase(), variant: "bodyText", bold: true, color: Colors.black) @@ -216,13 +221,14 @@ class _ObjectivePageState extends State { ], ), InkWell( - + child: Icon( FontAwesomeIcons.trash, color: Colors.grey, size: 20, ), - onTap: ()=>removeExamination(examination), + onTap: () => removeExamination( + examination.selectedExamination), ) ], ), @@ -277,13 +283,15 @@ class _ObjectivePageState extends State { } removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.myExaminationList.where( + Iterable history = widget.mySelectedExamination + .where( (element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); if (history.length > 0) setState(() { - widget.myExaminationList.remove(history.first); + widget.mySelectedExamination.remove(history.first); }); } @@ -321,7 +329,7 @@ class _ObjectivePageState extends State { context: context, builder: (context) { return AddExaminationDailog( - myExaminationList: widget.myExaminationList, + mySelectedExamination: widget.mySelectedExamination, addSelectedExamination: () { setState(() { Navigator.of(context).pop(); @@ -333,12 +341,12 @@ class _ObjectivePageState extends State { } class AddExaminationDailog extends StatefulWidget { - final List myExaminationList; + final List mySelectedExamination; final Function addSelectedExamination; final Function (MasterKeyModel) removeExamination; const AddExaminationDailog( - {Key key, this.myExaminationList, this.addSelectedExamination, this.removeExamination}) + {Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) : super(key: key); @override @@ -422,10 +430,13 @@ class _AddExaminationDailogState extends State { ); } else { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: examinationInfo + ); widget - .myExaminationList + .mySelectedExamination .add( - examinationInfo); + mySelectedExamination); } }); }), @@ -475,12 +486,13 @@ class _AddExaminationDailogState extends State { } isServiceSelected(MasterKeyModel masterKey) { - Iterable history = + Iterable exam = widget - .myExaminationList + .mySelectedExamination .where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); - if (history.length > 0) { + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + if (exam.length > 0) { return true; } return false; From cd46b4317c29406d4da2ce26d59cec37aca6b223 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 10:42:24 +0200 Subject: [PATCH 051/421] fix error null thing --- lib/client/base_app_client.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 53117116..61fca62d 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -95,8 +95,9 @@ class BaseAppClient { parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { - error = - parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + // TODO : return it back after check the StatusMessage it not null + // error = + // parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { From e6af5a3e39e92b26c2cb6a5392237df46b358c1a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 11:07:52 +0200 Subject: [PATCH 052/421] remove is Auth for test target --- lib/client/base_app_client.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 61fca62d..53117116 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -95,9 +95,8 @@ class BaseAppClient { parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { - // TODO : return it back after check the StatusMessage it not null - // error = - // parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + error = + parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { From 697f17f2cdb671b3c3d24ba8cd6635801ee644ed Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 28 Dec 2020 12:45:03 +0200 Subject: [PATCH 053/421] prescription and procedure --- lib/config/localized_values.dart | 23 +++++--- lib/routes.dart | 4 +- lib/util/translations_delegate_base.dart | 57 ++++++++++++------- .../profile/profile_medical_info_widget.dart | 21 +++---- lib/widgets/shared/TextFields.dart | 27 +++++---- lib/widgets/shared/app_text_form_field.dart | 3 +- 6 files changed, 82 insertions(+), 53 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f199776b..6859ab23 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -1,4 +1,4 @@ -const Map> localizedValues = { +const Map> localizedValues = { 'dashboardScreenToolbarTitle': {'ar': 'الرئيسة', 'en': 'Home'}, 'settings': {'en': 'Settings', 'ar': 'الاعدادات'}, 'language': {'en': 'App Language', 'ar': 'لغة التطبيق'}, @@ -202,7 +202,10 @@ const Map> localizedValues = { 'routine': {'en': 'Routine', 'ar': 'روتيني'}, 'send': {'en': 'Send', 'ar': 'ارسال'}, 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, - 'selectReferralFrequency': {'en': 'Select Referral Frequency:', 'ar': 'اختار تواتر الحالة:'}, + 'selectReferralFrequency': { + 'en': 'Select Referral Frequency:', + 'ar': 'اختار تواتر الحالة:' + }, 'clinicalDetailsAndRemarks': { 'en': 'Clinical Details and Remarks', 'ar': 'التفاصيل السرسرية والملاحظات' @@ -258,7 +261,6 @@ const Map> localizedValues = { 'ar': 'لا يوجد اي نتائج' }, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, - 'moreThan3Letter': { 'en': 'Medicine Name Should Be More Than 3 letter', 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' @@ -274,13 +276,13 @@ const Map> localizedValues = { 'room': {'en': 'ROOM:', 'ar': 'الغرفة'}, 'bed': {'en': 'BED:', 'ar': 'السرير'}, 'next': {'en': 'Next', 'ar': 'التالي'}, - 'healthRecordInformation': {'en': 'HEALTH RECORD INFORMATION', 'ar': 'معلومات السجل الصحي'}, + 'healthRecordInformation': { + 'en': 'HEALTH RECORD INFORMATION', + 'ar': 'معلومات السجل الصحي' + }, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, - "empty-message": { - "en": "Please enter message", - "ar": "يرجى ادخال الموضوع" - }, + "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, @@ -296,7 +298,10 @@ const Map> localizedValues = { 'summaryReport': {'en': "Summary Report", 'ar': 'تقرير موجز'}, 'accept': {'en': "ACCEPT", 'ar': 'قبول'}, 'reject': {'en': "REJECT", 'ar': 'رفض'}, - 'noAppointmentsErrorMsg': {'en': "There is no appointments for at this date", 'ar': 'لا توجد مواعيد في هذا التاريخ'}, + 'noAppointmentsErrorMsg': { + 'en': "There is no appointments for at this date", + 'ar': 'لا توجد مواعيد في هذا التاريخ' + }, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, 'noPrescriptionListed': { 'en': 'NO PRESCRIPTION LISTED', diff --git a/lib/routes.dart b/lib/routes.dart index 680c8cfc..e73d53b4 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -76,7 +76,7 @@ const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; -const String CREATE_EPISODE = 'patients/create-episode'; +const String CREATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -117,7 +117,7 @@ var routes = { PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), - CREATE_EPISODE:(_)=>AddSOAPIndex(), + CREATE_EPISODE: (_) => AddSOAPIndex(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f3bee55e..a686e60d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -33,7 +33,8 @@ class TranslationBase { String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; - String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode]; + String get replySuccessfully => + localizedValues['replySuccessfully'][locale.languageCode]; String get messagesScreenToolbarTitle => localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; @@ -79,8 +80,10 @@ class TranslationBase { localizedValues['patientServices'][locale.languageCode]; String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; - String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; - String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get myReferralPatient => + localizedValues['myReferralPatient'][locale.languageCode]; + String get referPatient => + localizedValues['referPatient'][locale.languageCode]; String get myReferral => localizedValues['myReferral'][locale.languageCode]; String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; @@ -107,8 +110,10 @@ class TranslationBase { String get profile => localizedValues['profile'][locale.languageCode]; String get gender => localizedValues['gender'][locale.languageCode]; String get clinic => localizedValues['clinic'][locale.languageCode]; - String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; - String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get clinicSelect => + localizedValues['clinicSelect'][locale.languageCode]; + String get doctorSelect => + localizedValues['doctorSelect'][locale.languageCode]; String get hospital => localizedValues['hospital'][locale.languageCode]; String get speciality => localizedValues['speciality'][locale.languageCode]; String get errorMessage => @@ -122,8 +127,10 @@ class TranslationBase { String get lab => localizedValues['lab'][locale.languageCode]; String get result => localizedValues['result'][locale.languageCode]; String get medicines => localizedValues['medicines'][locale.languageCode]; - String get prescription => localizedValues['prescription'][locale.languageCode]; - String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; String get insurance => localizedValues['insurance'][locale.languageCode]; String get approvals => localizedValues['approvals'][locale.languageCode]; String get bodyMeasurements => @@ -145,7 +152,8 @@ class TranslationBase { String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; String get replay => localizedValues['replay'][locale.languageCode]; - String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get progressNote => + localizedValues['progressNote'][locale.languageCode]; String get progress => localizedValues['progress'][locale.languageCode]; String get note => localizedValues['note'][locale.languageCode]; String get searchNote => localizedValues['searchNote'][locale.languageCode]; @@ -223,8 +231,10 @@ class TranslationBase { String get urgent => localizedValues['urgent'][locale.languageCode]; String get routine => localizedValues['routine'][locale.languageCode]; String get send => localizedValues['send'][locale.languageCode]; - String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; - String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; + String get selectReferralFrequency => + localizedValues['selectReferralFrequency'][locale.languageCode]; String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; String get remarks => localizedValues['remarks'][locale.languageCode]; @@ -291,7 +301,8 @@ class TranslationBase { localizedValues['moreThan3Letter'][locale.languageCode]; String get gender2 => localizedValues['gender2'][locale.languageCode]; String get age2 => localizedValues['age2'][locale.languageCode]; - String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get admissionDetail => + localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; String get losNo => localizedValues['losNo'][locale.languageCode]; @@ -299,25 +310,33 @@ class TranslationBase { String get room => localizedValues['room'][locale.languageCode]; String get bed => localizedValues['bed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; - String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get healthRecordInformation => + localizedValues['healthRecordInformation'][locale.languageCode]; + String get emptyMessage => + localizedValues['empty-message'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode]; - String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get referredFrom => + localizedValues['referredFrom'][locale.languageCode]; String get branch => localizedValues['branch'][locale.languageCode]; - String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; - String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get chooseAppointment => + localizedValues['chooseAppointment'][locale.languageCode]; + String get appointmentNo => + localizedValues['appointmentNo'][locale.languageCode]; String get refer => localizedValues['refer'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get rejected => localizedValues['rejected'][locale.languageCode]; String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; String get dr => localizedValues['dr'][locale.languageCode]; - String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; - String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get previewHealth => + localizedValues['previewHealth'][locale.languageCode]; + String get summaryReport => + localizedValues['summaryReport'][locale.languageCode]; String get accept => localizedValues['accept'][locale.languageCode]; String get reject => localizedValues['reject'][locale.languageCode]; - String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get noAppointmentsErrorMsg => + localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; String get noPrescriptionListed => diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 3008bf73..e6d3bdbd 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -11,9 +11,9 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'PatientProfileButton.dart'; /* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: *@return:ProfileMedicalInfoWidget *@desc: Profile Medical Info Widget */ @@ -27,13 +27,14 @@ class ProfileMedicalInfoWidget extends StatelessWidget { mainAxisSpacing: 20, crossAxisCount: 2, childAspectRatio: 1.5, - children: [ PatientProfileButton( - key: key, - patient: patient, - nameLine1: "Create New", - nameLine2: "Episode", - route: CREATE_EPISODE, - icon: 'heartbeat.png'), + children: [ + PatientProfileButton( + key: key, + patient: patient, + nameLine1: "Create New", + nameLine2: "Episode", + route: CREATE_EPISODE, + icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 0e6f6c2b..791da173 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -39,10 +39,6 @@ class NumberTextInputFormatter extends TextInputFormatter { final _mobileFormatter = NumberTextInputFormatter(); class TextFields extends StatefulWidget { - - TextFields({Key key, this.type, this.hintText, this.suffixIcon, this.autoFocus, this.onChanged, this.initialValue, this.minLines, this.maxLines, this.inputFormatters, this.padding, this.focus=false, this.maxLengthEnforced=true, - this.suffixIconColor, this.inputAction, this.onSubmit, this.keepPadding=true, this.textCapitalization = TextCapitalization.none, this.onTap, this.controller, this.keyboardType, this.validator, this.borderOnlyError=false, - this.onSaved, this.onSuffixTap, this.readOnly: false, this.maxLength, this.prefixIcon, this.bare=false, this.fontSize=16.0, this.fontWeight=FontWeight.w700, this.autoValidate=false, this.onTapTextFields}) : super(key: key); TextFields( {Key key, this.type, @@ -77,7 +73,8 @@ class TextFields extends StatefulWidget { this.fontWeight = FontWeight.w700, this.autoValidate = false, this.fillColor, - this.hintColor}) + this.hintColor, + this.onTapTextFields}) : super(key: key); final String hintText; @@ -86,7 +83,7 @@ class TextFields extends StatefulWidget { final bool autoFocus; final IconData suffixIcon; final Color suffixIconColor; - final IconData prefixIcon; + final Icon prefixIcon; final VoidCallback onTap; final Function onTapTextFields; final TextEditingController controller; @@ -136,8 +133,7 @@ class _TextFieldsState extends State { @override void didUpdateWidget(TextFields oldWidget) { - if (widget.focus) - _focusNode.requestFocus(); + if (widget.focus) _focusNode.requestFocus(); super.didUpdateWidget(oldWidget); } @@ -178,15 +174,21 @@ class _TextFieldsState extends State { ), ); default: - if (widget.suffixIcon!=null) - return InkWell(onTap: widget.onSuffixTap, child: Icon(widget.suffixIcon, size: 22.0, color: widget.suffixIconColor!=null ? widget.suffixIconColor : Colors.grey[500])); + if (widget.suffixIcon != null) + return InkWell( + onTap: widget.onSuffixTap, + child: Icon(widget.suffixIcon, + size: 22.0, + color: widget.suffixIconColor != null + ? widget.suffixIconColor + : Colors.grey[500])); else return null; } } bool _determineReadOnly() { - if (widget.readOnly!=null && widget.readOnly) { + if (widget.readOnly != null && widget.readOnly) { _focusNode.unfocus(); return true; } else { @@ -211,7 +213,8 @@ class _TextFieldsState extends State { blurRadius: focus ? 34.0 : 12.0) ]), child: TextFormField( - onTap: widget.onTapTextFields,keyboardAppearance: Theme.of(context).brightness, + onTap: widget.onTapTextFields, + keyboardAppearance: Theme.of(context).brightness, scrollPhysics: BouncingScrollPhysics(), autovalidate: widget.autoValidate, textCapitalization: widget.textCapitalization, diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index ed3092fa..6c6d3ecc 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -41,7 +41,8 @@ class AppTextFormField extends FormField { focusNode: focusNode, keyboardType: textInputType, inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp(inputFormatter)), + FilteringTextInputFormatter.allow( + RegExp(inputFormatter)), ], onChanged: onChanged ?? (value) { From 1491a04b3911261a4fa908b43f40f485208f52ad Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 12:54:34 +0200 Subject: [PATCH 054/421] PostPhysicalExam works --- lib/config/config.dart | 1 + lib/core/service/SOAP_service.dart | 12 ++ lib/core/viewModel/SOAP_view_model.dart | 11 ++ .../patients/profile/SOAP/objective_page.dart | 116 ++++++++++++++---- .../SOAP/subjective/subjective_page.dart | 7 +- 5 files changed, 123 insertions(+), 24 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 5355dac4..8d6c0935 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -107,6 +107,7 @@ const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLoo const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; var selectedPatientType = 1; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 1a8c91a1..44b304fc 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'base/lookup-service.dart'; @@ -60,4 +61,15 @@ class SOAPService extends LookupService { super.error = error; }, body: postChiefComplaintRequestModel.toJson()); } + + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + hasError = false; + await baseAppClient.post(POST_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postPhysicalExamRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 3ff33389..f43306f0 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -83,5 +84,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postPhysicalExam(postPhysicalExamRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index a1b91864..894f7745 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -1,9 +1,11 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -49,7 +51,9 @@ class _ObjectivePageState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return AppScaffold( + return BaseView( + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -161,7 +165,12 @@ class _ObjectivePageState extends State { 0.070, decoration: containerBorderDecoration( - Colors.white, + examination + .isNormal + ? Color( + 0xFF515A5D) + : Colors + .white, Colors.grey), child: Center( child: Padding( @@ -173,17 +182,28 @@ class _ObjectivePageState extends State { style: TextStyle( fontSize: 12, color: - Colors.black, + examination + .isNormal + ? Colors.white + : Colors + .black, //Colors.black, fontWeight: - FontWeight - .bold, + FontWeight + .bold, ), ), ), )), ), - onTap: () {}), + onTap: () { + setState(() { + examination.isAbnormal = + !examination.isAbnormal; + examination.isNormal = + !examination.isNormal; + }); + }), SizedBox( width: 12, ), @@ -191,33 +211,49 @@ class _ObjectivePageState extends State { child: Center( child: Container( height: - screenSize.height * - 0.070, + screenSize.height * + 0.070, decoration: - containerBorderDecoration( - Color(0xFF515A5D), - Colors.black), + containerBorderDecoration( + examination + .isAbnormal + ? Color( + 0xFF515A5D) + : Colors + .white, + Colors.black), child: Center( child: Padding( padding: - const EdgeInsets - .all(8.0), + const EdgeInsets + .all(8.0), child: Text( "Abnormal", style: TextStyle( fontSize: 12, color: - Colors.white, + examination + .isAbnormal + ? Colors.white + : Colors + .black, //Colors.black, fontWeight: - FontWeight - .bold, + FontWeight + .bold, ), ), ), )), ), - onTap: () {}), + onTap: () { + setState(() { + examination.isAbnormal = + !examination.isAbnormal; + examination.isNormal = + !examination.isNormal; + }); + }), ], ), InkWell( @@ -267,9 +303,11 @@ class _ObjectivePageState extends State { ), DividerWithSpacesAround(height: 30,), AppButton( - title: TranslationBase.of(context).next, - onPressed: () { - widget.changePageViewIndex(2); + title: TranslationBase + .of(context) + .next, + onPressed: () async { + await submitObjectivePage(model); }, ), SizedBox( @@ -279,7 +317,43 @@ class _ObjectivePageState extends State { ), ), ), - )); + ))); + } + + submitObjectivePage(SOAPViewModel model) async { + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalVM = []; + + postPhysicalExamRequestModel.listHisProgNotePhysicalVM.add( + ListHisProgNotePhysicalVM( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + remarks: exam.remark ?? '', + createdBy: 1485, + createdOn: DateTime.now().toIso8601String(), + editedBy: 1485, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + masterDescription: exam.selectedExamination, + )); + }); + + await model.postPhysicalExam(postPhysicalExamRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + } + // TODO move it back to else stat when it work. + widget.changePageViewIndex(2); + } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index ae024b10..9100cb76 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -140,7 +140,8 @@ class _SubjectivePageState extends State { SizedBox( height: 20, ), - AddMedication(), + // TODO return it back when we need it. + // AddMedication(), ]), ), isExpand: isChiefExpand, @@ -305,9 +306,9 @@ class _SubjectivePageState extends State { remarks: allergy.remark, createdBy: 1485, // - createdOn: "2020-08-14T20:37:22.780Z", + createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", editedBy: 1485, - editedOn: "2020-08-14T20:37:22.780Z", + editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", isChecked: false, isUpdatedByNurse: false)); }); From 47a350a81152e9a4f9af8d3cb2aff53122ce2c1a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 28 Dec 2020 13:05:40 +0200 Subject: [PATCH 055/421] prscription and procedure --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 11 -- lib/util/translations_delegate_base.dart | 8 +- lib/widgets/shared/TextFields.dart | 30 ++++-- lib/widgets/shared/app_buttons_widget.dart | 110 +++++++++----------- lib/widgets/shared/app_text_form_field.dart | 8 +- 6 files changed, 80 insertions(+), 91 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 00ddd293..abf451b8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -113,7 +113,6 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; - // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; @@ -121,7 +120,8 @@ const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f786685a..50d32393 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -276,7 +276,6 @@ const Map> localizedValues = { "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, - 'replySuccessfully': {'en': 'Reply Successfully', 'ar': 'تم الرد بنجاح'}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, @@ -313,7 +312,6 @@ const Map> localizedValues = { 'en': "EXTEND SICK LEAVE", 'ar': 'قم بتمديد الإجازة المرضية' }, - "empty-message": {"en": "Please enter Value", "ar": "يرجى ادخال القيمه"}, "chiefComplaintLength": { "en": "Chief Complaint length should be greater than 25", "ar": "يجب أن يكون طول شكوى الرئيس أكبر من 25" @@ -323,11 +321,6 @@ const Map> localizedValues = { 'en': 'No Prescription Listed', 'ar': 'لا وصفة طبية مدرجة' }, - 'next': {'en': 'Next', 'ar': 'التالي'}, - 'healthRecordInformation': { - 'en': 'HEALTH RECORD INFORMATION', - 'ar': 'معلومات السجل الصحي' - }, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, @@ -360,8 +353,4 @@ const Map> localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, - 'noAppointmentsErrorMsg': { - 'en': "There is no appointments for at this date", - 'ar': 'لا توجد مواعيد في هذا التاريخ' - }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 120667b9..59eda9e0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -344,14 +344,11 @@ class TranslationBase { String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; String get next => localizedValues['next'][locale.languageCode]; - String get healthRecordInformation => - localizedValues['healthRecordInformation'][locale.languageCode]; + String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; - String get emptyMessage => - localizedValues['empty-message'][locale.languageCode]; String get chiefComplaintLength => localizedValues['chiefComplaintLength'][locale.languageCode]; @@ -378,8 +375,7 @@ class TranslationBase { String get reject => localizedValues['reject'][locale.languageCode]; String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; - String get noAppointmentsErrorMsg => - localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; + String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; String get noPrescriptionListed => diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 070f97a3..20885eb3 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -146,15 +146,29 @@ class _TextFieldsState extends State { Widget _buildSuffixIcon() { switch (widget.type) { case "password": - { return Padding( - padding: const EdgeInsets.only(right: 8.0), - child: view ? - InkWell(onTap: () {this.setState(() { view= false; });}, child: Icon(EvaIcons.eye, size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) - : - InkWell(onTap: () {this.setState(() { view= true; });}, child: Icon(EvaIcons.eyeOff, size: 24.0, color: Colors.grey[500])) - );} + { + return Padding( + padding: const EdgeInsets.only(right: 8.0), + child: view + ? InkWell( + onTap: () { + this.setState(() { + view = false; + }); + }, + child: Icon(EvaIcons.eye, + size: 24.0, color: Color.fromRGBO(78, 62, 253, 1.0))) + : InkWell( + onTap: () { + this.setState(() { + view = true; + }); + }, + child: Icon(EvaIcons.eyeOff, + size: 24.0, color: Colors.grey[500]))); + } - break; + break; default: if (widget.suffixIcon != null) return InkWell( diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index ba04e97d..38a66595 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -6,8 +6,6 @@ import 'package:hexcolor/hexcolor.dart'; import 'app_texts_widget.dart'; class AppButton extends StatefulWidget { - - final GestureTapCallback onPressed; final String title; final IconData icon; @@ -26,14 +24,7 @@ class AppButton extends StatefulWidget { this.fontSize = 2, this.padding = 13, this.loading = false, - this.disabled = false}); - AppButton( - {@required this.onPressed, - this.title, - this.icon, - this.color, - this.fontSize = 2, - this.padding = 13, + this.disabled = false, this.fontColor = Colors.white}); _AppButtonState createState() => _AppButtonState(); @@ -42,58 +33,57 @@ class AppButton extends StatefulWidget { class _AppButtonState extends State { @override Widget build(BuildContext context) { - returnIgnorePointer( - ignoring: widget.loading, - child: RawMaterialButton( - fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), - splashColor: widget.color, - child: Padding( - padding: EdgeInsets.only( - top: widget.padding, - bottom: widget.padding, - //right: SizeConfig.widthMultiplier * widget.padding, - //left: SizeConfig.widthMultiplier * widget.padding - ), - child: Row( - mainAxisSize: MainAxisSize.max, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - if (widget.icon != null) - Icon( - widget.icon, - color: Colors.white, - ), - if (widget.icon != null) - SizedBox( - width: 5.0, - ), - widget.loading - ? Padding( - padding: EdgeInsets.all(2.6), - child: SizedBox( - height: 19.0, - width: 19.0, - child: CircularProgressIndicator( - backgroundColor: Colors.white, - valueColor: - AlwaysStoppedAnimation( - Colors.grey[300], + return IgnorePointer( + ignoring: widget.loading, + child: RawMaterialButton( + fillColor: widget.color != null ? widget.color : HexColor("#B8382C"), + splashColor: widget.color, + child: Padding( + padding: EdgeInsets.only( + top: widget.padding, + bottom: widget.padding, + //right: SizeConfig.widthMultiplier * widget.padding, + //left: SizeConfig.widthMultiplier * widget.padding + ), + child: Row( + mainAxisSize: MainAxisSize.max, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.icon != null) + Icon( + widget.icon, + color: Colors.white, + ), + if (widget.icon != null) + SizedBox( + width: 5.0, + ), + widget.loading + ? Padding( + padding: EdgeInsets.all(2.6), + child: SizedBox( + height: 19.0, + width: 19.0, + child: CircularProgressIndicator( + backgroundColor: Colors.white, + valueColor: AlwaysStoppedAnimation( + Colors.grey[300], + ), + ), ), + ) + : AppText( + widget.title.toUpperCase(), + color: widget.fontColor, + fontSize: SizeConfig.textMultiplier * widget.fontSize, ), - ), - ) - : AppText( - widget.title.toUpperCase(), - color: widget.fontColor, - fontSize: SizeConfig.textMultiplier * widget.fontSize, - ), - ], + ], + ), ), + onPressed: widget.onPressed, + shape: const RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(6))), ), - onPressed: widget.onPressed, - shape: const RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(6))), - ), - ); + ); } -} \ No newline at end of file +} diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 256eff5c..4c2573cd 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -43,8 +43,8 @@ class AppTextFormField extends FormField { keyboardType: textInputType, inputFormatters: [ FilteringTextInputFormatter.allow( - RegExp(inputFormatter)),], - + RegExp(inputFormatter)), + ], onChanged: onChanged ?? (value) { state.didChange(value); @@ -62,8 +62,8 @@ class AppTextFormField extends FormField { labelText: labelText, labelStyle: TextStyle( fontSize: SizeConfig.textMultiplier * 1.7, - - ),enabledBorder: OutlineInputBorder( + ), + enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(6)), borderSide: BorderSide( color: borderColor != null From a71da8e4ef3acb556a3149a0829cf541f3fdd66f Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 28 Dec 2020 13:38:13 +0200 Subject: [PATCH 056/421] working on vital signs --- .../service/patient-vital-signs-service.dart | 6 ++---- .../patient-vital-sign-viewModel.dart | 20 +++++++++++-------- .../vital_sign/patient-vital-sign-data.dart | 8 +++----- lib/routes.dart | 3 +++ .../referral/refer-patient-screen.dart | 10 ++-------- lib/screens/patients/vital-signs-screen.dart | 12 +++++++++++ lib/screens/patients/vital-signs.dart | 9 --------- lib/util/helpers.dart | 4 ++-- .../profile/profile_medical_info_widget.dart | 2 +- 9 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 lib/screens/patients/vital-signs-screen.dart delete mode 100644 lib/screens/patients/vital-signs.dart diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 2c7188a4..578aea88 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -45,12 +45,10 @@ class VitalSignsService extends BaseService{ ); } // Vit*/ - Future getPatientVitalSign(patient) async { + Future getPatientVitalSign(/*PatientArrivalEntity patientArrivalEntity*/) async { hasError = false; Map body = Map(); - body['PatientMRN'] = 1; - body['AppointmentNo'] = 1; - body['EpisodeID'] = 1; + body['PatientMRN'] = 50377782; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, diff --git a/lib/core/viewModel/patient-vital-sign-viewModel.dart b/lib/core/viewModel/patient-vital-sign-viewModel.dart index 255ab5bd..30f979f3 100644 --- a/lib/core/viewModel/patient-vital-sign-viewModel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewModel.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-vital-signs-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; import '../../locator.dart'; @@ -8,20 +9,23 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel{ VitalSignsService _vitalSignService = locator(); - List get patientVitalSignList => - _vitalSignService.patientVitalSignList; + VitalSignData get patientVitalSigns => + _vitalSignService.patientVitalSigns; - List get patientVitalSignOrderdSubList => - _vitalSignService.patientVitalSignOrderdSubList; - - Future getPatientVitalSign(patient) async { + Future getPatientVitalSign() async { setState(ViewState.Busy); - await _vitalSignService.getPatientVitalSign(patient); + await _vitalSignService.getPatientVitalSign(); if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); - } else + } else { + if(patientVitalSigns == null) { + _vitalSignService.patientVitalSigns = VitalSignData( + appointmentNo: 2016053265, bloodPressureCuffLocation: 0, bloodPressureCuffSize: 0, bloodPressureHigher: 38, + ); + } setState(ViewState.Idle); + } } } \ No newline at end of file diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index b5c46aa6..5d20e017 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,5 +1,4 @@ class VitalSignData { - int appointmentNo; int bloodPressureCuffLocation; int bloodPressureCuffSize; @@ -33,7 +32,7 @@ class VitalSignData { int weightKg; VitalSignData( - this.appointmentNo, + {this.appointmentNo, this.bloodPressureCuffLocation, this.bloodPressureCuffSize, this.bloodPressureHigher, @@ -63,7 +62,7 @@ class VitalSignData { this.temperatureCelcius, this.temperatureCelciusMethod, this.waistSizeInch, - this.weightKg); + this.weightKg}); VitalSignData.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -134,5 +133,4 @@ class VitalSignData { data['weightKg'] = this.weightKg; return data; } - -} \ No newline at end of file +} diff --git a/lib/routes.dart b/lib/routes.dart index 5d8b730a..257db6fc 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -40,6 +40,7 @@ import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; +import 'screens/patients/vital-signs-screen.dart'; const String INIT_ROUTE = ROOT; const String ROOT = 'root'; @@ -74,6 +75,7 @@ const String PATIENT_ORDERS = 'patients/patient_orders'; const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; +const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String CREATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; @@ -113,6 +115,7 @@ var routes = { PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), CREATE_EPISODE:(_)=>AddSOAPIndex(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index b6287cd9..2ab7cc18 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -6,6 +6,7 @@ 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/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_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -64,14 +65,7 @@ class _PatientMakeReferralScreenState extends State { children: [ Column( children: [ - Container( - height: 75, - child: AppText( - "This is where upper view for avatar.. etc placed", - fontWeight: FontWeight.normal, - fontSize: 16, - ), - ), + PatientPageHeaderWidget(patient), const Divider( color: Color(0xffCCCCCC), height: 1, diff --git a/lib/screens/patients/vital-signs-screen.dart b/lib/screens/patients/vital-signs-screen.dart new file mode 100644 index 00000000..6aeb5b3e --- /dev/null +++ b/lib/screens/patients/vital-signs-screen.dart @@ -0,0 +1,12 @@ +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/material.dart'; + +class PatientVitalSignScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return Container(); + } +} diff --git a/lib/screens/patients/vital-signs.dart b/lib/screens/patients/vital-signs.dart deleted file mode 100644 index b6df3236..00000000 --- a/lib/screens/patients/vital-signs.dart +++ /dev/null @@ -1,9 +0,0 @@ -import 'package:flutter/material.dart'; - -class PatientVitalSignScreen extends StatelessWidget { - @override - Widget build(BuildContext context) { - - return Container(); - } -} diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 0c3f1b5f..5c2d6615 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -348,7 +348,7 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - // Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); - Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); + Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d9c0f796..9d97a1ad 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -39,7 +39,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, + route: PATIENT_VITAL_SIGN, icon: 'heartbeat.png'), PatientProfileButton( key: key, From f97d11183dd39b130e9f6ee9a1c5dfa71a3d9a46 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 14:42:04 +0200 Subject: [PATCH 057/421] progress Note --- .../post_progress_note_request_model.dart | 25 +++++++++ lib/models/patient/patiant_info_model.dart | 17 ------ .../patients/profile/SOAP/objective_page.dart | 13 +++-- .../patients/profile/SOAP/plan_page.dart | 53 ++++++++++++------- 4 files changed, 65 insertions(+), 43 deletions(-) create mode 100644 lib/models/SOAP/post_progress_note_request_model.dart diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart new file mode 100644 index 00000000..7bbea882 --- /dev/null +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -0,0 +1,25 @@ +class PostProgressNoteRequestModel { + int appointmentNo; + int episodeId; + int patientMRN; + String planNote; + + PostProgressNoteRequestModel( + {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + + PostProgressNoteRequestModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + episodeId = json['episodeId']; + patientMRN = json['patientMRN']; + planNote = json['planNote']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['episodeId'] = this.episodeId; + data['patientMRN'] = this.patientMRN; + data['planNote'] = this.planNote; + return data; + } +} diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2b2fd876..9eec55ca 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,20 +1,3 @@ -import 'dart:convert'; - -//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str)); - -////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson()); -//****************************** */ - -/* - *@author: Amjad Amireh - *@Date:27/4/2020 - *@param: - *@return:Patian information Model - - *@desc: - */ - - class PatiantInformtion { final List list; diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 894f7745..922314b9 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -303,13 +303,12 @@ class _ObjectivePageState extends State { ), DividerWithSpacesAround(height: 30,), AppButton( - title: TranslationBase - .of(context) - .next, - onPressed: () async { - await submitObjectivePage(model); - }, - ), + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitObjectivePage(model); + }, + ), SizedBox( height: 30, ), diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 7b5ddcdc..9bf907d9 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; @@ -42,7 +44,9 @@ class _PlanPageState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return AppScaffold( + return BaseView( + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -98,7 +102,7 @@ class _PlanPageState extends State { hintText: "Add Progress Note", fontSize: 13.5, onTapTextFields: () { - openExaminationList(context); + openProgressNote(context); }, readOnly: true, // hintColor: Colors.black, @@ -159,10 +163,14 @@ class _PlanPageState extends State { ), Padding( padding: const EdgeInsets.all(0.0), - child: AppText( - "Some progress note about", - fontSize: 10, - color: Colors.grey, + child: Container( + width: MediaQuery.of(context).size.width * 0.6, + child: AppText( + progressNoteController.text, + fontSize: 10, + + color: Colors.grey, + ), ), ), ], @@ -207,7 +215,9 @@ class _PlanPageState extends State { Column( children: [ InkWell( - onTap: () {}, + onTap: () { + openProgressNote(context); + }, child: Icon(EvaIcons.edit2Outline), ) ], @@ -227,20 +237,22 @@ class _PlanPageState extends State { widget.changePageViewIndex(2); }, ), - SizedBox( - height: 30, + SizedBox( + height: 30, + ), + ], ), - ], + ), ), - ), - ), - )); + ),),); } - openExaminationList(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { + openProgressNote(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -291,7 +303,7 @@ class _PlanPageState extends State { Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: TextFields( - hintText: "Remarks", + hintText: "Add progress note here", fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -300,7 +312,9 @@ class _PlanPageState extends State { controller: progressNoteController, validator: (value) { if (value == null) - return TranslationBase.of(context).emptyMessage; + return TranslationBase + .of(context) + .emptyMessage; else return null; }), @@ -310,6 +324,7 @@ class _PlanPageState extends State { AppButton( title: "Add".toUpperCase(), onPressed: () { + Navigator.of(context).pop(); }, ), ]), From b22fd3f7ba48aac707fd3c91e9107b1a07d2f482 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 15:59:06 +0200 Subject: [PATCH 058/421] fix listHisProgNotePhysicalExaminationVM --- .../post_physical_exam_request_model.dart | 26 +++++++++---------- .../patients/profile/SOAP/objective_page.dart | 10 ++++--- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index f9f23897..adc8daf7 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,31 +1,31 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class PostPhysicalExamRequestModel { - List listHisProgNotePhysicalVM; + List listHisProgNotePhysicalExaminationVM; - PostPhysicalExamRequestModel({this.listHisProgNotePhysicalVM}); + PostPhysicalExamRequestModel({this.listHisProgNotePhysicalExaminationVM}); PostPhysicalExamRequestModel.fromJson(Map json) { - if (json['listHisProgNotePhysicalVM'] != null) { - listHisProgNotePhysicalVM = new List(); - json['listHisProgNotePhysicalVM'].forEach((v) { - listHisProgNotePhysicalVM - .add(new ListHisProgNotePhysicalVM.fromJson(v)); + if (json['listHisProgNotePhysicalExaminationVM'] != null) { + listHisProgNotePhysicalExaminationVM = new List(); + json['listHisProgNotePhysicalExaminationVM'].forEach((v) { + listHisProgNotePhysicalExaminationVM + .add(new ListHisProgNotePhysicalExaminationVM.fromJson(v)); }); } } Map toJson() { final Map data = new Map(); - if (this.listHisProgNotePhysicalVM != null) { - data['listHisProgNotePhysicalVM'] = - this.listHisProgNotePhysicalVM.map((v) => v.toJson()).toList(); + if (this.listHisProgNotePhysicalExaminationVM != null) { + data['listHisProgNotePhysicalExaminationVM'] = + this.listHisProgNotePhysicalExaminationVM.map((v) => v.toJson()).toList(); } return data; } } -class ListHisProgNotePhysicalVM { +class ListHisProgNotePhysicalExaminationVM { int episodeId; int appointmentNo; int examType; @@ -41,7 +41,7 @@ class ListHisProgNotePhysicalVM { bool notExamined; MasterKeyModel masterDescription; - ListHisProgNotePhysicalVM( + ListHisProgNotePhysicalExaminationVM( {this.episodeId, this.appointmentNo, this.examType, @@ -57,7 +57,7 @@ class ListHisProgNotePhysicalVM { this.notExamined, this.masterDescription}); - ListHisProgNotePhysicalVM.fromJson(Map json) { + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { episodeId = json['episodeId']; appointmentNo = json['appointmentNo']; examType = json['examType']; diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 922314b9..5f9d6f2c 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -322,12 +322,12 @@ class _ObjectivePageState extends State { submitObjectivePage(SOAPViewModel model) async { PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalVM == + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == null) - postPhysicalExamRequestModel.listHisProgNotePhysicalVM = []; + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalVM.add( - ListHisProgNotePhysicalVM( + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + ListHisProgNotePhysicalExaminationVM( patientMRN: 3120690, episodeId: 200012117, appointmentNo: 2016054573, @@ -341,6 +341,8 @@ class _ObjectivePageState extends State { isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, masterDescription: exam.selectedExamination, + notExamined: false + )); }); From dc4250a4def72b8846f7c4146eb5e03761fe3457 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 18:45:15 +0200 Subject: [PATCH 059/421] Post progress Note --- lib/config/config.dart | 1 + lib/core/service/SOAP_service.dart | 34 ++- lib/core/viewModel/SOAP_view_model.dart | 11 + .../post_progress_note_request_model.dart | 16 +- lib/util/helpers.dart | 5 +- .../patients/profile/SOAP/add_SOAP_index.dart | 11 +- .../patients/profile/SOAP/objective_page.dart | 57 ++-- .../patients/profile/SOAP/plan_page.dart | 282 +++++++++--------- 8 files changed, 230 insertions(+), 187 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 8d6c0935..bc2fd0db 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -108,6 +108,7 @@ const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; var selectedPatientType = 1; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 44b304fc..e5d2023c 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'base/lookup-service.dart'; @@ -56,20 +57,33 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: postChiefComplaintRequestModel.toJson()); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postChiefComplaintRequestModel.toJson()); } - Future postPhysicalExam(PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { + Future postPhysicalExam( + PostPhysicalExamRequestModel postPhysicalExamRequestModel) async { hasError = false; await baseAppClient.post(POST_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { - print("Success"); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: postPhysicalExamRequestModel.toJson()); + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postPhysicalExamRequestModel.toJson()); + } + + Future postProgressNote( + PostProgressNoteRequestModel postProgressNoteRequestModel) async { + hasError = false; + await baseAppClient.post(POST_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postProgressNoteRequestModel.toJson()); } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index f43306f0..b9a96f6c 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -94,5 +95,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future postProgressNote(PostProgressNoteRequestModel postProgressNoteRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postProgressNote(postProgressNoteRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 7bbea882..2217d4ee 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -8,18 +8,18 @@ class PostProgressNoteRequestModel { {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); PostProgressNoteRequestModel.fromJson(Map json) { - appointmentNo = json['appointmentNo']; - episodeId = json['episodeId']; - patientMRN = json['patientMRN']; - planNote = json['planNote']; + appointmentNo = json['AppointmentNo']; + episodeId = json['EpisodeId']; + patientMRN = json['PatientMRN']; + planNote = json['PlanNote']; } Map toJson() { final Map data = new Map(); - data['appointmentNo'] = this.appointmentNo; - data['episodeId'] = this.episodeId; - data['patientMRN'] = this.patientMRN; - data['planNote'] = this.planNote; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeId'] = this.episodeId; + data['PatientMRN'] = this.patientMRN; + data['PlanNote'] = this.planNote; return data; } } diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 0c3f1b5f..c1d70cef 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -348,7 +348,8 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - // Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); - Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); + Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + // TODO Fix it + // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } } diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 705bc85f..f1d81812 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -108,10 +108,13 @@ class _AddSOAPIndexState extends State ), ], ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, + Container( + width: MediaQuery.of(context).size.width *0.65, + child: AppText( + "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), ), ], ) diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 5f9d6f2c..add9ca16 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -320,38 +320,41 @@ class _ObjectivePageState extends State { } submitObjectivePage(SOAPViewModel model) async { - PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + if(widget.mySelectedExamination.isNotEmpty){ + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - ListHisProgNotePhysicalExaminationVM( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, - remarks: exam.remark ?? '', - createdBy: 1485, - createdOn: DateTime.now().toIso8601String(), - editedBy: 1485, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - masterDescription: exam.selectedExamination, - notExamined: false + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + ListHisProgNotePhysicalExaminationVM( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + remarks: exam.remark ?? '', + createdBy: 1485, + createdOn: DateTime.now().toIso8601String(), + editedBy: 1485, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + masterDescription: exam.selectedExamination, + notExamined: false - )); - }); + )); + }); - await model.postPhysicalExam(postPhysicalExamRequestModel); + await model.postPhysicalExam(postPhysicalExamRequestModel); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + } } + // TODO move it back to else stat when it work. widget.changePageViewIndex(2); diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 9bf907d9..3e5ca10a 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -1,5 +1,8 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -27,7 +30,9 @@ class _PlanPageState extends State { List progressNoteList; - TextEditingController progressNoteController = TextEditingController(); + TextEditingController progressNoteController = + TextEditingController(text: null); + BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { return BoxDecoration( @@ -40,6 +45,7 @@ class _PlanPageState extends State { )), ); } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -112,7 +118,8 @@ class _PlanPageState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase.of(context) + return TranslationBase + .of(context) .emptyMessage; else return null; @@ -121,110 +128,117 @@ class _PlanPageState extends State { SizedBox( height: 20, ), - Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ + if (progressNoteController.text.isNotEmpty) + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Padding( - padding: const EdgeInsets.all(0.0), - child: Container( - width: MediaQuery.of(context).size.width * 0.6, - child: AppText( - progressNoteController.text, - fontSize: 10, + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Padding( + padding: const EdgeInsets.all(0.0), + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.6, + child: AppText( + progressNoteController.text, + fontSize: 10, - color: Colors.grey, + color: Colors.grey, + ), ), ), - ), - ], - ),SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Created By : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah on 12 De", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Edited By : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Rahim on 13 Dec", - fontSize: 10, - color: Colors.grey, - ), - ], - ), + ], + ), SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Created By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah on 12 De", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Edited By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Rahim on 13 Dec", + fontSize: 10, + color: Colors.grey, + ), + ], + ), - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openProgressNote(context); - }, - child: Icon(EvaIcons.edit2Outline), - ) - ], - ), - ], - ), - ) + ], + ), + Column( + children: [ + InkWell( + onTap: () { + openProgressNote(context); + }, + child: Icon(EvaIcons.edit2Outline), + ) + ], + ), + ], + ), + ) ], ) ]), @@ -232,50 +246,46 @@ class _PlanPageState extends State { ), DividerWithSpacesAround(height: 30,), AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase + .of(context) + .next, + loading: model.state == ViewState.BusyLocal, onPressed: () { - widget.changePageViewIndex(2); + + submitPlan(model); + // widget.changePageViewIndex(2); }, ), - SizedBox( - height: 30, - ), - ], + SizedBox( + height: 30, ), - ), + ], ), - ),),); + ), + ), + ),),); } - openProgressNote(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); + submitPlan(SOAPViewModel model) async { + if (progressNoteController.text.isNotEmpty) { + PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + planNote: progressNoteController.text); + + + await model.postProgressNote(postProgressNoteRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + } } + } - ; + openProgressNote(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, From 1672d9a3a0ef83bfd777a3f120617b3d05a0034a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 20:42:24 +0200 Subject: [PATCH 060/421] add assessment_page code --- lib/core/enum/master_lookup_key.dart | 9 +- lib/core/service/base/lookup-service.dart | 17 + lib/core/viewModel/SOAP_view_model.dart | 2 + lib/models/SOAP/my_selected_assement.dart | 47 + .../patients/profile/SOAP/add_SOAP_index.dart | 4 +- .../profile/SOAP/assessment_page.dart | 931 ++++++++++-------- 6 files changed, 598 insertions(+), 412 deletions(-) create mode 100644 lib/models/SOAP/my_selected_assement.dart diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index 03937710..a4010858 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -7,7 +7,9 @@ enum MasterKeysService { HistorySurgical, PhysicalExamination, AllergySeverity, - physiotherapyGoals + physiotherapyGoals, + DiagnosisCondition, + DiagnosisType } extension SelectedMasterKeysService on MasterKeysService { @@ -40,6 +42,11 @@ extension SelectedMasterKeysService on MasterKeysService { break; case MasterKeysService.physiotherapyGoals: return 117; + break;case MasterKeysService.DiagnosisCondition: + return 34; + break; + case MasterKeysService.DiagnosisType: + return 35; break; } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 02371dd8..2053eb15 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -31,6 +31,8 @@ class LookupService extends BaseService { List _physicalExaminationList = []; List listOfPhysiotherapyGoals = []; + List listOfDiagnosisType = []; + List listOfDiagnosisCondition = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -111,6 +113,21 @@ class LookupService extends BaseService { .add(MasterKeyModel.fromJson(v)); }); break; + + case MasterKeysService.DiagnosisType: + listOfDiagnosisType.clear(); + entryList.forEach((v) { + listOfDiagnosisType + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.DiagnosisCondition: + listOfDiagnosisCondition.clear(); + entryList.forEach((v) { + listOfDiagnosisCondition + .add(MasterKeyModel.fromJson(v)); + }); + break; } } } \ No newline at end of file diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index b9a96f6c..e8cde824 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -32,6 +32,8 @@ class SOAPViewModel extends BaseViewModel { List get historySurgicalList => _SOAPService.historySurgicalList; List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList]; List get physicalExaminationList => _SOAPService.physicalExaminationList; + List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; + List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart new file mode 100644 index 00000000..b5f82379 --- /dev/null +++ b/lib/models/SOAP/my_selected_assement.dart @@ -0,0 +1,47 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedAssessment { + MasterKeyModel selectedICD; + MasterKeyModel selectedDiagnosisCondition; + MasterKeyModel selectedDiagnosisType; + String remark; + int appointmentId; + + MySelectedAssessment( + {this.selectedICD, + this.selectedDiagnosisCondition, + this.selectedDiagnosisType, + this.remark, this.appointmentId}); + + MySelectedAssessment.fromJson(Map json) { + selectedICD = json['selectedICD'] != null + ? new MasterKeyModel.fromJson(json['selectedICD']) + : null; + selectedDiagnosisCondition = json['selectedDiagnosisCondition'] != null + ? new MasterKeyModel.fromJson(json['selectedDiagnosisCondition']) + : null; + selectedDiagnosisType = json['selectedDiagnosisType'] != null + ? new MasterKeyModel.fromJson(json['selectedDiagnosisType']) + : null; + remark = json['remark']; + appointmentId = json['appointmentId']; + } + + Map toJson() { + final Map data = new Map(); + + if (this.selectedICD != null) { + data['selectedICD'] = this.selectedICD.toJson(); + } + if (this.selectedDiagnosisCondition != null) { + data['selectedICD'] = this.selectedDiagnosisCondition.toJson(); + } + if (this.selectedDiagnosisType != null) { + data['selectedICD'] = this.selectedDiagnosisType.toJson(); + } + data['remark'] = this.remark; + data['appointmentId'] = this.appointmentId; + + return data; + } +} diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index f1d81812..a6f792c8 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart' import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -32,6 +33,7 @@ class _AddSOAPIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); + MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -159,7 +161,7 @@ class _AddSOAPIndexState extends State children: [ SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), - AssessmentPage(changePageViewIndex: changePageViewIndex,), + AssessmentPage(changePageViewIndex: changePageViewIndex,mySelectedAssessment:mySelectedAssessment), PlanPage(changePageViewIndex: changePageViewIndex,) ], ), diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 2f747d52..3bd9f0f1 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -1,11 +1,16 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -14,8 +19,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class AssessmentPage extends StatefulWidget { final Function changePageViewIndex; + final MySelectedAssessment mySelectedAssessment; - AssessmentPage({Key key, this.changePageViewIndex}); + AssessmentPage( + {Key key, this.changePageViewIndex, this.mySelectedAssessment}); @override _AssessmentPageState createState() => _AssessmentPageState(); @@ -33,61 +40,64 @@ class _AssessmentPageState extends State { Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; - return AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('ASSESSMENT', - variant: isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column(children: [ + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ SizedBox( - height: 20, + height: 30, ), - Column( - children: [ - Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 15), - child: TextFields( - hintText: "Add ASSESSMENT", - fontSize: 13.5, - onTapTextFields: () { - openAssessmentDialog(context); + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('ASSESSMENT', + variant: + isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: TextFields( + hintText: "Add ASSESSMENT", + fontSize: 13.5, + onTapTextFields: () { + openAssessmentDialog(context); + }, readOnly: true, // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, @@ -96,184 +106,247 @@ class _AssessmentPageState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase.of(context) + return TranslationBase + .of(context) .emptyMessage; else return null; }), + ), + SizedBox( + height: 20, + ), + if(widget.mySelectedAssessment != null && + widget.mySelectedAssessment + .appointmentId != + null && widget.mySelectedAssessment + .selectedDiagnosisType != null && + widget.mySelectedAssessment + .selectedDiagnosisCondition != null) + Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Appointment #: ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.mySelectedAssessment + .appointmentId + .toString(), + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameEn, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Type : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.mySelectedAssessment + .selectedDiagnosisType + .nameEn, + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Doc : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + "Some short remark about the allergy", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + + children: [ + AppText( + "ICD: ".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "R07.1".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + children: [ + InkWell( + onTap: () {}, + child: Icon(EvaIcons + .edit2Outline), + ) + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isAssessmentExpand, + ), + DividerWithSpacesAround( + height: 30, + ), + AppButton( + title: TranslationBase + .of(context) + .next, + onPressed: () { + widget.changePageViewIndex(3); + }, ), SizedBox( - height: 20, + height: 30, ), - Container( - margin: EdgeInsets.only(left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Appointment #: ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "2019054946", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Typhoid Fever", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Type : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Possible Diagnosis", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Doc : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - "Some short remark about the allergy", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - - children: [ - AppText( - "ICD: ".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "R07.1".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - children: [ - InkWell( - onTap: () {}, - child: Icon(EvaIcons.edit2Outline), - ) - ], - ), - ], - ), - ) ], - ) - ]), - isExpand: isAssessmentExpand, - ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase.of(context).next, - onPressed: () { - widget.changePageViewIndex(3); - }, - ), - SizedBox( - height: 30, + ), + ), ), - ], - ), - ), - ), - )); + ))); } openAssessmentDialog(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddAssessmentDetails( + mySelectedAssessment: widget.mySelectedAssessment, + addSelectedAssessment: () { + setState(() { + Navigator.of(context).pop(); + }); + }); + }); + } + +} + +class AddAssessmentDetails extends StatefulWidget { + final MySelectedAssessment mySelectedAssessment; + final Function() addSelectedAssessment; + + const AddAssessmentDetails( + {Key key, this.mySelectedAssessment, this.addSelectedAssessment}) + : super(key: key); + + @override + _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); +} + +class _AddAssessmentDetailsState extends State { + MasterKeyModel _selectedDiagnosisCondition; + MasterKeyModel _selectedDiagnosisType; + TextEditingController remarkController = TextEditingController(); + TextEditingController appointmentIdController = TextEditingController( + text: "234567"); + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { //TODO: make one Input InputDecoration for all return InputDecoration( focusedBorder: OutlineInputBorder( @@ -296,199 +369,237 @@ class _AssessmentPageState extends State { ), ); } - - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return FractionallySizedBox( - heightFactor: 0.75, - widthFactor: 0.9, - - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Add Assessment Details".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: assessmentList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: assessmentList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { + return FractionallySizedBox( + heightFactor: 0.75, + child: BaseView( + onModelReady: (model) async { + if (model.listOfDiagnosisCondition.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (model.listOfDiagnosisType.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisType); + } + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Assessment Details".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Appointment Number", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + readOnly: true, + controller: appointmentIdController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisCondition != + null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase + .of(context) + .ok, + okFunction: ( + MasterKeyModel selectedValue) { + setState(() { + _selectedDiagnosisCondition = + selectedValue; + widget.mySelectedAssessment + .selectedDiagnosisCondition = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Condition", + _selectedDiagnosisCondition != null + ? _selectedDiagnosisCondition + .nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisCondition != + null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase + .of(context) + .ok, + okFunction: ( + MasterKeyModel selectedValue) { + setState(() { + _selectedDiagnosisCondition = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Condition", + _selectedDiagnosisCondition != null + ? _selectedDiagnosisCondition + .nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase + .of(context) + .ok, + okFunction: ( + MasterKeyModel selectedValue) { + setState(() { + _selectedDiagnosisType = + selectedValue; + widget.mySelectedAssessment + .selectedDiagnosisType = + _selectedDiagnosisType; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Type", + _selectedDiagnosisType != null + ? _selectedDiagnosisType.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 18, + minLines: 5, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { setState(() { - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); + widget.mySelectedAssessment.remark = + remarkController.text; + widget.mySelectedAssessment + .appointmentId = int.parse( + appointmentIdController.text); + + widget.addSelectedAssessment(); }); }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Appointment Number", - _referTo != null ? _referTo['name'] : null, - true), - enabled: false, - ), - ), + ), + ])), ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: assessmentList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: assessmentList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() {}); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration("Name or ICD", - _referTo != null ? _referTo['name'] : null, true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: assessmentList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: assessmentList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() {}); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration("Condition", - _referTo != null ? _referTo['name'] : null, true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: assessmentList != null - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: assessmentList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() {}); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration("Type", - _referTo != null ? _referTo['name'] : null, true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 18, - minLines: 8, - controller: remarksController, - validator: (value) { - if (value == null) - return TranslationBase.of(context).emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () {}, - ), - ])), - ); - }); + ), + ))), + ); } } + From ab9740ccdd7a3da12a28a54def11a7754078b6a2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 28 Dec 2020 20:51:16 +0200 Subject: [PATCH 061/421] remove Vida Auth from config --- lib/config/config.dart | 2 -- pubspec.lock | 12 ++++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 51dd4e37..edb34b5e 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -180,8 +180,6 @@ const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; const PATIENT_OUT_SA = false; -const VIDA_AUTH = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiMmI5ZTZlYmYtZmYzMC00ZmEyLTgwYjUtZGJlODM2MmZlNmNhIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1NzU3MTYiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwNzk3Mjk1MCwiZXhwIjoxNjA4ODM2OTUwLCJpYXQiOjE2MDc5NzI5NTB9.nHDltbMuIA3o4Gqa7mQ88fowDy6Oey9fG1zF45dumec'; /// Timer Info const TIMER_MIN = 10; diff --git a/pubspec.lock b/pubspec.lock index 0135ce10..ce581365 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -7,14 +7,14 @@ packages: name: _fe_analyzer_shared url: "https://pub.dartlang.org" source: hosted - version: "14.0.0" + version: "12.0.0" analyzer: dependency: transitive description: name: analyzer url: "https://pub.dartlang.org" source: hosted - version: "0.41.1" + version: "0.40.6" archive: dependency: transitive description: @@ -112,7 +112,7 @@ packages: name: build_web_compilers url: "https://pub.dartlang.org" source: hosted - version: "2.15.3" + version: "2.12.2" built_collection: dependency: transitive description: @@ -475,7 +475,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: @@ -732,7 +732,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: @@ -867,5 +867,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.11.0-162.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0" From 7c4e0d929f2eae3d824396a8286901d841fcfc4b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 29 Dec 2020 14:17:19 +0200 Subject: [PATCH 062/421] fix base app client --- ios/Podfile.lock | 56 ++++++++++++++++++++++++++++++--- lib/client/base_app_client.dart | 53 +++++++++++++++++-------------- 2 files changed, 82 insertions(+), 27 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 0575cdb6..62e86469 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -7,6 +7,8 @@ PODS: - connectivity (0.0.1): - Flutter - Reachability + - connectivity_for_web (0.1.0): + - Flutter - connectivity_macos (0.0.1): - Flutter - device_info (0.0.1): @@ -22,17 +24,27 @@ PODS: - Flutter - local_auth (0.0.1): - Flutter + - maps_launcher (0.0.1): + - Flutter - MTBBarcodeScanner (5.0.11) - OpenTok (2.15.3) - - "permission_handler (5.0.0+hotfix.5)": + - path_provider_linux (0.0.1): + - Flutter + - path_provider_windows (0.0.1): + - Flutter + - "permission_handler (5.0.1+1)": - Flutter - Reachability (3.2) - shared_preferences (0.0.1): - Flutter + - shared_preferences_linux (0.0.1): + - Flutter - shared_preferences_macos (0.0.1): - Flutter - shared_preferences_web (0.0.1): - Flutter + - shared_preferences_windows (0.0.1): + - Flutter - speech_to_text (0.0.1): - Flutter - Try @@ -40,15 +52,20 @@ PODS: - Try (2.1.1) - url_launcher (0.0.1): - Flutter + - url_launcher_linux (0.0.1): + - Flutter - url_launcher_macos (0.0.1): - Flutter - url_launcher_web (0.0.1): - Flutter + - url_launcher_windows (0.0.1): + - Flutter DEPENDENCIES: - Alamofire - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`) + - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - device_info (from `.symlinks/plugins/device_info/ios`) - Flutter (from `Flutter`) @@ -57,15 +74,22 @@ DEPENDENCIES: - hexcolor (from `.symlinks/plugins/hexcolor/ios`) - imei_plugin (from `.symlinks/plugins/imei_plugin/ios`) - local_auth (from `.symlinks/plugins/local_auth/ios`) + - maps_launcher (from `.symlinks/plugins/maps_launcher/ios`) - OpenTok + - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) + - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) + - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) - shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`) + - shared_preferences_windows (from `.symlinks/plugins/shared_preferences_windows/ios`) - speech_to_text (from `.symlinks/plugins/speech_to_text/ios`) - url_launcher (from `.symlinks/plugins/url_launcher/ios`) + - url_launcher_linux (from `.symlinks/plugins/url_launcher_linux/ios`) - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) + - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) SPEC REPOS: trunk: @@ -81,6 +105,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/barcode_scan/ios" connectivity: :path: ".symlinks/plugins/connectivity/ios" + connectivity_for_web: + :path: ".symlinks/plugins/connectivity_for_web/ios" connectivity_macos: :path: ".symlinks/plugins/connectivity_macos/ios" device_info: @@ -97,27 +123,42 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/imei_plugin/ios" local_auth: :path: ".symlinks/plugins/local_auth/ios" + maps_launcher: + :path: ".symlinks/plugins/maps_launcher/ios" + path_provider_linux: + :path: ".symlinks/plugins/path_provider_linux/ios" + path_provider_windows: + :path: ".symlinks/plugins/path_provider_windows/ios" permission_handler: :path: ".symlinks/plugins/permission_handler/ios" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" + shared_preferences_linux: + :path: ".symlinks/plugins/shared_preferences_linux/ios" shared_preferences_macos: :path: ".symlinks/plugins/shared_preferences_macos/ios" shared_preferences_web: :path: ".symlinks/plugins/shared_preferences_web/ios" + shared_preferences_windows: + :path: ".symlinks/plugins/shared_preferences_windows/ios" speech_to_text: :path: ".symlinks/plugins/speech_to_text/ios" url_launcher: :path: ".symlinks/plugins/url_launcher/ios" + url_launcher_linux: + :path: ".symlinks/plugins/url_launcher_linux/ios" url_launcher_macos: :path: ".symlinks/plugins/url_launcher_macos/ios" url_launcher_web: :path: ".symlinks/plugins/url_launcher_web/ios" + url_launcher_windows: + :path: ".symlinks/plugins/url_launcher_windows/ios" SPEC CHECKSUMS: Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 - connectivity: 6e94255659cc86dcbef1d452ad3e0491bb1b3e75 + connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 + connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec @@ -126,20 +167,27 @@ SPEC CHECKSUMS: hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd + maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 - permission_handler: 6226fcb78b97c7c7458a95c7346a11d5184fec12 + path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 + path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b + permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d + shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9 + shared_preferences_windows: 36b76d6f54e76ead957e60b49e2f124b4cd3e6ae speech_to_text: b43a7d99aef037bd758ed8e45d79bbac035d2dfe SwiftProtobuf: ecbec1be9036d15655f6b3443a1c4ea693c97932 Try: 5ef669ae832617b3cee58cb2c6f99fb767a4ff96 url_launcher: 6fef411d543ceb26efce54b05a0a40bfd74cbbef + url_launcher_linux: ac237cb7a8058736e4aae38bdbcc748a4b394cc0 url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c + url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.9.3 +COCOAPODS: 1.10.0 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ed14ecac..db4e7a56 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -41,6 +41,8 @@ class BaseAppClient { if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + body.containsKey('patientArrivalList'); + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; @@ -79,7 +81,7 @@ class BaseAppClient { 'Accept': 'application/json' }); final int statusCode = response.statusCode; - if (statusCode < 200 || statusCode >= 400 || json == null) { + if (statusCode < 200 || statusCode >= 400 ) { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); @@ -90,29 +92,12 @@ class BaseAppClient { // helpers.showErrorToast('Your session expired Please login agian'); // } else if (parsed['MessageStatus'] == 1) { - onSuccess(parsed, statusCode); + if(!parsed['IsAuthenticated']) + onFailure(getError(parsed), statusCode); + else + onSuccess(parsed, statusCode); } else { - String error = - parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; - - if (parsed["ValidationErrors"] != null) { - error = - parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; - - if (parsed["ValidationErrors"]["ValidationErrors"] != null && - parsed["ValidationErrors"]["ValidationErrors"].length != 0) { - for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { - error = error + - parsed["ValidationErrors"]["ValidationErrors"][i] - ["Messages"][0] + - "\n"; - } - } - } - - onFailure(error, statusCode); + onFailure(getError(parsed), statusCode); } } } else { @@ -123,4 +108,26 @@ class BaseAppClient { onFailure(e.toString(), -1); } } + + String getError(parsed){ + //TODO change this fun + String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; + if (parsed["ValidationErrors"] != null) { + + error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; + + if (parsed["ValidationErrors"]["ValidationErrors"] != null && + parsed["ValidationErrors"]["ValidationErrors"].length != 0) { + for (var i = 0; + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { + error = error + + parsed["ValidationErrors"]["ValidationErrors"][i] + ["Messages"][0] + + "\n"; + } + } + } + return error; + } } From df838831399006a140896369b94ef7fa9cd1a582 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 29 Dec 2020 14:17:35 +0200 Subject: [PATCH 063/421] fix base app client --- lib/client/base_app_client.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index db4e7a56..015cf0f5 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -40,9 +40,6 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - - body.containsKey('patientArrivalList'); - if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; From c7bfe24207b809cf57c25a85d19e265a6fc7df20 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 29 Dec 2020 14:32:06 +0200 Subject: [PATCH 064/421] post procedure --- lib/client/base_app_client.dart | 17 +-- lib/config/config.dart | 2 + .../model/procedure/categories_procedure.dart | 18 +++ lib/core/service/prescription_service.dart | 19 ++- lib/core/service/procedure_service.dart | 32 +++- lib/core/viewModel/procedure_View_model.dart | 28 ++++ .../prescription/prescription_screen.dart | 5 +- lib/screens/procedures/procedure_screen.dart | 144 +++++++++++------- 8 files changed, 192 insertions(+), 73 deletions(-) create mode 100644 lib/core/model/procedure/categories_procedure.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ed14ecac..46dd9290 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -83,13 +83,12 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - // if (!parsed['IsAuthenticated']) { - // // TODO: return it back when IsAuthenticated work fine in all service - // // await helpers.logout(); - // - // helpers.showErrorToast('Your session expired Please login agian'); - // } else - if (parsed['MessageStatus'] == 1) { + if (!parsed['IsAuthenticated']) { + // TODO: return it back when IsAuthenticated work fine in all service + // await helpers.logout(); + // + // helpers.showErrorToast('Your session expired Please login agian'); + } else if (parsed['MessageStatus'] == 1) { onSuccess(parsed, statusCode); } else { String error = @@ -102,8 +101,8 @@ class BaseAppClient { if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { error = error + parsed["ValidationErrors"]["ValidationErrors"][i] ["Messages"][0] + diff --git a/lib/config/config.dart b/lib/config/config.dart index abf451b8..fa184b33 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -122,6 +122,8 @@ const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const GET_CATEGORISE_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetCategories'; var selectedPatientType = 1; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart new file mode 100644 index 00000000..e7a7fd40 --- /dev/null +++ b/lib/core/model/procedure/categories_procedure.dart @@ -0,0 +1,18 @@ +class CategoriseProcedureModel { + String categoryID; + String categoryName; + + CategoriseProcedureModel({this.categoryID, this.categoryName}); + + CategoriseProcedureModel.fromJson(Map json) { + categoryID = json['CategoryID']; + categoryName = json['CategoryName']; + } + + Map toJson() { + final Map data = new Map(); + data['CategoryID'] = this.categoryID; + data['CategoryName'] = this.categoryName; + return data; + } +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 46b93481..d51fcc3e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -33,13 +33,16 @@ class PrescriptionService extends BaseService { Future postPrescription() async { hasError = false; //_prescriptionList.clear(); - await baseAppClient.post(POST_PRESCRIPTION_LIST, - onSuccess: (dynamic response, int statusCode) { - _prescriptionList - .add(PrescriptionModel.fromJson(response['PrescriptionList'])); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _postPrescriptionReqModel.toJson()); + await baseAppClient.post( + GET_CATEGORISE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + _prescriptionList + .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); } } diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 4c795baf..fdc18003 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -1,12 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:flutter/foundation.dart'; class ProcedureService extends BaseService { List _procedureList = List(); List get procedureList => _procedureList; + List _categoriesList = List(); + List get categoriesList => _categoriesList; + List procedureslist = List(); + + Procedures t1 = Procedures( + category: '02', + procedure: '02011002', + ); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( clinicId: 0, @@ -34,15 +44,31 @@ class ProcedureService extends BaseService { }, body: _getProcedureReqModel.toJson()); } - Future postProcedure() async { + Future getCategories() async { + hasError = false; + _categoriesList.clear(); + await baseAppClient.post( + GET_CATEGORISE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + _categoriesList + .add(CategoriseProcedureModel.fromJson(response['listCategories'])); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } + + Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; _procedureList.clear(); await baseAppClient.post(POST_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { - _procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); + print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _postProcedureReqModel.toJson()); + }, body: postProcedureReqModel.toJson()); } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index f65c0b2e..13e18ed3 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; @@ -8,6 +10,8 @@ class ProcedureViewModel extends BaseViewModel { bool hasError = false; ProcedureService _procedureService = locator(); List get procedureList => _procedureService.procedureList; + List get categoriesList => + _procedureService.categoriesList; Future getProcedure() async { hasError = false; @@ -20,4 +24,28 @@ class ProcedureViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getCategories() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.getCategories(); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.postProcedure(postProcedureReqModel); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4ccebf39..e29bcefc 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -76,7 +76,7 @@ class _NewPrescriptionScreenState extends State { fontWeight: FontWeight.bold, ), SizedBox( - width: 20, + width: 5.0, ), AppText( patient.patientId.toString(), @@ -111,7 +111,7 @@ class _NewPrescriptionScreenState extends State { InkWell( onTap: () { addPrescriptionForm(context); - //model.postPrescription(); + model.postPrescription(); }, child: CircleAvatar( radius: 65, @@ -195,6 +195,7 @@ class _NewPrescriptionScreenState extends State { ), onTap: () { addPrescriptionForm(context); + model.postPrescription(); }, ), SizedBox( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 3af63004..59cf5bdf 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -1,10 +1,14 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_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/screens/base/base_view.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_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -24,6 +28,7 @@ class ProcedureScreen extends StatefulWidget { class _ProcedureScreenState extends State { int testNum = 1; PatiantInformtion patient; + TextEditingController procedureController = TextEditingController(); @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -72,7 +77,7 @@ class _ProcedureScreenState extends State { fontWeight: FontWeight.bold, ), SizedBox( - width: 20, + width: 5.0, ), AppText( patient.patientId.toString(), @@ -376,62 +381,99 @@ class _ProcedureScreenState extends State { } } +postProcedure({ProcedureViewModel model}) async { + model = new ProcedureViewModel(); + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + List controls = List(); + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = 2016054575; + + postProcedureReqModel.episodeID = 200012166; + postProcedureReqModel.patientMRN = 3120725; + postProcedureReqModel.vidaAuthTokenID = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; + + controls.add( + Controls(code: 'Remarks', controlValue: 'Testing'), + ); + controlsProcedure.add( + Procedures(category: "02", procedure: "02011002", controls: controls)); + postProcedureReqModel.procedures = controlsProcedure; + + await model.postProcedure(postProcedureReqModel); + DrAppToastMsg.showSuccesToast('Procedure had been added'); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } +} + void addSelectedProcedure(context) { + TextEditingController procedureController = TextEditingController(); showModalBottomSheet( context: context, builder: (BuildContext bc) { - return SingleChildScrollView( - child: Container( - height: 490, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Select Procedure'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 9.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Add Delected Procedures'.toUpperCase(), - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, + return BaseView( + //onModelReady: (model) => model.getCategories(), + builder: + (BuildContext context, ProcedureViewModel model, Widget child) => + SingleChildScrollView( + child: Container( + height: 490, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Select Procedure'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + // Text(model.categoriesList[0].categoryName), + SizedBox( + height: 9.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Add Delected Procedures'.toUpperCase(), + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + controller: procedureController, + ), ), - ), - SizedBox( - height: 280.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).addMedication, - // onPressed: () { - // Navigator.pop(context); - // prescriptionWarning(context); - // }, - ), - ], + SizedBox( + height: 280.0, + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + TranslationBase.of(context).addMedication, + onPressed: () { + Navigator.pop(context); + postProcedure(); + }, + ), + ], + ), ), - ), - ], - ) - ], + ], + ) + ], + ), ), ), ), From 0c18d96ba2d40d5f6e05ad1e3d7d6e4316e2006e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 29 Dec 2020 14:37:48 +0200 Subject: [PATCH 065/421] post procedure --- lib/client/base_app_client.dart | 14 ++++++-------- lib/config/config.dart | 8 +++++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 015cf0f5..3006662e 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -78,7 +78,7 @@ class BaseAppClient { 'Accept': 'application/json' }); final int statusCode = response.statusCode; - if (statusCode < 200 || statusCode >= 400 ) { + if (statusCode < 200 || statusCode >= 400) { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); @@ -89,7 +89,7 @@ class BaseAppClient { // helpers.showErrorToast('Your session expired Please login agian'); // } else if (parsed['MessageStatus'] == 1) { - if(!parsed['IsAuthenticated']) + if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); else onSuccess(parsed, statusCode); @@ -106,21 +106,19 @@ class BaseAppClient { } } - String getError(parsed){ + String getError(parsed) { //TODO change this fun String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; if (parsed["ValidationErrors"] != null) { - error = parsed["ValidationErrors"]["StatusMessage"].toString() + "\n"; if (parsed["ValidationErrors"]["ValidationErrors"] != null && parsed["ValidationErrors"]["ValidationErrors"].length != 0) { for (var i = 0; - i < parsed["ValidationErrors"]["ValidationErrors"].length; - i++) { + i < parsed["ValidationErrors"]["ValidationErrors"].length; + i++) { error = error + - parsed["ValidationErrors"]["ValidationErrors"][i] - ["Messages"][0] + + parsed["ValidationErrors"]["ValidationErrors"][i]["Messages"][0] + "\n"; } } diff --git a/lib/config/config.dart b/lib/config/config.dart index 7f4fea03..d3728ddf 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -120,11 +120,13 @@ const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = + '/Services/DoctorApplication.svc/REST/PostProgressNote'; + const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetCategories'; From 8a6ea1c0c562a20799e060c69a76f95faf60c73d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 29 Dec 2020 15:01:51 +0200 Subject: [PATCH 066/421] Fix SOAP --- .../profile/SOAP/assessment_page.dart | 42 +++++---- .../patients/profile/SOAP/steps_widget.dart | 89 +++++++++++-------- .../shared/dialogs/master_key_dailog.dart | 5 +- 3 files changed, 80 insertions(+), 56 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 3bd9f0f1..5eb3694b 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -236,7 +236,7 @@ class _AssessmentPageState extends State { height: 6, ), AppText( - "Some short remark about the allergy", + widget.mySelectedAssessment.remark, fontSize: 10, color: Colors.grey, ), @@ -268,7 +268,9 @@ class _AssessmentPageState extends State { Column( children: [ InkWell( - onTap: () {}, + onTap: () { + openAssessmentDialog(context); + }, child: Icon(EvaIcons .edit2Outline), ) @@ -334,14 +336,15 @@ class AddAssessmentDetails extends StatefulWidget { } class _AddAssessmentDetailsState extends State { - MasterKeyModel _selectedDiagnosisCondition; - MasterKeyModel _selectedDiagnosisType; + // MasterKeyModel _selectedDiagnosisCondition; + // MasterKeyModel _selectedDiagnosisType; TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController( text: "234567"); @override Widget build(BuildContext context) { + remarkController.text = widget.mySelectedAssessment.remark??""; final screenSize = MediaQuery .of(context) .size; @@ -433,14 +436,14 @@ class _AddAssessmentDetailsState extends State { ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisCondition, + selectedValue: widget.mySelectedAssessment + .selectedDiagnosisCondition, okText: TranslationBase .of(context) .ok, okFunction: ( MasterKeyModel selectedValue) { setState(() { - _selectedDiagnosisCondition = - selectedValue; widget.mySelectedAssessment .selectedDiagnosisCondition = selectedValue; @@ -459,8 +462,10 @@ class _AddAssessmentDetailsState extends State { child: TextField( decoration: textFieldSelectorDecoration( "Condition", - _selectedDiagnosisCondition != null - ? _selectedDiagnosisCondition + widget.mySelectedAssessment + .selectedDiagnosisCondition != null + ? widget.mySelectedAssessment + .selectedDiagnosisCondition .nameEn : null, true), @@ -485,7 +490,8 @@ class _AddAssessmentDetailsState extends State { okFunction: ( MasterKeyModel selectedValue) { setState(() { - _selectedDiagnosisCondition = + widget.mySelectedAssessment + .selectedDiagnosisCondition = selectedValue; }); }, @@ -502,8 +508,10 @@ class _AddAssessmentDetailsState extends State { child: TextField( decoration: textFieldSelectorDecoration( "Condition", - _selectedDiagnosisCondition != null - ? _selectedDiagnosisCondition + widget.mySelectedAssessment + .selectedDiagnosisCondition != null + ? widget.mySelectedAssessment + .selectedDiagnosisCondition .nameEn : null, true), @@ -527,11 +535,11 @@ class _AddAssessmentDetailsState extends State { okFunction: ( MasterKeyModel selectedValue) { setState(() { - _selectedDiagnosisType = - selectedValue; + // _selectedDiagnosisType = + // selectedValue; widget.mySelectedAssessment .selectedDiagnosisType = - _selectedDiagnosisType; + selectedValue; }); }, ); @@ -547,8 +555,10 @@ class _AddAssessmentDetailsState extends State { child: TextField( decoration: textFieldSelectorDecoration( "Type", - _selectedDiagnosisType != null - ? _selectedDiagnosisType.nameEn + widget.mySelectedAssessment + .selectedDiagnosisType != null + ? widget.mySelectedAssessment + .selectedDiagnosisType.nameEn : null, true), enabled: false, diff --git a/lib/widgets/patients/profile/SOAP/steps_widget.dart b/lib/widgets/patients/profile/SOAP/steps_widget.dart index 863da3a9..b0b091c1 100644 --- a/lib/widgets/patients/profile/SOAP/steps_widget.dart +++ b/lib/widgets/patients/profile/SOAP/steps_widget.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.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'; import 'package:provider/provider.dart'; @@ -70,10 +71,11 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 0 ? 5 : 10, ), - Texts('SUBJECTIVE', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "SUBJECTIVE", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ], ), ), @@ -82,7 +84,7 @@ class StepsWidget extends StatelessWidget { top: index == 1 ? 15 : 30, left: MediaQuery.of(context).size.width * 0.28, child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, + onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -119,10 +121,11 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 1 ? 5 : 10, ), - Texts('OBJECTIVE', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "OBJECTIVE", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ], ), ), @@ -131,7 +134,10 @@ class StepsWidget extends StatelessWidget { top: index == 2 ? 15 : 30, left: MediaQuery.of(context).size.width * 0.52, child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(3) : null, + onTap: () { + if(index >= 3) + changeCurrentTab(2); + }, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -168,10 +174,11 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 2 ? 5 : 10, ), - Texts('ASSESSMENT', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "ASSESSMENT", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ], ), ), @@ -212,15 +219,17 @@ class StepsWidget extends StatelessWidget { ? Colors.white : Colors.grey, ), - ), + ) ), SizedBox( height: index == 3 ? 5 : 10, ), - Texts('PLAN', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "PLAN", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 14, + ), ], ), ), @@ -274,18 +283,19 @@ class StepsWidget extends StatelessWidget { color: index == 0 ? Colors.black : index > 0 - ? Colors.white - : Colors.grey, + ? Colors.white + : Colors.grey, ), ), ), SizedBox( height: index == 0 ? 5 : 10, ), - Texts('SUBJECTIVE', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "SUBJECTIVE", + fontWeight: FontWeight.bold, + fontSize: 16, + ), ], ), ), @@ -331,10 +341,11 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 1 ? 5 : 10, ), - Texts('OBJECTIVE', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "OBJECTIVE", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ], ), ), @@ -343,7 +354,7 @@ class StepsWidget extends StatelessWidget { top: index == 2 ? 15 : 30, right: MediaQuery.of(context).size.width * 0.52, child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(3) : null, + onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -383,10 +394,11 @@ class StepsWidget extends StatelessWidget { Padding( padding: const EdgeInsets.only(right: 2), - child: Texts('ASSESSMENT', - variant: "bodyText", - bold: true, - color: Colors.black), + child: AppText( + "ASSESSMENT", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ), ], ), @@ -433,10 +445,11 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 3 ? 5 : 10, ), - Texts('PLAN', - variant: "bodyText", - bold: true, - color: Colors.black), + AppText( + "PLAN", + fontWeight: FontWeight.bold, + fontSize: 14, + ), ], ), ), diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index a276c4af..42d766e7 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -2,16 +2,17 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +// ignore: must_be_immutable class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel selectedValue; MasterKeyDailog( {@required this.list, @required this.okText, - @required this.okFunction}); + @required this.okFunction, this.selectedValue}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); From a47e9b69f5b4e685e413f7064a8c59b2513e8ea5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 29 Dec 2020 20:27:55 +0200 Subject: [PATCH 067/421] add CDI service --- lib/client/base_app_client.dart | 4 +- lib/core/enum/master_lookup_key.dart | 6 +- lib/core/service/base/lookup-service.dart | 8 ++ lib/core/viewModel/SOAP_view_model.dart | 1 + .../profile/SOAP/assessment_page.dart | 80 +++++++++---------- .../patients/profile/SOAP/steps_widget.dart | 28 ++++--- 6 files changed, 74 insertions(+), 53 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ed14ecac..fcdf86dd 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -111,7 +111,9 @@ class BaseAppClient { } } } - + if(error == null) { + error = helpers.generateContactAdminMsg(); + } onFailure(error, statusCode); } } diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index a4010858..8f5d76f8 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -9,7 +9,8 @@ enum MasterKeysService { AllergySeverity, physiotherapyGoals, DiagnosisCondition, - DiagnosisType + DiagnosisType, + ICD10 } extension SelectedMasterKeysService on MasterKeysService { @@ -48,6 +49,9 @@ extension SelectedMasterKeysService on MasterKeysService { case MasterKeysService.DiagnosisType: return 35; break; + case MasterKeysService.ICD10: + return 2500; + break; } } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 61f0c31e..d677201b 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -33,6 +33,7 @@ class LookupService extends BaseService { // List listOfPhysiotherapyGoals = []; List listOfDiagnosisType = []; List listOfDiagnosisCondition = []; + List listOfICD10 = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -120,6 +121,13 @@ class LookupService extends BaseService { .add(MasterKeyModel.fromJson(v)); }); break; + case MasterKeysService.ICD10: + listOfICD10.clear(); + entryList.forEach((v) { + listOfICD10 + .add(MasterKeyModel.fromJson(v)); + }); + break; } } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index e8cde824..e36e132c 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -34,6 +34,7 @@ class SOAPViewModel extends BaseViewModel { List get physicalExaminationList => _SOAPService.physicalExaminationList; List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; + List get listOfICD10 => _SOAPService.listOfICD10; diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 5eb3694b..9eff9ed1 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -382,6 +382,10 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } + // todo return it back when service is fixed. + // if (model.listOfICD10.length == 0) { + // await model.getMasterLookup(MasterKeysService.ICD10); + // } }, builder: (_, model, w) => AppScaffold( @@ -431,47 +435,43 @@ class _AddAssessmentDetailsState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfDiagnosisCondition != - null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - selectedValue: widget.mySelectedAssessment - .selectedDiagnosisCondition, - okText: TranslationBase - .of(context) - .ok, - okFunction: ( - MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Condition", + onTap: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + selectedValue: widget + .mySelectedAssessment + .selectedICD, + okText: TranslationBase.of(context).ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { widget.mySelectedAssessment - .selectedDiagnosisCondition != null - ? widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn - : null, - true), - enabled: false, - ), - ), + .selectedICD = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Name / ICD", + widget.mySelectedAssessment.selectedICD != + null + ? widget.mySelectedAssessment + .selectedICD.nameEn + : null, + true), + enabled: false, + ), + ), ), SizedBox( height: 10, diff --git a/lib/widgets/patients/profile/SOAP/steps_widget.dart b/lib/widgets/patients/profile/SOAP/steps_widget.dart index b0b091c1..d5cb7ddc 100644 --- a/lib/widgets/patients/profile/SOAP/steps_widget.dart +++ b/lib/widgets/patients/profile/SOAP/steps_widget.dart @@ -224,12 +224,15 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 3 ? 5 : 10, ), - AppText( - "PLAN", - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - fontSize: 14, - ), + Container( + margin: EdgeInsets.only(left: index == 3? 15:0), + child: AppText( + "PLAN", + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + fontSize: 14, + ), + ), ], ), ), @@ -445,11 +448,14 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 3 ? 5 : 10, ), - AppText( - "PLAN", - fontWeight: FontWeight.bold, - fontSize: 14, - ), + Container( + margin: EdgeInsets.only(right:index == 3? 15:0), + child: AppText( + "PLAN", + fontWeight: FontWeight.bold, + fontSize: 14, + ), + ), ], ), ), From efee00c79eeeed48607089f96ab82bdf0bf22f48 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 29 Dec 2020 21:09:36 +0200 Subject: [PATCH 068/421] finish add assessment --- lib/config/config.dart | 5 +- lib/core/service/SOAP_service.dart | 13 ++++ lib/core/viewModel/SOAP_view_model.dart | 11 +++ .../SOAP/post_assessment_request_model.dart | 69 +++++++++++++++++ .../profile/SOAP/assessment_page.dart | 75 +++++++++++++------ 5 files changed, 150 insertions(+), 23 deletions(-) create mode 100644 lib/models/SOAP/post_assessment_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index d3728ddf..74ee9d89 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -125,7 +125,10 @@ const POST_CHIEF_COMPLAINT = const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; const POST_PROGRESS_NOTE = - '/Services/DoctorApplication.svc/REST/PostProgressNote'; + 'Services/DoctorApplication.svc/REST/PostProgressNote'; + +const POST_ASSESSMENT = + 'Services/DoctorApplication.svc/REST/PostAssessment'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetCategories'; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index e5d2023c..3219ef6a 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; @@ -86,4 +87,16 @@ class SOAPService extends LookupService { super.error = error; }, body: postProgressNoteRequestModel.toJson()); } + + Future postAssessment( + PostAssessmentRequestModel postAssessmentRequestModel) async { + hasError = false; + await baseAppClient.post(POST_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postAssessmentRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index e36e132c..422f554a 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; @@ -108,5 +109,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future postAssessment(PostAssessmentRequestModel postAssessmentRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postAssessment(postAssessmentRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart new file mode 100644 index 00000000..c8a1ebfd --- /dev/null +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -0,0 +1,69 @@ +class PostAssessmentRequestModel { + int patientMRN; + int appointmentNo; + int episodeId; + List icdCodeDetails; + + PostAssessmentRequestModel( + {this.patientMRN, + this.appointmentNo, + this.episodeId, + this.icdCodeDetails}); + + PostAssessmentRequestModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeId = json['EpisodeId']; + if (json['icdCodeDetails'] != null) { + icdCodeDetails = new List(); + json['icdCodeDetails'].forEach((v) { + icdCodeDetails.add(new IcdCodeDetails.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeId'] = this.episodeId; + if (this.icdCodeDetails != null) { + data['icdCodeDetails'] = + this.icdCodeDetails.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class IcdCodeDetails { + String icdcode10Id; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; + + IcdCodeDetails( + {this.icdcode10Id, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); + + IcdCodeDetails.fromJson(Map json) { + icdcode10Id = json['icdcode10Id']; + conditionId = json['conditionId']; + diagnosisTypeId = json['diagnosisTypeId']; + complexDiagnosis = json['complexDiagnosis']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['icdcode10Id'] = this.icdcode10Id; + data['conditionId'] = this.conditionId; + data['diagnosisTypeId'] = this.diagnosisTypeId; + data['complexDiagnosis'] = this.complexDiagnosis; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 9eff9ed1..edb2f608 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -1,8 +1,11 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -285,24 +288,48 @@ class _AssessmentPageState extends State { isExpand: isAssessmentExpand, ), DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .next, - onPressed: () { - widget.changePageViewIndex(3); - }, - ), - SizedBox( - height: 30, - ), - ], + height: 30, ), - ), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitAssessment(model); + }, + ), + SizedBox( + height: 30, + ), + ], ), - ))); + ), + ), + ))); + } + + submitAssessment(SOAPViewModel model) async { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + icdCodeDetails: [new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: widget.mySelectedAssessment.selectedDiagnosisType.id , + icdcode10Id: "1" + )] + ); + + await model.postAssessment(postAssessmentRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } + } openAssessmentDialog(BuildContext context) { @@ -441,13 +468,16 @@ class _AddAssessmentDetailsState extends State { list: model.listOfDiagnosisType, selectedValue: widget .mySelectedAssessment - .selectedICD, - okText: TranslationBase.of(context).ok, + .selectedDiagnosisType, + okText: TranslationBase + .of(context) + .ok, okFunction: (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment - .selectedICD = selectedValue; + .selectedDiagnosisType = + selectedValue; }); }, ); @@ -463,10 +493,11 @@ class _AddAssessmentDetailsState extends State { child: TextField( decoration: textFieldSelectorDecoration( "Name / ICD", - widget.mySelectedAssessment.selectedICD != - null + widget.mySelectedAssessment + .selectedDiagnosisType != + null ? widget.mySelectedAssessment - .selectedICD.nameEn + .selectedDiagnosisType.nameEn : null, true), enabled: false, From 14955201a91267b7fca536db0902fd31ea6955cf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 11:10:45 +0200 Subject: [PATCH 069/421] fix things --- .../profile/SOAP/assessment_page.dart | 42 ++++++++++------- .../patients/profile/SOAP/objective_page.dart | 5 +- .../SOAP/subjective/subjective_page.dart | 47 +++++++++++++++---- 3 files changed, 65 insertions(+), 29 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index edb2f608..0e7a6b41 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -308,28 +308,34 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, - icdCodeDetails: [new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: widget.mySelectedAssessment.selectedDiagnosisType.id , - icdcode10Id: "1" - )] - ); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null) { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: 3120690, + episodeId: 200012117, + appointmentNo: 2016054573, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: "1") + ]); - await model.postAssessment(postAssessmentRequestModel); + await model.postAssessment(postAssessmentRequestModel); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } } else { - widget.changePageViewIndex(3); + helpers.showErrorToast('Please add required field correctly'); } - } openAssessmentDialog(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index add9ca16..6b8a4661 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -352,11 +352,12 @@ class _ObjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { + widget.changePageViewIndex(2); } + } else { + helpers.showErrorToast('Please add required field correctly'); } - // TODO move it back to else stat when it work. - widget.changePageViewIndex(2); } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 9100cb76..c45ca457 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -277,13 +277,45 @@ class _SubjectivePageState extends State { {SOAPViewModel model, List myAllergiesList, List myHistoryList}) async { - await postChiefComplaint(model: model); - if (myHistoryList.length != 0) - await postHistories(model: model, myHistoryList: myHistoryList); - if (myAllergiesList.length != 0) - await postAllergy(myAllergiesList: myAllergiesList, model: model); + formKey.currentState.save(); + formKey.currentState.validate(); + if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } + + } + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + } + } + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } - widget.changePageViewIndex(1); } postAllergy( @@ -362,9 +394,6 @@ class _SubjectivePageState extends State { await model.postChiefComplaint(postChiefComplaintRequestModel); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } } } From 78e2c662c84994a517d5b5a9cc1a46287442a7fc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 30 Dec 2020 11:33:19 +0200 Subject: [PATCH 070/421] finish vital sign feature, and adding makeReferralResponse --- lib/config/config.dart | 3 +++ .../patient-doctor-referral-service.dart | 25 +++++++++++++++++++ .../viewModel/patient-referral-viewmodel.dart | 10 ++++++++ .../referral/my-referral-detail-screen.dart | 8 ++++-- 4 files changed, 44 insertions(+), 2 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e5ed9690..4a4a2d1c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -68,6 +68,9 @@ const GET_PENDING_REFERRAL_PATIENT = const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const RESPONSE_PENDING_REFERRAL_PATIENT = + 'Services/DoctorApplication.svc/REST/CreateReferral'; + const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index ad108c3b..a15ed05a 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -162,6 +162,31 @@ class PatientReferralService extends LookupService { ); } + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + hasError = false; + DoctorProfileModel doctorProfile = await getDoctorProfile(); + + Map body = Map(); + body['IsAccepted'] = isAccepted; + body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; + body['PatientMRN'] = pendingReferral.patientID; + body['PatientName'] = pendingReferral.patientName; + body['ReferralResponse'] = pendingReferral.remarksFromSource; + body['SetupID'] = pendingReferral.sourceSetupID; + body['DoctorName'] = doctorProfile.doctorName; + + await baseAppClient.post( + RESPONSE_PENDING_REFERRAL_PATIENT, + onSuccess: (dynamic response, int statusCode) { + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + Future makeReferral( PatientArrivalEntity patientArrivalEntity, String isoStringDate, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 6fa72f6f..9662a910 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -107,6 +107,16 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + setState(ViewState.Busy); + await _referralPatientService.responseReferral(pendingReferral, isAccepted); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getPatientArrivalList(String date) async { setState(ViewState.Busy); await _referralPatientService.getPatientArrivalList(date); diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 5f38f190..4c9d41e0 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -119,7 +119,9 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: null, + handler: (){ + model.responseReferral(pendingReferral, true); + }, ), ), SizedBox( @@ -133,7 +135,9 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: null, + handler: (){ + model.responseReferral(pendingReferral, false); + }, ), ), ], From 4e8de52efe7e5e30aaf72a832a560365c0035d7a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 11:48:59 +0200 Subject: [PATCH 071/421] add commented code --- .../profile/SOAP/assessment_page.dart | 57 ++++++++------- .../patients/profile/SOAP/objective_page.dart | 73 ++++++++++--------- .../SOAP/subjective/subjective_page.dart | 73 ++++++++++--------- 3 files changed, 105 insertions(+), 98 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 0e7a6b41..8fa73630 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -308,34 +308,35 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null) { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: "1") - ]); - - await model.postAssessment(postAssessmentRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(3); - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } + // if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + // widget.mySelectedAssessment.selectedDiagnosisType != null) { + // PostAssessmentRequestModel postAssessmentRequestModel = + // new PostAssessmentRequestModel( + // patientMRN: 3120690, + // episodeId: 200012117, + // appointmentNo: 2016054573, + // icdCodeDetails: [ + // new IcdCodeDetails( + // remarks: widget.mySelectedAssessment.remark, + // complexDiagnosis: true, + // conditionId: + // widget.mySelectedAssessment.selectedDiagnosisCondition.id, + // diagnosisTypeId: + // widget.mySelectedAssessment.selectedDiagnosisType.id, + // icdcode10Id: "1") + // ]); + // + // await model.postAssessment(postAssessmentRequestModel); + // + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(3); + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } + widget.changePageViewIndex(3); } openAssessmentDialog(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 6b8a4661..8d12e1c9 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -320,43 +320,46 @@ class _ObjectivePageState extends State { } submitObjectivePage(SOAPViewModel model) async { - if(widget.mySelectedExamination.isNotEmpty){ - PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + // if(widget.mySelectedExamination.isNotEmpty){ + // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + // widget.mySelectedExamination.forEach((exam) { + // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + // null) + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + // + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + // ListHisProgNotePhysicalExaminationVM( + // patientMRN: 3120690, + // episodeId: 200012117, + // appointmentNo: 2016054573, + // remarks: exam.remark ?? '', + // createdBy: 1485, + // createdOn: DateTime.now().toIso8601String(), + // editedBy: 1485, + // editedOn: DateTime.now().toIso8601String(), + // examId: exam.selectedExamination.id, + // examType: exam.selectedExamination.typeId, + // isAbnormal: exam.isAbnormal, + // isNormal: exam.isNormal, + // masterDescription: exam.selectedExamination, + // notExamined: false + // + // )); + // }); + // + // await model.postPhysicalExam(postPhysicalExamRequestModel); + // + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(2); + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - ListHisProgNotePhysicalExaminationVM( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, - remarks: exam.remark ?? '', - createdBy: 1485, - createdOn: DateTime.now().toIso8601String(), - editedBy: 1485, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - masterDescription: exam.selectedExamination, - notExamined: false + widget.changePageViewIndex(2); - )); - }); - - await model.postPhysicalExam(postPhysicalExamRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(2); - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index c45ca457..80246166 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -279,42 +279,45 @@ class _SubjectivePageState extends State { List myHistoryList}) async { formKey.currentState.save(); formKey.currentState.validate(); - if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - await postChiefComplaint(model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - if (myHistoryList.length != 0) { - await postHistories(model: model, myHistoryList: myHistoryList); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } - } - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } else { - widget.changePageViewIndex(1); - } - } - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } + widget.changePageViewIndex(1); + + // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + // await postChiefComplaint(model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myHistoryList.length != 0) { + // await postHistories(model: model, myHistoryList: myHistoryList); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } + // + // } + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } else { + // widget.changePageViewIndex(1); + // } + // } + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } } From 2f273dcde8cdb9f38a335dd2796ea58c0ac807a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 12:58:13 +0200 Subject: [PATCH 072/421] add ICD10 --- lib/models/SOAP/master_key_model.dart | 16 ++++----- lib/routes.dart | 3 ++ .../patients/profile/SOAP/add_SOAP_index.dart | 3 ++ .../profile/SOAP/assessment_page.dart | 20 +++++------ .../SOAP/subjective/subjective_page.dart | 10 ------ .../profile/profile_medical_info_widget.dart | 8 +++++ .../shared/dialogs/master_key_dailog.dart | 35 ++++++++++++------- 7 files changed, 54 insertions(+), 41 deletions(-) diff --git a/lib/models/SOAP/master_key_model.dart b/lib/models/SOAP/master_key_model.dart index 79615f82..a1c32039 100644 --- a/lib/models/SOAP/master_key_model.dart +++ b/lib/models/SOAP/master_key_model.dart @@ -1,18 +1,18 @@ class MasterKeyModel { String alias; String aliasN; - int code; - Null description; - Null detail1; - Null detail2; - Null detail3; - Null detail4; - Null detail5; + dynamic code; + dynamic description; + dynamic detail1; + dynamic detail2; + dynamic detail3; + dynamic detail4; + dynamic detail5; int groupID; int id; String nameAr; String nameEn; - Null remarks; + dynamic remarks; int typeId; String valueList; diff --git a/lib/routes.dart b/lib/routes.dart index 3fbec294..8412f055 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -79,6 +79,7 @@ const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String CREATE_EPISODE = 'patients/create-episode'; +const String UPDATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -89,6 +90,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'; +//todo: change the routing way. var routes = { ROOT: (_) => RootPage(), HOME: (_) => LandingPage(), @@ -122,6 +124,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), + UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index a6f792c8..e06e8033 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -22,6 +22,9 @@ import '../patient_profile_widget.dart'; import 'steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { + final bool isUpdate; + + const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key); @override _AddSOAPIndexState createState() => _AddSOAPIndexState(); } diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 8fa73630..22778913 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -416,10 +416,9 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } - // todo return it back when service is fixed. - // if (model.listOfICD10.length == 0) { - // await model.getMasterLookup(MasterKeysService.ICD10); - // } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } }, builder: (_, model, w) => AppScaffold( @@ -469,13 +468,14 @@ class _AddAssessmentDetailsState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfDiagnosisType != null + onTap: model.listOfICD10 != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, + isICD: true, + list: model.listOfICD10, selectedValue: widget .mySelectedAssessment - .selectedDiagnosisType, + .selectedICD, okText: TranslationBase .of(context) .ok, @@ -483,7 +483,7 @@ class _AddAssessmentDetailsState extends State { (MasterKeyModel selectedValue) { setState(() { widget.mySelectedAssessment - .selectedDiagnosisType = + .selectedICD = selectedValue; }); }, @@ -501,10 +501,10 @@ class _AddAssessmentDetailsState extends State { decoration: textFieldSelectorDecoration( "Name / ICD", widget.mySelectedAssessment - .selectedDiagnosisType != + .selectedICD != null ? widget.mySelectedAssessment - .selectedDiagnosisType.nameEn + .selectedICD.nameEn : null, true), enabled: false, diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 80246166..d4ed9c86 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -168,11 +168,6 @@ class _SubjectivePageState extends State { variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : false, color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) ], ), InkWell( @@ -214,11 +209,6 @@ class _SubjectivePageState extends State { variant: isAllergiesExpand ? "bodyText" : '', bold: isAllergiesExpand ? true : false, color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) ], ), InkWell( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9b70ae3a..446db0ac 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -18,6 +18,7 @@ import 'PatientProfileButton.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { + ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); PatiantInformtion patient; @override @@ -35,6 +36,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: "Episode", route: CREATE_EPISODE, icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + nameLine1: "Update", + nameLine2: "Episode", + route: CREATE_EPISODE, + icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index 42d766e7..a3be364b 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -7,12 +7,15 @@ class MasterKeyDailog extends StatefulWidget { final List list; final okText; final Function(MasterKeyModel) okFunction; - MasterKeyModel selectedValue; + MasterKeyModel selectedValue; + final bool isICD; MasterKeyDailog( {@required this.list, @required this.okText, - @required this.okFunction, this.selectedValue}); + @required this.okFunction, + this.selectedValue, + this.isICD = false}); @override _MasterKeyDailogState createState() => _MasterKeyDailogState(); @@ -63,17 +66,23 @@ class _MasterKeyDailogState extends State { children: [ ...widget.list .map((item) => RadioListTile( - title: Text(item.nameEn.toString()), - groupValue: widget.selectedValue.id.toString(), - value: item.id.toString(), - activeColor: Colors.blue.shade700, - selected: item.id.toString() == widget.selectedValue.id.toString(), - onChanged: (val) { - setState(() { - widget.selectedValue = item; - }); - }, - )) + title: Text( + '${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), + groupValue: widget.isICD + ? widget.selectedValue.code.toString() + : widget.selectedValue.id.toString(), + value: widget.isICD ? widget.selectedValue.code.toString() : item + .id.toString(), + activeColor: Colors.blue.shade700, + selected: widget.isICD ? item.code.toString() == + widget.selectedValue.code.toString() : item.id.toString() == + widget.selectedValue.id.toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) .toList() ], ), From fc82665f1b84d0e1dcfce5527cc2adf10d8508b1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 15:37:21 +0200 Subject: [PATCH 073/421] add ICD10 --- lib/widgets/patients/profile/SOAP/assessment_page.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 22778913..6d5aa7d3 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -416,9 +416,9 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } - if (model.listOfICD10.length == 0) { - await model.getMasterLookup(MasterKeysService.ICD10); - } + // if (model.listOfICD10.length == 0) { + // await model.getMasterLookup(MasterKeysService.ICD10); + // } }, builder: (_, model, w) => AppScaffold( @@ -468,11 +468,11 @@ class _AddAssessmentDetailsState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfICD10 != null + onTap: model.listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( isICD: true, - list: model.listOfICD10, + list: model.listOfDiagnosisType, selectedValue: widget .mySelectedAssessment .selectedICD, From 04ed76069c46a73517beb95330c7dcdcc8d73de4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Dec 2020 15:39:05 +0200 Subject: [PATCH 074/421] hack login --- lib/client/base_app_client.dart | 36 ++--- lib/core/viewModel/project_view_model.dart | 22 +-- lib/root_page.dart | 2 +- lib/screens/dashboard_screen.dart | 125 +++++++++--------- .../profile/profile-welcome-widget.dart | 7 +- 5 files changed, 99 insertions(+), 93 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index eacf3e8d..f9f683b8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -36,20 +36,21 @@ class BaseAppClient { }) async { String url = BASE_URL + endPoint; try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - String token = await sharedPref.getString(TOKEN); - if (profile != null) { - DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) - body['DoctorID'] = doctorProfile?.doctorID; - body['EditedBy'] = doctorProfile?.doctorID; - if (body['ProjectID'] == null) { - body['ProjectID'] = doctorProfile?.projectID; - } - if (body['ClinicID'] == null) - body['ClinicID'] = doctorProfile?.clinicID; - } - body['TokenID'] = token ?? ''; + //TODO change it edit By Jammal + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // String token = await sharedPref.getString(TOKEN); + // if (profile != null) { + // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + // if (body['DoctorID'] == null) + body['DoctorID'] = 4709;//doctorProfile?.doctorID; + body['EditedBy'] = 4709;//doctorProfile?.doctorID; + //if (body['ProjectID'] == null) { + body['ProjectID'] = 15;//doctorProfile?.projectID; + // } + // if (body['ClinicID'] == null) + body['ClinicID'] = 1;//doctorProfile?.clinicID; + // } + body['TokenID'] = "@dm!n";//token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; @@ -63,9 +64,10 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZI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RVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; + //await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 267f823a..1448fb47 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -101,7 +101,7 @@ class ProjectViewModel with ChangeNotifier { localRes = response; }, onFailure: (String error, int statusCode) { throw error; - }, body: {}); + }, body: Map()); return Future.value(localRes); } catch (error) { @@ -111,18 +111,18 @@ class ProjectViewModel with ChangeNotifier { } void getProfile() async { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - ProfileReqModel docInfo = new ProfileReqModel( - doctorID: doctorProfile.doctorID, - clinicID: doctorProfile.clinicID, - license: true, - projectID: doctorProfile.projectID, - tokenID: '', - languageID: 2); + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + // ProfileReqModel docInfo = new ProfileReqModel( + // doctorID: doctorProfile.doctorID, + // clinicID: doctorProfile.clinicID, + // license: true, + // projectID: doctorProfile.projectID, + // tokenID: '', + // languageID: 2); Provider.of(AppGlobal.CONTEX, listen: false) - .getDocProfiles(docInfo.toJson()) + .getDocProfiles(ProfileReqModel().toJson()) .then((res) async { sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); }).catchError((err) { diff --git a/lib/root_page.dart b/lib/root_page.dart index fe35a246..0f44dc4d 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -22,7 +22,7 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNAUTHENTICATED: - return Loginsreen(); + return LandingPage(); break; case APP_STATUS.AUTHENTICATED: return LandingPage(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b6bbc6cf..c55b5afa 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -115,68 +115,69 @@ class _DashboardScreenState extends State { SizedBox( height: 4, ), - InkWell( - onTap: () async { - showCupertinoPicker( - decKey: '', - context: context, - actionList: projectsProvider - .doctorClinicsList); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - child: AppText( - authProvider.selectedClinicName != - null - ? authProvider - .selectedClinicName - : authProvider.doctorProfile - .clinicDescription, - fontSize: - SizeConfig.textMultiplier * - 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only( - left: 5, - top: projectsProvider - .isArabic - ? 0 - : 5, - right: 10, - bottom: projectsProvider - .isArabic - ? 15 - : 7), - child: Icon( - DoctorApp.sync_icon, - color: Colors.white, - size: SizeConfig - .textMultiplier * - 1.8, - )), - ), - ], - ), - ]), - ), + //TODO change it edit By Jammal + // InkWell( + // onTap: () async { + // showCupertinoPicker( + // decKey: '', + // context: context, + // actionList: projectsProvider + // .doctorClinicsList); + // }, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // child: AppText( + // authProvider.selectedClinicName != + // null + // ? authProvider + // .selectedClinicName + // : authProvider.doctorProfile + // .clinicDescription, + // fontSize: + // SizeConfig.textMultiplier * + // 1.7, + // color: Colors.white, + // textAlign: TextAlign.center, + // ), + // alignment: projectsProvider.isArabic + // ? Alignment.topRight + // : Alignment.topLeft, + // ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.max, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // InkWell( + // child: Container( + // margin: EdgeInsets.only( + // left: 5, + // top: projectsProvider + // .isArabic + // ? 0 + // : 5, + // right: 10, + // bottom: projectsProvider + // .isArabic + // ? 15 + // : 7), + // child: Icon( + // DoctorApp.sync_icon, + // color: Colors.white, + // size: SizeConfig + // .textMultiplier * + // 1.8, + // )), + // ), + // ], + // ), + // ]), + // ), ], ), ]), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index fae705f4..90141080 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -43,7 +43,8 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - 'Dr. ${authProvider.doctorProfile.doctorName}', + //TODO change it edit By Jammal + 'Dr. ',//${authProvider.doctorProfile.doctorName}', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.white, @@ -71,7 +72,9 @@ final double height; height: 50, width: 60, child: Image.network( - authProvider.doctorProfile.doctorImageURL, + //TODO change it edit By Jammal + 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg' + // authProvider.doctorProfile.doctorImageURL, // fit: BoxFit.fill, ), ), From 9d8514c83ba2861862653f3123578079ad53aaea Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 30 Dec 2020 15:49:05 +0200 Subject: [PATCH 075/421] post prescription --- lib/config/config.dart | 2 +- .../model/post_prescrition_req_model.dart | 38 +++--- .../model/procedure/categories_procedure.dart | 86 +++++++++++- lib/core/service/prescription_service.dart | 9 +- lib/core/service/procedure_service.dart | 35 ++--- .../viewModel/prescription_view_model.dart | 5 +- .../prescription/add_prescription_form.dart | 67 +++++++++- .../prescription/prescription_screen.dart | 4 +- lib/screens/procedures/procedure_screen.dart | 125 ++++++++++-------- 9 files changed, 259 insertions(+), 112 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index d3728ddf..b8509f66 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -128,7 +128,7 @@ const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; const GET_CATEGORISE_PROCEDURE = - 'Services/DoctorApplication.svc/REST/GetCategories'; + 'Services/DoctorApplication.svc/REST/GetProcedure'; var selectedPatientType = 1; diff --git a/lib/core/model/post_prescrition_req_model.dart b/lib/core/model/post_prescrition_req_model.dart index 892854aa..6fc71199 100644 --- a/lib/core/model/post_prescrition_req_model.dart +++ b/lib/core/model/post_prescrition_req_model.dart @@ -7,12 +7,11 @@ class PostPrescriptionReqModel { List prescriptionRequestModel; PostPrescriptionReqModel( - {this.vidaAuthTokenID = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiYTYxZjAyZjItNzUwZS00MTZkLWEzOTQtZTRjZmViZGVjMDE5IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUzNTIiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODUzMDAyNywiZXhwIjoxNjA5Mzk0MDI3LCJpYXQiOjE2MDg1MzAwMjd9.M1NTREPgz5vQH_GTZ_KGb0xQW5HEDs47AtNR3jbqnms", - this.clinicID = 1, - this.episodeID = 200012117, - this.appointmentNo = 2016054573, - this.patientMRN = 3120690, + {this.vidaAuthTokenID, + this.clinicID, + this.episodeID, + this.appointmentNo, + this.patientMRN, this.prescriptionRequestModel}); PostPrescriptionReqModel.fromJson(Map json) { @@ -58,19 +57,20 @@ class PrescriptionRequestModel { String remarks; String icdcode10Id; - PrescriptionRequestModel( - {this.itemId = 4, - this.doseStartDate = "2020-12-20T13:07:41.769Z", - this.duration = 2, - this.dose = 1, - this.doseUnitId = 1, - this.route = 1, - this.frequency = 1, - this.doseTime = 1, - this.covered = true, - this.approvalRequired = true, - this.remarks = "test1", - this.icdcode10Id = "test3"}); + PrescriptionRequestModel({ + this.itemId, + this.doseStartDate, + this.duration, + this.dose, + this.doseUnitId, + this.route, + this.frequency, + this.doseTime, + this.covered, + this.approvalRequired, + this.remarks, + this.icdcode10Id, + }); PrescriptionRequestModel.fromJson(Map json) { itemId = json['itemId']; diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index e7a7fd40..074d8a1b 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -1,18 +1,90 @@ class CategoriseProcedureModel { - String categoryID; - String categoryName; + List entityList; + int rowcount; + dynamic statusMessage; - CategoriseProcedureModel({this.categoryID, this.categoryName}); + CategoriseProcedureModel( + {this.entityList, this.rowcount, this.statusMessage}); CategoriseProcedureModel.fromJson(Map json) { - categoryID = json['CategoryID']; - categoryName = json['CategoryName']; + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + bool allowedClinic; + String category; + String categoryID; + String genderValidation; + String group; + String orderedValidation; + dynamic price; + String procedureId; + String procedureName; + String specialPermission; + String subGroup; + String template; + + EntityList( + {this.allowedClinic, + this.category, + this.categoryID, + this.genderValidation, + this.group, + this.orderedValidation, + this.price, + this.procedureId, + this.procedureName, + this.specialPermission, + this.subGroup, + this.template}); + + EntityList.fromJson(Map json) { + allowedClinic = json['allowedClinic']; + category = json['category']; + categoryID = json['categoryID']; + genderValidation = json['genderValidation']; + group = json['group']; + orderedValidation = json['orderedValidation']; + price = json['price']; + procedureId = json['procedureId']; + procedureName = json['procedureName']; + specialPermission = json['specialPermission']; + subGroup = json['subGroup']; + template = json['template']; } Map toJson() { final Map data = new Map(); - data['CategoryID'] = this.categoryID; - data['CategoryName'] = this.categoryName; + data['allowedClinic'] = this.allowedClinic; + data['category'] = this.category; + data['categoryID'] = this.categoryID; + data['genderValidation'] = this.genderValidation; + data['group'] = this.group; + data['orderedValidation'] = this.orderedValidation; + data['price'] = this.price; + data['procedureId'] = this.procedureId; + data['procedureName'] = this.procedureName; + data['specialPermission'] = this.specialPermission; + data['subGroup'] = this.subGroup; + data['template'] = this.template; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index d51fcc3e..65e74dda 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -30,19 +30,20 @@ class PrescriptionService extends BaseService { }, body: _prescriptionReqModel.toJson()); } - Future postPrescription() async { + Future postPrescription( + PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_prescriptionList.clear(); await baseAppClient.post( - GET_CATEGORISE_PROCEDURE, + POST_PRESCRIPTION_LIST, onSuccess: (dynamic response, int statusCode) { - _prescriptionList - .add(PrescriptionModel.fromJson(response['PrescriptionList'])); + print("Success"); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, + body: postProcedureReqModel.toJson(), ); } } diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index fdc18003..7ffd9310 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -13,11 +13,6 @@ class ProcedureService extends BaseService { List get categoriesList => _categoriesList; List procedureslist = List(); - Procedures t1 = Procedures( - category: '02', - procedure: '02011002', - ); - GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( clinicId: 0, pageSize: 10, @@ -29,8 +24,17 @@ class ProcedureService extends BaseService { search: ["lab"], ); + GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( + clinicId: 0, + pageSize: 100, + pageIndex: 1, + patientMRN: 0, + //categoryId: null, + vidaAuthTokenID: + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - PostProcedureReqModel _postProcedureReqModel = PostProcedureReqModel(); + search: ["lab"], + ); Future getProcedure() async { hasError = false; @@ -47,17 +51,14 @@ class ProcedureService extends BaseService { Future getCategories() async { hasError = false; _categoriesList.clear(); - await baseAppClient.post( - GET_CATEGORISE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { - _categoriesList - .add(CategoriseProcedureModel.fromJson(response['listCategories'])); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); + await baseAppClient.post(GET_CATEGORISE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + _categoriesList + .add(CategoriseProcedureModel.fromJson(response['ProcedureList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getProcedureCategoriseReqModel.toJson()); } Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 4ab4b3f7..6c3fe7b2 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -24,11 +24,12 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postPrescription() async { + Future postPrescription( + PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.postPrescription(); + await _prescriptionService.postPrescription(postProcedureReqModel); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 40704009..5782a166 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1,7 +1,12 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.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/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -10,6 +15,8 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void addPrescriptionForm(context) { + TextEditingController durationController = TextEditingController(); + TextEditingController doseController = TextEditingController(); final GlobalKey _formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; showModalBottomSheet( @@ -122,6 +129,7 @@ void addPrescriptionForm(context) { borderColor: Colors.white, textInputType: TextInputType.number, inputFormatter: ONLY_NUMBERS, + controller: doseController, ), ), SizedBox(height: spaceBetweenTextFileds), @@ -160,11 +168,18 @@ void addPrescriptionForm(context) { border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), child: AppTextFormField( - labelText: TranslationBase.of(context).duration, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), + labelText: TranslationBase.of(context).duration, + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, + controller: durationController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), ), SizedBox(height: spaceBetweenTextFileds), Container( @@ -192,8 +207,11 @@ void addPrescriptionForm(context) { title: TranslationBase.of(context).addMedication, onPressed: () { + //prescriptionWarning(context); + postProcedure( + duration: durationController.text, + dose: doseController.text); Navigator.pop(context); - prescriptionWarning(context); }, ), ], @@ -210,3 +228,40 @@ void addPrescriptionForm(context) { ); }); } + +postProcedure({String duration, String dose}) async { + PrescriptionViewModel model = new PrescriptionViewModel(); + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); + List sss = List(); + + postProcedureReqModel.appointmentNo = 2016055175; + postProcedureReqModel.clinicID = 1; + postProcedureReqModel.episodeID = 200012335; + postProcedureReqModel.patientMRN = 1234; + postProcedureReqModel.vidaAuthTokenID = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; + sss.add(PrescriptionRequestModel( + covered: true, + dose: int.parse(dose), + itemId: 8, + doseUnitId: 1, + route: 1, + frequency: 1, + remarks: "test2", + approvalRequired: true, + icdcode10Id: "test2", + doseTime: 1, + duration: int.parse(duration), + doseStartDate: "2020-12-20T13:07:41.769Z")); + postProcedureReqModel.prescriptionRequestModel = sss; + //postProcedureReqModel.procedures = controlsProcedure; + + await model.postPrescription(postProcedureReqModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast('Medication has been added'); + } +} diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index e29bcefc..742cfad8 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -111,7 +111,7 @@ class _NewPrescriptionScreenState extends State { InkWell( onTap: () { addPrescriptionForm(context); - model.postPrescription(); + //model.postPrescription(); }, child: CircleAvatar( radius: 65, @@ -195,7 +195,7 @@ class _NewPrescriptionScreenState extends State { ), onTap: () { addPrescriptionForm(context); - model.postPrescription(); + //model.postPrescription(); }, ), SizedBox( diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 59cf5bdf..5b6b10f3 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -414,65 +414,82 @@ void addSelectedProcedure(context) { context: context, builder: (BuildContext bc) { return BaseView( - //onModelReady: (model) => model.getCategories(), + onModelReady: (model) => model.getCategories(), builder: (BuildContext context, ProcedureViewModel model, Widget child) => - SingleChildScrollView( - child: Container( - height: 490, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Select Procedure'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - // Text(model.categoriesList[0].categoryName), - SizedBox( - height: 9.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ + NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + height: 490, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Select Procedure'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + if (model.categoriesList.length != 0) Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Add Delected Procedures'.toUpperCase(), - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - controller: procedureController, - ), + height: 120.0, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model.categoriesList[0].rowcount, + itemBuilder: (BuildContext ctxt, int index) { + return Container( + child: AppText(model.categoriesList[0] + .entityList[index].procedureName), + ); + }), ), - SizedBox( - height: 280.0, - ), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: - TranslationBase.of(context).addMedication, - onPressed: () { - Navigator.pop(context); - postProcedure(); - }, - ), - ], + SizedBox( + height: 0.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: + 'Add Delected Procedures'.toUpperCase(), + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + controller: procedureController, + ), ), - ), - ], - ) - ], + SizedBox( + height: 80.0, + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + TranslationBase.of(context).addMedication, + onPressed: () { + Navigator.pop(context); + postProcedure(); + }, + ), + ], + ), + ), + ], + ) + ], + ), ), ), ), From f35eff1220df812e81567df4baa4c6905176ddb0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 30 Dec 2020 15:50:59 +0200 Subject: [PATCH 076/421] working with admission request --- lib/core/service/admission-request-service.dart | 0 lib/core/viewModel/patient-admission-request-viewmodel.dart | 0 .../admission-request/admission-request-detail-screen.dart | 0 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/core/service/admission-request-service.dart create mode 100644 lib/core/viewModel/patient-admission-request-viewmodel.dart create mode 100644 lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart diff --git a/lib/core/service/admission-request-service.dart b/lib/core/service/admission-request-service.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart new file mode 100644 index 00000000..e69de29b From 433b2933c48894bdd170b5407e8b446448b849d7 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 30 Dec 2020 15:51:36 +0200 Subject: [PATCH 077/421] working with admission request and some changes in vital signs --- lib/config/localized_values.dart | 3 + .../service/admission-request-service.dart | 5 + .../patient-admission-request-viewmodel.dart | 9 ++ .../patient-vital-sign-viewmodel.dart | 104 ++++++++++++------ lib/locator.dart | 4 + lib/routes.dart | 3 + .../admission-request-detail-screen.dart | 49 +++++++++ .../vital_sign/vital-signs-screen.dart | 22 +++- lib/util/translations_delegate_base.dart | 3 + .../profile/profile_medical_info_widget.dart | 15 ++- 10 files changed, 175 insertions(+), 42 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f2880c93..adc3c25e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -375,4 +375,7 @@ const Map> localizedValues = { 'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'}, 'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'}, 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, + 'admission': {'en': "Admission", 'ar': 'قبول'}, + 'request': {'en': "Request", 'ar': 'طلب'}, + 'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'}, }; diff --git a/lib/core/service/admission-request-service.dart b/lib/core/service/admission-request-service.dart index e69de29b..e98ac048 100644 --- a/lib/core/service/admission-request-service.dart +++ b/lib/core/service/admission-request-service.dart @@ -0,0 +1,5 @@ +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class AdmissionRequestService extends BaseService { + +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index e69de29b..28aaae8a 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -0,0 +1,9 @@ +import 'package:doctor_app_flutter/core/service/admission-request-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class AdmissionRequestViewModel extends BaseViewModel{ + + AdmissionRequestService _admissionRequestService = locator(); +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 05c98f0e..e58ad089 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -18,14 +18,16 @@ class VitalSignsViewModel extends BaseViewModel { Future getPatientArrivalList(String date, PatiantInformtion patient, {String fromDate}) async { - setState(ViewState.Busy); + // TODO when arrival list work un comment below lines + /* setState(ViewState.Busy); await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate); if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); } else { await getPatientVitalSign(patient); - } + }*/ + makeVitalSignDemoData(); } PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) { @@ -60,41 +62,73 @@ class VitalSignsViewModel extends BaseViewModel { setState(ViewState.Error); } else { if (patientVitalSigns == null) { - _vitalSignService.patientVitalSigns = VitalSignData( - appointmentNo: 2016053265, - bloodPressureCuffLocation: 0, - bloodPressureCuffSize: 0, - bloodPressureHigher: 38, - bloodPressureLower: 32, - bloodPressurePatientPosition: 1, - bodyMassIndex: 31.11, - fio2: 0, - headCircumCm: 0, - heightCm: 150, - idealBodyWeightLbs: -2, - isPainManagementDone: false, - isVitalsRequired: true, - leanBodyWeightLbs: 0, - painCharacter: null, - painDuration: null, - painFrequency: null, - painLocation: null, - painScore: 0, - patientMRN: 3333274, - patientType: 1, - pulseBeatPerMinute: 0, - pulseRhythm: 0, - respirationBeatPerMinute: 0, - respirationPattern: 0, - sao2: 0, - status: 47, - temperatureCelcius: 40, - temperatureCelciusMethod: 1, - waistSizeInch: 39, - weightKg: 70, - ); + makeVitalSignDemoData(); } setState(ViewState.Idle); } } + + makeVitalSignDemoData(){ + _vitalSignService.patientVitalSigns = VitalSignData( + appointmentNo: 2016053265, + bloodPressureCuffLocation: 0, + bloodPressureCuffSize: 0, + bloodPressureHigher: 38, + bloodPressureLower: 32, + bloodPressurePatientPosition: 1, + bodyMassIndex: 31.11, + fio2: 0, + headCircumCm: 0, + heightCm: 150, + idealBodyWeightLbs: -2, + isPainManagementDone: false, + isVitalsRequired: true, + leanBodyWeightLbs: 0, + painCharacter: null, + painDuration: null, + painFrequency: null, + painLocation: null, + painScore: 0, + patientMRN: 3333274, + patientType: 1, + pulseBeatPerMinute: 0, + pulseRhythm: 0, + respirationBeatPerMinute: 0, + respirationPattern: 0, + sao2: 0, + status: 47, + temperatureCelcius: 40, + temperatureCelciusMethod: 1, + waistSizeInch: 39, + weightKg: 70, + ); + } + + String getBMI(double bodyMassIndex) { + if (bodyMassIndex <= 18.5) { + return "Underweight"; + } else if (bodyMassIndex <= 25.0) { + return "Normal"; + } else if (bodyMassIndex <= 30) { + return "Overweight"; + } else { // > 30.0 + return "Obese"; + } + } + + String getTempratureMethod(int temperatureCelciusMethod){ + // temperatureCelciusMethod ( vital sign response field )- master 2005 + if(temperatureCelciusMethod == 1){ + return "Oral"; + } else if(temperatureCelciusMethod == 2){ + return "Axilla"; + } else if(temperatureCelciusMethod == 3){ + return "Rectal"; + } else if(temperatureCelciusMethod == 4){ + return "Tympanic"; + } else if(temperatureCelciusMethod == 5){ + return "Temporal"; + } + } + } diff --git a/lib/locator.dart b/lib/locator.dart index 8bbf00b0..8c67b703 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; import 'core/service/SOAP_service.dart'; +import 'core/service/admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; import 'core/service/patient-vital-signs-service.dart'; @@ -21,6 +22,7 @@ import 'core/service/schedule_service.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; +import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/referral_view_model.dart'; @@ -45,6 +47,7 @@ void setupLocator() { locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => VitalSignsService()); + locator.registerLazySingleton(() => AdmissionRequestService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -60,4 +63,5 @@ void setupLocator() { locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => VitalSignsViewModel()); + locator.registerFactory(() => AdmissionRequestViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index ff0a60e9..8792e206 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -41,6 +41,7 @@ import './screens/settings/settings_screen.dart'; import 'landing_page.dart'; import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; +import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; import 'screens/prescription/prescription_screen.dart'; @@ -81,6 +82,7 @@ const String PATIENT_INSURANCE_APPROVALS = const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String CREATE_EPISODE = 'patients/create-episode'; const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; +const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -124,6 +126,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), + PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index e69de29b..dd628abf 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -0,0 +1,49 @@ +import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/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_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class AdmissionRequestDetailScreen extends StatefulWidget { + @override + _AdmissionRequestDetailScreenState createState() => _AdmissionRequestDetailScreenState(); +} + +class _AdmissionRequestDetailScreenState extends State { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).admissionRequest, + body: Column( + children: [ + SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + ], + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + color: HexColor("#B8382B"), + onPressed: null, + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index c6b183b7..107e2e6b 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -207,6 +207,21 @@ class PatientVitalSignScreen extends StatelessWidget { color: Colors.grey.shade800, fontWeight: FontWeight.normal, ), + SizedBox( + width: 8, + ), + Container( + color: Colors.green, + child: Padding( + padding: EdgeInsets.symmetric(vertical: 2, horizontal: 8), + child: AppText( + "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.white, + fontWeight: FontWeight.bold, + ), + ), + ) ], ), ], @@ -251,7 +266,7 @@ class PatientVitalSignScreen extends StatelessWidget { SizedBox( height: 16, ), - TemperatureWidget(model.patientVitalSigns), + TemperatureWidget(model, model.patientVitalSigns), SizedBox( height: 16, ), @@ -349,9 +364,10 @@ class PatientVitalSignScreen extends StatelessWidget { } class TemperatureWidget extends StatefulWidget { + final VitalSignsViewModel model; final VitalSignData vitalSign; - TemperatureWidget(this.vitalSign); + TemperatureWidget(this.model, this.vitalSign); @override _TemperatureWidgetState createState() => _TemperatureWidgetState(); @@ -450,7 +466,7 @@ class _TemperatureWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.temperatureCelciusMethod}", + "${widget.model.getTempratureMethod(widget.vitalSign.temperatureCelciusMethod)}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 19818a0c..46f8a249 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -412,6 +412,9 @@ class TranslationBase { String get fio2 => localizedValues['fio2'][locale.languageCode]; String get sao2 => localizedValues['sao2'][locale.languageCode]; String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get admission => localizedValues['admission'][locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; + String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 5833f0d2..e76fe406 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -75,10 +75,17 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).approvals, - icon: 'lab.png'), + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // route: PATIENT_INSURANCE_APPROVALS, + // nameLine1: TranslationBase.of(context).insurance, + // nameLine2: TranslationBase.of(context).approvals, + // icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, From df4eb940426fb9b90881a9606a689e8f61772dbd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 15:52:03 +0200 Subject: [PATCH 078/421] work with patient model --- lib/models/patient/patiant_info_model.dart | 203 ++++++++++++--------- 1 file changed, 115 insertions(+), 88 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2b2fd876..f1a53d8b 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,98 +1,112 @@ -import 'dart:convert'; - -//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str)); - -////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson()); -//****************************** */ - -/* - *@author: Amjad Amireh - *@Date:27/4/2020 - *@param: - *@return:Patian information Model - - *@desc: - */ +// TODO : it have to be changed. class PatiantInformtion { final List list; - int projectId; - int clinicId; - int doctorId; - int patientId; - String doctorName; - String doctorNameN; - String firstName; - String middleName; - String lastName; - String firstNameN; - String middleNameN; - String lastNameN; - int gender; - String dateofBirth; - String nationalityId; - String mobileNumber; - String emailAddress; - String patientIdentificationNo; - int patientType; - String admissionNo; - String admissionDate; - String roomId; - String bedId; - String nursingStationId; - String description; - String clinicDescription; - String clinicDescriptionN; - String nationalityName; - String nationalityNameN; - String age; - String genderDescription; - String nursingStationName; - String appointmentDate; - String startTime; - - PatiantInformtion({ - this.list, - this.projectId, - this.clinicId, - this.doctorId, - this.patientId, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, + int genderInt; + String age; + String appointmentDate; + int appointmentNo; + String appointmentType; + String arrivedOn; + int clinicGroupId; + String companyName; + Null dischargeStatus; + Null doctorDetails; + int doctorId; + String endTime; + int episodeNo; + int fallRiskScore; + bool isSigned; + int medicationOrders; + String mobileNumber; + String nationality; + int projectId; + int clinicId; + int patientId; + String doctorName; + String doctorNameN; + String firstName; + String middleName; + String lastName; + String firstNameN; + String middleNameN; + String lastNameN; + int gender; + String dateofBirth; + String nationalityId; + String emailAddress; + String patientIdentificationNo; + int patientType; + String admissionNo; + String admissionDate; + String roomId; + String bedId; + String nursingStationId; + String description; + String clinicDescription; + String clinicDescriptionN; + String nationalityName; + String nationalityNameN; + String genderDescription; + String nursingStationName; + String startTime; - }); + PatiantInformtion({ + this.list, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality, + }); - factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + factory PatiantInformtion.fromJson(Map json) => + PatiantInformtion( projectId: json["ProjectID"], clinicId: json["ClinicID"], doctorId: json["DoctorID"], @@ -127,6 +141,19 @@ class PatiantInformtion { nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', startTime: json["StartTime"], + appointmentNo :json['appointmentNo'], + appointmentType :json['appointmentType'], + arrivedOn :json['arrivedOn'], + clinicGroupId :json['clinicGroupId'], + companyName :json['companyName'], + dischargeStatus :json['dischargeStatus'], + doctorDetails :json['doctorDetails'], + endTime :json['endTime'], + episodeNo :json['episodeNo'], + fallRiskScore :json['fallRiskScore'], + isSigned :json['isSigned'], + medicationOrders :json['medicationOrders'], + nationality :json['nationality'], ); From 806682b9214863546bc3d011043f868176b8da28 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 30 Dec 2020 16:03:54 +0200 Subject: [PATCH 079/421] hack login --- .../patients/patient_search_screen.dart | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 9de384b6..b8dfe225 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -71,28 +71,28 @@ class _PatientSearchScreenState extends State { //==================== //_selectedType=='3'? //===================== - - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + // + // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // DoctorProfileModel doctorProfile = + // new DoctorProfileModel.fromJson(profile); if (_formKey.currentState.validate()) { _formKey.currentState.save(); - sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - print('************_selectedType*************'); - print('_selectedType${_selectedType}'); - String token = await sharedPref.getString(TOKEN); - - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - //===================== - // _patientSearchFormValues. - //===================== - - print("=============doctorProfile.clinicID=" + - doctorProfile.clinicID.toString()); + // sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); + // print('************_selectedType*************'); + // print('_selectedType${_selectedType}'); + // String token = await sharedPref.getString(TOKEN); + // + // _patientSearchFormValues.TokenID = token; + // _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 + // _patientSearchFormValues.DoctorID = doctorProfile.doctorID; + // _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + // //===================== + // // _patientSearchFormValues. + // //===================== + // + // print("=============doctorProfile.clinicID=" + + // doctorProfile.clinicID.toString()); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, From 61209663f3660dd85021d365a85358aaf5388e8e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 18:26:51 +0200 Subject: [PATCH 080/421] Finish arrived --- lib/core/viewModel/patient_view_model.dart | 2 +- lib/models/patient/patiant_info_model.dart | 60 +++++++++++----------- lib/screens/patients/patients_screen.dart | 9 +++- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index a1221266..9672da83 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; - Future getPatientList(PatientModel patient, patientType, + Future getPatientList( patient, patientType, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index f1a53d8b..d1f10ce0 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -107,36 +107,36 @@ class PatiantInformtion { factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - projectId: json["ProjectID"], - clinicId: json["ClinicID"], - doctorId: json["DoctorID"], - patientId: json["PatientID"], - doctorName: json["DoctorName"], - doctorNameN: json["DoctorNameN"], - firstName: json["FirstName"], - middleName: json["MiddleName"], - lastName: json["LastName"], - firstNameN: json["FirstNameN"], - middleNameN: json["MiddleNameN"], - lastNameN: json["LastNameN"], - gender: json["Gender"], - dateofBirth: json["DateofBirth"], - nationalityId: json["NationalityID"], - mobileNumber: json["MobileNumber"], - emailAddress: json["EmailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"], - patientType: json["PatientType"], - admissionNo: json["AdmissionNo"], - admissionDate: json["AdmissionDate"], - roomId: json["RoomID"], - bedId: json["BedID"], - nursingStationId: json["NursingStationID"], - description: json["Description"], - clinicDescription: json["ClinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"], - nationalityName: json["NationalityName"], - nationalityNameN: json["NationalityNameN"], - age: json["Age"], + projectId: json["ProjectID"] ?? json["projectID"], + clinicId: json["ClinicID"]?? json["clinicID"], + doctorId: json["DoctorID"]?? json["doctorID"], + patientId: json["PatientID"]?? json["patientID"], + doctorName: json["DoctorName"]?? json["doctorName"], + doctorNameN: json["DoctorNameN"]?? json["doctorNameN"], + firstName: json["FirstName"]?? json["firstName"], + middleName: json["MiddleName"]?? json["middleName"], + lastName: json["LastName"]?? json["lastName"], + firstNameN: json["FirstNameN"]?? json["firstNameN"], + middleNameN: json["MiddleNameN"]?? json["middleNameN"], + lastNameN: json["LastNameN"]?? json["lastNameN"], + gender: json["Gender"]?? json["gender"], + dateofBirth: json["DateofBirth"]?? json["dob"], + nationalityId: json["NationalityID"]?? json["nationalityID"], + mobileNumber: json["MobileNumber"]?? json["mobileNumber"], + emailAddress: json["EmailAddress"]?? json["emailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"]?? json["patientIdentificationNo"], + patientType: json["PatientType"]?? json["patientType"], + admissionNo: json["AdmissionNo"]?? json["admissionNo"], + admissionDate: json["AdmissionDate"]?? json["admissionDate"], + roomId: json["RoomID"]?? json["roomID"], + bedId: json["BedID"]?? json["bedID"], + nursingStationId: json["NursingStationID"]?? json["nursingStationID"], + description: json["Description"]?? json["description"], + clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], + clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"]?? json["nationalityName"], + nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"], + age: json["Age"]?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 85c0947c..cb0c7248 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -282,7 +282,14 @@ class _PatientsScreenState extends State { _isLoading = false; this.error = error.toString(); } else { - lItems = res[SERVICES_PATIANT2[val2]]["entityList"]; + + var localList=[]; + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient= {...v,...v["patientDetails"]}; + localList.add(mergedPatient); + }); + print(localList.toString()); + lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"]; } } else { lItems = res[SERVICES_PATIANT2[val2]]; From 05e77625332396e7bd20c8e464c6a8bbc979ce0a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 30 Dec 2020 23:13:35 +0200 Subject: [PATCH 081/421] fix obj page --- lib/client/base_app_client.dart | 3 +- lib/config/config.dart | 10 +- lib/core/service/SOAP_service.dart | 6 +- lib/models/patient/patiant_info_model.dart | 4 +- .../patients/patient_search_screen.dart | 17 ++- lib/util/translations_delegate_base.dart | 2 +- .../patients/profile/SOAP/add_SOAP_index.dart | 31 +++-- .../profile/SOAP/assessment_page.dart | 61 +++++----- .../patients/profile/SOAP/objective_page.dart | 76 ++++++------ .../patients/profile/SOAP/plan_page.dart | 10 +- .../SOAP/subjective/subjective_page.dart | 108 ++++++++++-------- .../profile/patient_profile_widget.dart | 2 +- 12 files changed, 179 insertions(+), 151 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index fe2723df..c68f9522 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -64,7 +64,8 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLC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JBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; //await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); diff --git a/lib/config/config.dart b/lib/config/config.dart index 08417a05..1a13d7e9 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -123,12 +123,12 @@ const GET_PATIENT_ARRIVAL_LIST = const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; -const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; +const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 3219ef6a..45777511 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -31,7 +31,7 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(POST_ALLERGY, + await baseAppClient.post(PATCH_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -43,7 +43,7 @@ class SOAPService extends LookupService { Future postHistories( PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(POST_HISTORY, + await baseAppClient.post(PATCH_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -55,7 +55,7 @@ class SOAPService extends LookupService { Future postChiefComplaint( PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(POST_CHIEF_COMPLAINT, + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index d1f10ce0..e5b89cfa 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -39,6 +39,7 @@ class PatiantInformtion { String emailAddress; String patientIdentificationNo; int patientType; + int patientMRN; String admissionNo; String admissionDate; String roomId; @@ -102,7 +103,7 @@ class PatiantInformtion { this.genderInt, this.isSigned, this.medicationOrders, - this.nationality, + this.nationality,this.patientMRN }); factory PatiantInformtion.fromJson(Map json) => @@ -154,6 +155,7 @@ class PatiantInformtion { isSigned :json['isSigned'], medicationOrders :json['medicationOrders'], nationality :json['nationality'], + patientMRN :json['patientMRN'], ); diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index aa8d7a96..ba32fbe1 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -83,11 +83,16 @@ class _PatientSearchScreenState extends State { _patientSearchFormValues.DoctorID = doctorProfile.doctorID; _patientSearchFormValues.ClinicID = doctorProfile.clinicID; - - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); + if ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "7") { + helpers.showErrorToast("Please Choose The Dates"); + } else { + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); + } } else { setState(() { _autoValidate = true; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 19818a0c..093423f1 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -285,7 +285,7 @@ class TranslationBase { String get transfertoadmin => localizedValues['transfertoadmin'][locale.languageCode]; - String get fromDate => localizedValues['toDate'][locale.languageCode]; + String get fromDate => localizedValues['fromDate'][locale.languageCode]; String get toDate => localizedValues['toDate'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 09d86fd8..5a698af9 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; @@ -12,14 +11,10 @@ import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page. import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../patient_profile_widget.dart'; import 'steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { @@ -96,10 +91,28 @@ class _AddSOAPIndexState extends State }, scrollDirection: Axis.horizontal, children: [ - SubjectivePage(changePageViewIndex: changePageViewIndex,myAllergiesList: myAllergiesList,myHistoryList: myHistoryList,), - ObjectivePage(changePageViewIndex: changePageViewIndex,mySelectedExamination:mySelectedExamination), - AssessmentPage(changePageViewIndex: changePageViewIndex,mySelectedAssessment:mySelectedAssessment), - PlanPage(changePageViewIndex: changePageViewIndex,) + SubjectivePage( + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + ), + ObjectivePage( + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + ), + AssessmentPage( + changePageViewIndex: changePageViewIndex, + mySelectedAssessment: + mySelectedAssessment, + patientInfo: patient, + ), + PlanPage( + changePageViewIndex: changePageViewIndex, + patientInfo: patient, + ) ], ), ), diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 6d5aa7d3..76c6cdec 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -23,9 +24,10 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class AssessmentPage extends StatefulWidget { final Function changePageViewIndex; final MySelectedAssessment mySelectedAssessment; + final PatiantInformtion patientInfo; AssessmentPage( - {Key key, this.changePageViewIndex, this.mySelectedAssessment}); + {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); @override _AssessmentPageState createState() => _AssessmentPageState(); @@ -308,35 +310,34 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - // if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - // widget.mySelectedAssessment.selectedDiagnosisType != null) { - // PostAssessmentRequestModel postAssessmentRequestModel = - // new PostAssessmentRequestModel( - // patientMRN: 3120690, - // episodeId: 200012117, - // appointmentNo: 2016054573, - // icdCodeDetails: [ - // new IcdCodeDetails( - // remarks: widget.mySelectedAssessment.remark, - // complexDiagnosis: true, - // conditionId: - // widget.mySelectedAssessment.selectedDiagnosisCondition.id, - // diagnosisTypeId: - // widget.mySelectedAssessment.selectedDiagnosisType.id, - // icdcode10Id: "1") - // ]); - // - // await model.postAssessment(postAssessmentRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(3); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } - widget.changePageViewIndex(3); + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null) { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: "1") + ]); + + await model.postAssessment(postAssessmentRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } openAssessmentDialog(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 8d12e1c9..6441ac6c 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -23,9 +24,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ObjectivePage extends StatefulWidget { final Function changePageViewIndex; final List mySelectedExamination; - + final PatiantInformtion patientInfo; ObjectivePage( - {Key key, this.changePageViewIndex, this.mySelectedExamination}); + {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); @override _ObjectivePageState createState() => _ObjectivePageState(); @@ -320,48 +321,43 @@ class _ObjectivePageState extends State { } submitObjectivePage(SOAPViewModel model) async { - // if(widget.mySelectedExamination.isNotEmpty){ - // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - // widget.mySelectedExamination.forEach((exam) { - // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - // null) - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - // - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - // ListHisProgNotePhysicalExaminationVM( - // patientMRN: 3120690, - // episodeId: 200012117, - // appointmentNo: 2016054573, - // remarks: exam.remark ?? '', - // createdBy: 1485, - // createdOn: DateTime.now().toIso8601String(), - // editedBy: 1485, - // editedOn: DateTime.now().toIso8601String(), - // examId: exam.selectedExamination.id, - // examType: exam.selectedExamination.typeId, - // isAbnormal: exam.isAbnormal, - // isNormal: exam.isNormal, - // masterDescription: exam.selectedExamination, - // notExamined: false - // - // )); - // }); - // - // await model.postPhysicalExam(postPhysicalExamRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(2); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if(widget.mySelectedExamination.isNotEmpty){ + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - widget.changePageViewIndex(2); + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: 1485, + createdOn: DateTime.now().toIso8601String(), + editedBy: 1485, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + masterDescription: exam.selectedExamination, + notExamined: false + )); + }); + await model.postPhysicalExam(postPhysicalExamRequestModel); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(2); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 3e5ca10a..3bf7aa5e 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -18,8 +19,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class PlanPage extends StatefulWidget { final Function changePageViewIndex; + final PatiantInformtion patientInfo; - PlanPage({Key key, this.changePageViewIndex}); + PlanPage({Key key, this.changePageViewIndex, this.patientInfo}); @override _PlanPageState createState() => _PlanPageState(); @@ -269,9 +271,9 @@ class _PlanPageState extends State { submitPlan(SOAPViewModel model) async { if (progressNoteController.text.isNotEmpty) { PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, planNote: progressNoteController.text); diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index d4ed9c86..18849aa5 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -7,11 +7,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -24,9 +24,15 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class SubjectivePage extends StatefulWidget { final Function changePageViewIndex; final List myAllergiesList; - final List myHistoryList ; + final List myHistoryList; + final PatiantInformtion patientInfo; - SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList}); + SubjectivePage( + {Key key, + this.changePageViewIndex, + this.myAllergiesList, + this.myHistoryList, + this.patientInfo}); @override _SubjectivePageState createState() => _SubjectivePageState(); @@ -270,44 +276,46 @@ class _SubjectivePageState extends State { formKey.currentState.save(); formKey.currentState.validate(); - widget.changePageViewIndex(1); - // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } - // - // } - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // } - // } - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + + } + + } + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + } + } + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } } @@ -324,9 +332,9 @@ class _SubjectivePageState extends State { .add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, createdBy: 1485, @@ -353,9 +361,9 @@ class _SubjectivePageState extends State { postHistoriesRequestModel.listMedicalHistoryVM = []; //TODO: make static value dynamic postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( - patientMRN: 3120690, - episodeId: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, remarks: "", historyId: history.id, historyType: history.typeId, @@ -375,11 +383,11 @@ class _SubjectivePageState extends State { PostChiefComplaintRequestModel postChiefComplaintRequestModel = //TODO: make static value dynamic new PostChiefComplaintRequestModel( - patientMRN: 3120690, - episodeID: 200012117, - appointmentNo: 2016054573, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, chiefComplaint: complaintsController.text, - currentMedication: "currentMedication", + currentMedication: " currentMedication ", hopi: illnessController.text, isLactation: false, ispregnant: false, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index ac6c7f0f..792eb49e 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -168,7 +168,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - patient.genderDescription, + patient.gender.toString() == '1' ? 'Male' : 'Female', fontWeight: FontWeight.normal, fontSize: 1.8 * SizeConfig.textMultiplier, ), From 49e9ecfa4a0d68da4641086f68d0d9a4c98dc734 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 31 Dec 2020 09:20:37 +0300 Subject: [PATCH 082/421] doctor leave --- lib/config/config.dart | 18 +- lib/config/localized_values.dart | 8 + lib/core/service/sickleave_service.dart | 55 +++ lib/core/viewModel/sick_leave_view_model.dart | 31 ++ lib/screens/dashboard_screen.dart | 40 ++- .../add-rescheduleleave.dart | 193 +++++++++++ .../reschedule-leaves/reschedule_leave.dart | 315 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 4 + 8 files changed, 658 insertions(+), 6 deletions(-) create mode 100644 lib/screens/reschedule-leaves/add-rescheduleleave.dart create mode 100644 lib/screens/reschedule-leaves/reschedule_leave.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index edb34b5e..41601b9f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = @@ -102,6 +102,11 @@ const ARRIVED_PATIENT_URL = const ADD_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/PostSickLeave'; const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; + +const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; + +const GET_RESCHEDULE_LEAVE = + 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; @@ -120,9 +125,12 @@ const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; -const POST_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; -const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; -const POST_PROGRESS_NOTE = '/Services/DoctorApplication.svc/REST/PostProgressNote'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; +const POST_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; +const POST_PROGRESS_NOTE = + '/Services/DoctorApplication.svc/REST/PostProgressNote'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 50d32393..72fa1a26 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -353,4 +353,12 @@ const Map> localizedValues = { 'instruction': {'en': 'Instructions', 'ar': 'إرشادات'}, 'addMedication': {'en': 'ADD MEDICATION', 'ar': 'اضف الدواء'}, 'route': {'en': 'Route', 'ar': 'المسار'}, + 'reschedule-leave': { + 'en': 'Reschedule and leaves', + 'ar': 'إعادة الجدولة والأوراق' + }, + 'no-reschedule-leave': { + 'en': 'No Reschedule and leaves', + 'ar': 'لا إعادة جدولة ويغادر' + } }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 70d9a3e4..926187dd 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -8,7 +8,9 @@ import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.d class SickLeaveService extends BaseService { Map get sickLeavestatisitics => _statistics; Map _statistics = {}; + var offTime = []; + get getOffTimeList => offTime; List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = []; Future getStatistics(appoNo, patientMRN) async { @@ -90,4 +92,57 @@ class SickLeaveService extends BaseService { body: {'PatientMRN': 3120772}, ); } + + Future getRescheduleLeave() async { + hasError = false; + await baseAppClient.post( + GET_RESCHEDULE_LEAVE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + _getAllsickLeave.clear(); + // response['SickLeavesList']['entityList'].forEach((v) { + // _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); + // }); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {'PatientMRN': 3120772}, + ); + } + + Future getOffTime() async { + hasError = false; + + await baseAppClient.post( + GET_OFFTIME, + onSuccess: (dynamic response, int statusCode) { + offTime = []; + offTime = response[' ']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {"MasterInput": 2013}, + ); + } + + Future getReasons(id) async { + hasError = false; + + await baseAppClient.post( + GET_OFFTIME, + onSuccess: (dynamic response, int statusCode) { + offTime = []; + offTime = response[' ']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {"MasterInput": id}, + ); + } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index a11d43ec..2e07d3b0 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -12,6 +12,7 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; + get allOffTime => _sickLeaveService.getOffTimeList; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); @@ -51,4 +52,34 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getRescheduleLeave() async { + setState(ViewState.Busy); + await _sickLeaveService.getRescheduleLeave(); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getOffTime() async { + setState(ViewState.Busy); + await _sickLeaveService.getOffTime(); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getReasons(id) async { + setState(ViewState.Busy); + await _sickLeaveService.getReasons(id); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b6bbc6cf..cb36225f 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -184,7 +185,9 @@ class _DashboardScreenState extends State { ), Container( color: Colors.white, - height: this.isExpanded ? 150 : 110, + height: this.isExpanded + ? MediaQuery.of(context).size.height * 0.19 + : MediaQuery.of(context).size.height * 0.12, ), ], ), @@ -953,6 +956,41 @@ class _DashboardScreenState extends State { SizedBox( height: 20, ), + Row( + children: [ + DashboardItem( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Icon( + Icons.rule_folder, + size: 50, + color: Colors.black, + ), + AppText( + TranslationBase.of(context).rescheduleLeaves, + color: Colors.black, + textAlign: TextAlign.center, + ) + ], + ), + hasBorder: true, + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + AddRescheduleLeavScreen(), + // MyReferredPatient(), + ), + ); + }, + ) + ], + ), + SizedBox( + height: 20, + ), ], ), ), diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart new file mode 100644 index 00000000..8963f306 --- /dev/null +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -0,0 +1,193 @@ +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/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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 AddRescheduleLeavScreen extends StatelessWidget { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getRescheduleLeave(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: model.getAllSIckLeave.length > 0 + ? SingleChildScrollView( + child: 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) + .approved + : item.status == 2 + ? TranslationBase + .of(context) + .extended + : TranslationBase + .of(context) + .pending, + fontWeight: FontWeight.bold, + color: Colors.white, + ), + color: item.status == 1 + ? Colors.green + : Colors.yellow[800], + ), + 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, + ), + ], + ), + ), + (item.status == 1 || item.status == 2) + ? Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.open_in_full, + size: 40, + ), + // color: Colors.green, //Colors.black, + onPressed: () => { + // openSickLeave(context, true, + // extendedData: item) + }, + )) + : SizedBox(), + ], + )), + SizedBox( + height: 20, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ), + ) + : new Builder(builder: (context) { + return Center( + child: SingleChildScrollView( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: Border.all( + color: HexColor('#B8382C'), width: 4), + borderRadius: + BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + openLeave( + context, + false, + ); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).noReScheduleLeave, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), + ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) + ], + ), + )); + }), + )); + } + + openLeave(BuildContext context, isExtend, + {GetAllSickLeaveResponse extendedData}) { + showModalBottomSheet( + context: context, + builder: (context) { + return new Container( + child: RescheduleLeaveScreen( + // appointmentNo: extendedData.appointmentNo, + // patientMRN: extendedData.patientMRN, + // isExtended: isExtend, + // extendedData: extendedData, + )); + }); + } +} diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart new file mode 100644 index 00000000..6de0779e --- /dev/null +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -0,0 +1,315 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +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/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/text_validator.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_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; + +Helpers helpers = Helpers(); + +class RescheduleLeaveScreen extends StatefulWidget { + RescheduleLeaveScreen(); + @override + _RescheduleLeaveScreen createState() => _RescheduleLeaveScreen(); +} + +class _RescheduleLeaveScreen extends State { + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + TextEditingController _toDateController = new TextEditingController(); + String _selectedClinic; + Map profile = {}; + AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); + void _presentDatePicker(id) { + showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime(2019), + lastDate: DateTime.now(), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + // var selectedDate = DateFormat.yMd().format(pickedDate); + final df = new DateFormat('yyyy-MM-dd'); + addSickLeave.startDate = df.format(pickedDate); + + _toDateController.text = addSickLeave.startDate; + //addSickLeave.startDate = selectedDate; + }); + }); + } + + @override + void initState() { + getProfile(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getClinicsList(), + builder: (_, model, w) => BaseView( + onModelReady: (model2) => model2.getOffTime(), + builder: (_, model2, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Container( + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).clinicName, + // fontSize: 10, + // ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + new IgnorePointer( + ignoring: true, + child: AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + inputFormatter: ONLY_NUMBERS)) + ], + ), + ), + + Container( + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).add, + onPressed: () {}, + ), + ], + ), + ), + // Column( + // children: [ + // Texts(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], + ), + ), + ), + ), + ))); + } + + getProfile() async { + Map p = await sharedPref.getObj(DOCTOR_PROFILE); + setState(() { + this.profile = p; + }); + } + + getClinicName(model) { + var clinicInfo = model.clinicsList + .where((i) => i['ClinicID'] == this.profile['ClinicID']) + .toList(); + return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 59eda9e0..4841f0f5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -387,9 +387,13 @@ class TranslationBase { String get indication => localizedValues['indication'][locale.languageCode]; String get duration => localizedValues['duration'][locale.languageCode]; String get instruction => localizedValues['instruction'][locale.languageCode]; + String get rescheduleLeaves => + localizedValues['reschedule-leave'][locale.languageCode]; String get addMedication => localizedValues['addMedication'][locale.languageCode]; String get route => localizedValues['route'][locale.languageCode]; + String get noReScheduleLeave => + localizedValues['no-reschedule-leave'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From ea4bf159c65bff1012c6b6a535eab5383918c5be Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 08:37:30 +0200 Subject: [PATCH 083/421] commit issue --- lib/config/config.dart | 10 +-- lib/core/service/SOAP_service.dart | 6 +- .../profile/SOAP/assessment_page.dart | 56 +++++++------ .../patients/profile/SOAP/objective_page.dart | 74 +++++++++-------- .../patients/profile/SOAP/plan_page.dart | 32 ++++---- .../patients/profile/SOAP/steps_widget.dart | 14 ++-- .../SOAP/subjective/subjective_page.dart | 82 ++++++++++--------- 7 files changed, 141 insertions(+), 133 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 1a13d7e9..08417a05 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -123,12 +123,12 @@ const GET_PATIENT_ARRIVAL_LIST = const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; -const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; -const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; -const PATCH_CHIEF_COMPLAINT = - 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; +const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; +const POST_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PostChiefcomplaint'; const POST_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; + 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 45777511..3219ef6a 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -31,7 +31,7 @@ class SOAPService extends LookupService { Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_ALLERGY, + await baseAppClient.post(POST_ALLERGY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -43,7 +43,7 @@ class SOAPService extends LookupService { Future postHistories( PostHistoriesRequestModel postHistoriesRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_HISTORY, + await baseAppClient.post(POST_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { @@ -55,7 +55,7 @@ class SOAPService extends LookupService { Future postChiefComplaint( PostChiefComplaintRequestModel postChiefComplaintRequestModel) async { hasError = false; - await baseAppClient.post(PATCH_CHIEF_COMPLAINT, + await baseAppClient.post(POST_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); }, onFailure: (String error, int statusCode) { diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 76c6cdec..7c55dca6 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -310,34 +310,36 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null) { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: "1") - ]); + // if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + // widget.mySelectedAssessment.selectedDiagnosisType != null) { + // PostAssessmentRequestModel postAssessmentRequestModel = + // new PostAssessmentRequestModel( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // icdCodeDetails: [ + // new IcdCodeDetails( + // remarks: widget.mySelectedAssessment.remark, + // complexDiagnosis: true, + // conditionId: + // widget.mySelectedAssessment.selectedDiagnosisCondition.id, + // diagnosisTypeId: + // widget.mySelectedAssessment.selectedDiagnosisType.id, + // icdcode10Id: "1") + // ]); + // + // await model.postAssessment(postAssessmentRequestModel); + // + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(3); + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } - await model.postAssessment(postAssessmentRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(3); - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } + widget.changePageViewIndex(3); } openAssessmentDialog(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 6441ac6c..db0a27d0 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -321,43 +321,45 @@ class _ObjectivePageState extends State { } submitObjectivePage(SOAPViewModel model) async { - if(widget.mySelectedExamination.isNotEmpty){ - PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - widget.mySelectedExamination.forEach((exam) { - if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - null) - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + // if(widget.mySelectedExamination.isNotEmpty){ + // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + // widget.mySelectedExamination.forEach((exam) { + // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + // null) + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + // // TODO : change createdBy editedBy + // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + // ListHisProgNotePhysicalExaminationVM( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // remarks: exam.remark ?? '', + // createdBy: 4709, + // createdOn: DateTime.now().toIso8601String(), + // editedBy: 4709, + // editedOn: DateTime.now().toIso8601String(), + // examId: exam.selectedExamination.id, + // examType: exam.selectedExamination.typeId, + // isAbnormal: exam.isAbnormal, + // isNormal: exam.isNormal, + // masterDescription: exam.selectedExamination, + // notExamined: false + // + // )); + // }); + // + // await model.postPhysicalExam(postPhysicalExamRequestModel); + // + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(2); + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } - postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - ListHisProgNotePhysicalExaminationVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: exam.remark ?? '', - createdBy: 1485, - createdOn: DateTime.now().toIso8601String(), - editedBy: 1485, - editedOn: DateTime.now().toIso8601String(), - examId: exam.selectedExamination.id, - examType: exam.selectedExamination.typeId, - isAbnormal: exam.isAbnormal, - isNormal: exam.isNormal, - masterDescription: exam.selectedExamination, - notExamined: false - - )); - }); - - await model.postPhysicalExam(postPhysicalExamRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(2); - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } + widget.changePageViewIndex(2); } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index 3bf7aa5e..e0653b3e 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -269,22 +269,24 @@ class _PlanPageState extends State { } submitPlan(SOAPViewModel model) async { - if (progressNoteController.text.isNotEmpty) { - PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text); + // if (progressNoteController.text.isNotEmpty) { + // PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( + // patientMRN: widget.patientInfo.patientMRN, + // episodeId: widget.patientInfo.episodeNo, + // appointmentNo: widget.patientInfo.appointmentNo, + // planNote: progressNoteController.text); + // + // + // await model.postProgressNote(postProgressNoteRequestModel); + // + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // Navigator.of(context).pop(); + // } + // } - - await model.postProgressNote(postProgressNoteRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - Navigator.of(context).pop(); - } - } + Navigator.of(context).pop(); } openProgressNote(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/steps_widget.dart b/lib/widgets/patients/profile/SOAP/steps_widget.dart index d5cb7ddc..d67d94e3 100644 --- a/lib/widgets/patients/profile/SOAP/steps_widget.dart +++ b/lib/widgets/patients/profile/SOAP/steps_widget.dart @@ -34,7 +34,7 @@ class StepsWidget extends StatelessWidget { top: index == 0 ? 15 : 30, left: 0, child: InkWell( - onTap: () => changeCurrentTab(0), + //onTap: () => changeCurrentTab(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -84,7 +84,7 @@ class StepsWidget extends StatelessWidget { top: index == 1 ? 15 : 30, left: MediaQuery.of(context).size.width * 0.28, child: InkWell( - onTap: () => index >= 1 ? changeCurrentTab(1) : null, + //onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -187,7 +187,7 @@ class StepsWidget extends StatelessWidget { top: index == 3 ? 15 : 30, right: 0, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, + //onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -257,7 +257,7 @@ class StepsWidget extends StatelessWidget { top: index == 0 ? 15 : 30, right: 0, child: InkWell( - onTap: () => changeCurrentTab(0), + //onTap: () => changeCurrentTab(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -307,7 +307,7 @@ class StepsWidget extends StatelessWidget { top: index == 1 ? 15 : 30, right: MediaQuery.of(context).size.width * 0.28, child: InkWell( - onTap: () => index >= 2 ? changeCurrentTab(1) : null, + //onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -357,7 +357,7 @@ class StepsWidget extends StatelessWidget { top: index == 2 ? 15 : 30, right: MediaQuery.of(context).size.width * 0.52, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(2) : null, + //onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -411,7 +411,7 @@ class StepsWidget extends StatelessWidget { top: index == 3 ? 15 : 30, left: 0, child: InkWell( - onTap: () => index >= 3 ? changeCurrentTab(4) : null, + //onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index 18849aa5..c3d56fe8 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -277,45 +277,47 @@ class _SubjectivePageState extends State { formKey.currentState.validate(); - if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - await postChiefComplaint(model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - if (myHistoryList.length != 0) { - await postHistories(model: model, myHistoryList: myHistoryList); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } else { - widget.changePageViewIndex(1); + // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + // await postChiefComplaint(model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myHistoryList.length != 0) { + // await postHistories(model: model, myHistoryList: myHistoryList); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } else { + // widget.changePageViewIndex(1); + // + // } + // + // } + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } else { + // widget.changePageViewIndex(1); + // } + // } + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } - } - - } - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } else { - widget.changePageViewIndex(1); - } - } - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } + widget.changePageViewIndex(1); } @@ -337,10 +339,10 @@ class _SubjectivePageState extends State { appointmentNo: widget.patientInfo.appointmentNo, severity: allergy.selectedAllergySeverity.id, remarks: allergy.remark, - createdBy: 1485, + createdBy: 4709, // createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", - editedBy: 1485, + editedBy: 4709, editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", isChecked: false, isUpdatedByNurse: false)); From b3345a86eff841653202d045fdca6432c82dc1ad Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 31 Dec 2020 12:39:34 +0200 Subject: [PATCH 084/421] post prescription --- lib/core/service/prescription_service.dart | 2 +- .../viewModel/prescription_view_model.dart | 4 +- lib/core/viewModel/procedure_View_model.dart | 4 +- .../patients/patient_search_screen.dart | 18 +- .../prescription/add_prescription_form.dart | 525 +++++++++++------- .../prescription/prescription_screen.dart | 139 +++-- lib/screens/procedures/procedure_screen.dart | 327 ++++++++--- .../SOAP/subjective/subjective_page.dart | 70 +-- 8 files changed, 699 insertions(+), 390 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 65e74dda..9d1cb102 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -9,7 +9,7 @@ class PrescriptionService extends BaseService { List get prescriptionList => _prescriptionList; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( - patientMRN: 1231755, + patientMRN: 3120877, vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNRURJQ0FMIFNUQUZGUyIsIkJJTy1NRURJQ0FMIFRFQ0hOSUNJQU5TIiwiQklPLU1FRElDQUwgRU5HSU5FRVJTIiwiQklPLU1FRElDQUwgREVQQVJUTUVOVCBIRUFEUyIsIklUIEhFTFAgREVTSyIsIkFETUlOSVNUUkFUT1JTIiwiTEFCIEFETUlOSVNUUkFUT1IiLCJMQUIgVEVDSE5JQ0lBTiIsIkJVU0lORVNTIE9GRklDRSBTVEFGRiIsIkZJTkFOQ0UgQUNDT1VOVEFOVFMiLCJQSEFSTUFDWSBTVEFGRiIsIkFDQ09VTlRTIFNUQUZGIiwiTEFCIFJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiSU5QQVRJRU5UIEJJTExJTkcgU1VQRVJWSVNPUiIsIkxEUi1PUiBOVVJTRVMiLCJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", ); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 6c3fe7b2..7923c3d7 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -33,7 +33,9 @@ class PrescriptionViewModel extends BaseViewModel { if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); - } else + } else { + await getPrescription(); setState(ViewState.Idle); + } } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 13e18ed3..b051d04d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -45,7 +45,9 @@ class ProcedureViewModel extends BaseViewModel { if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); - } else + } else { + await getProcedure(); setState(ViewState.Idle); + } } } diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 9de384b6..f64a43f5 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -72,9 +72,9 @@ class _PatientSearchScreenState extends State { //_selectedType=='3'? //===================== - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + //Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // DoctorProfileModel doctorProfile = + // new DoctorProfileModel.fromJson(profile); if (_formKey.currentState.validate()) { _formKey.currentState.save(); @@ -83,16 +83,16 @@ class _PatientSearchScreenState extends State { print('_selectedType${_selectedType}'); String token = await sharedPref.getString(TOKEN); - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + // _patientSearchFormValues.TokenID = token; + // _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 + // _patientSearchFormValues.DoctorID = doctorProfile.doctorID; + // _patientSearchFormValues.ClinicID = doctorProfile.clinicID; //===================== // _patientSearchFormValues. //===================== - print("=============doctorProfile.clinicID=" + - doctorProfile.clinicID.toString()); + // print("=============doctorProfile.clinicID=" + + // doctorProfile.clinicID.toString()); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5782a166..a988b61c 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -5,250 +5,355 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.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/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -void addPrescriptionForm(context) { +void addPrescriptionForm(context, PrescriptionViewModel model) { TextEditingController durationController = TextEditingController(); + TextEditingController strengthController = TextEditingController(); + TextEditingController routeController = TextEditingController(); + TextEditingController frequencyController = TextEditingController(); + TextEditingController indicationController = TextEditingController(); + TextEditingController instructions = TextEditingController(); + + TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); - final GlobalKey _formKey = GlobalKey(); + final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext bc) { - return SingleChildScrollView( - child: Container( - height: 700, - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: _formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: - TranslationBase.of(context).searchMedicine, - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - ), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).orderType, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).strength, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).route, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).frequency, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).doseTime, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - controller: doseController, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).indication, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).fromDate, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: TranslationBase.of(context).duration, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - controller: durationController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: - TranslationBase.of(context).instruction, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: - TranslationBase.of(context).addMedication, - onPressed: () { - //prescriptionWarning(context); - postProcedure( - duration: durationController.text, - dose: doseController.text); - Navigator.pop(context); - }, + return DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .searchMedicine, + controller: drugIdController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).orderType, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).strength, + keyboardType: TextInputType.number, + controller: strengthController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context).route, + controller: routeController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).frequency, + controller: frequencyController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).doseTime, + controller: doseController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).indication, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).fromDate, + keyboardType: TextInputType.datetime, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).duration, + // borderColor: Colors.white, + keyboardType: TextInputType.number, + controller: durationController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).instruction, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); + + if (formKey.currentState.validate()) { + postPrescription( + model: model, + duration: durationController.text, + dose: doseController.text, + frequency: + frequencyController.text, + route: routeController.text, + drugId: drugIdController.text, + strength: strengthController.text, + indication: + indicationController.text, + instruction: + indicationController.text, + ); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], + ), ), ], ), ), - ], - ), + ), + ], ), ), - ], - ), - ), - ), - ); + ), + ); + }); }); } -postProcedure({String duration, String dose}) async { - PrescriptionViewModel model = new PrescriptionViewModel(); +postPrescription( + {String duration, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); List sss = List(); - postProcedureReqModel.appointmentNo = 2016055175; - postProcedureReqModel.clinicID = 1; - postProcedureReqModel.episodeID = 200012335; - postProcedureReqModel.patientMRN = 1234; + postProcedureReqModel.appointmentNo = 2016055159; + postProcedureReqModel.clinicID = 17; + postProcedureReqModel.episodeID = 200012330; + postProcedureReqModel.patientMRN = 3120877; postProcedureReqModel.vidaAuthTokenID = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( covered: true, dose: int.parse(dose), - itemId: 8, + itemId: int.parse(drugId), doseUnitId: 1, - route: 1, - frequency: 1, - remarks: "test2", + route: int.parse(route), + frequency: int.parse(frequency), + remarks: instruction, approvalRequired: true, icdcode10Id: "test2", doseTime: 1, @@ -261,7 +366,7 @@ postProcedure({String duration, String dose}) async { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - } else { + } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('Medication has been added'); } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 742cfad8..4f6fe133 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -110,7 +110,7 @@ class _NewPrescriptionScreenState extends State { children: [ InkWell( onTap: () { - addPrescriptionForm(context); + addPrescriptionForm(context, model); //model.postPrescription(); }, child: CircleAvatar( @@ -156,7 +156,7 @@ class _NewPrescriptionScreenState extends State { ], ) : Padding( - padding: EdgeInsets.all(12.0), + padding: EdgeInsets.all(14.0), child: NetworkBaseView( baseViewModel: model, child: Column( @@ -194,7 +194,7 @@ class _NewPrescriptionScreenState extends State { ), ), onTap: () { - addPrescriptionForm(context); + addPrescriptionForm(context, model); //model.postPrescription(); }, ), @@ -204,19 +204,22 @@ class _NewPrescriptionScreenState extends State { ...List.generate( model.prescriptionList[0].rowcount, (index) => Container( + //height: 240, child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment .spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, children: [ Container( height: MediaQuery.of(context) .size .height * - 0.2, + 0.23, width: MediaQuery.of(context) .size @@ -236,12 +239,12 @@ class _NewPrescriptionScreenState extends State { MediaQuery.of(context) .size .height * - 0.24, + 0.282, width: MediaQuery.of(context) .size .width * - 0.81, + 0.77, child: Column( children: [ Row( @@ -250,17 +253,20 @@ class _NewPrescriptionScreenState extends State { 'Start Date:', fontWeight: FontWeight - .w900, - fontSize: 15.0, + .w700, + fontSize: 14.0, ), - AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .startDate, - fontSize: 11.0, + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .startDate, + fontSize: + 12.0, + ), ), SizedBox( width: 6.0, @@ -269,22 +275,25 @@ class _NewPrescriptionScreenState extends State { 'Order Type:', fontWeight: FontWeight - .w900, - fontSize: 15.0, + .w700, + fontSize: 14.0, ), - AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .orderTypeDescription, - fontSize: 13.0, + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .orderTypeDescription, + fontSize: + 13.0, + ), ), ], ), SizedBox( - height: 2.5, + height: 5.5, ), Row( children: [ @@ -298,11 +307,19 @@ class _NewPrescriptionScreenState extends State { .entityList[ index] .medicationName, + fontWeight: + FontWeight + .w700, + fontSize: + 15.0, ), ), ) ], ), + SizedBox( + height: 5.5, + ), Row( children: [ Expanded( @@ -314,7 +331,7 @@ class _NewPrescriptionScreenState extends State { index] .doseDetail, fontSize: - 13.0, + 15.0, ), ) ], @@ -328,7 +345,8 @@ class _NewPrescriptionScreenState extends State { 'Indication: ', fontWeight: FontWeight - .w900, + .w700, + fontSize: 17.0, ), Expanded( child: AppText( @@ -339,40 +357,48 @@ class _NewPrescriptionScreenState extends State { index] .indication, fontSize: - 12.9), + 15.0), ) ], ), SizedBox( - height: 15.0, + height: 18.0, ), Row( children: [ - AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .doctorName, - fontWeight: - FontWeight - .w900, + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .doctorName, + fontWeight: + FontWeight + .w700, + ), ) ], ), Row( children: [ - AppText(model - .prescriptionList[ - 0] - .entityList[ - index] - .remarks), + Expanded( + child: AppText( + model + .prescriptionList[ + 0] + .entityList[ + index] + .remarks, + fontSize: + 14.0, + ), + ), ], ), SizedBox( - height: 15.0, + height: 10.0, ), Divider( @@ -386,6 +412,23 @@ class _NewPrescriptionScreenState extends State { ], ), ), + Container( + height: + MediaQuery.of(context) + .size + .height * + 0.05, + width: + MediaQuery.of(context) + .size + .width * + 0.06, + child: Column( + children: [ + Icon(Icons.edit) + ], + ), + ), ], ), ], diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 5b6b10f3..2bdb7f78 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -111,7 +111,10 @@ class _ProcedureScreenState extends State { children: [ InkWell( onTap: () { - addSelectedProcedure(context); + model.getCategories().then((value) { + addSelectedProcedure(context, model); + }); + //model.postPrescription(); }, child: CircleAvatar( @@ -149,7 +152,7 @@ class _ProcedureScreenState extends State { AppText( TranslationBase.of(context).addNow, color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, + fontWeight: FontWeight.w700, ), ], ), @@ -194,7 +197,12 @@ class _ProcedureScreenState extends State { ), ), onTap: () { - addSelectedProcedure(context); + model.getCategories().then((value) { + addSelectedProcedure( + context, model); + }); + + //model.postPrescription(); }, ), // Container( @@ -252,7 +260,7 @@ class _ProcedureScreenState extends State { 'Code #: ', fontWeight: FontWeight - .w900, + .w700, fontSize: 15.0, ), AppText( @@ -272,7 +280,7 @@ class _ProcedureScreenState extends State { 'Order Type: ', fontWeight: FontWeight - .w900, + .w700, fontSize: 15.0, ), AppText( @@ -310,7 +318,7 @@ class _ProcedureScreenState extends State { 'Price: ', fontWeight: FontWeight - .w900, + .w700, ), Expanded( child: AppText( @@ -382,7 +390,6 @@ class _ProcedureScreenState extends State { } postProcedure({ProcedureViewModel model}) async { - model = new ProcedureViewModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); List controls = List(); List controlsProcedure = List(); @@ -402,98 +409,248 @@ postProcedure({ProcedureViewModel model}) async { postProcedureReqModel.procedures = controlsProcedure; await model.postProcedure(postProcedureReqModel); - DrAppToastMsg.showSuccesToast('Procedure had been added'); + if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); } } -void addSelectedProcedure(context) { +void addSelectedProcedure(context, ProcedureViewModel model) { + showModalBottomSheet( + context: context, + builder: (BuildContext bc) { + return AddSelectedProcedure( + model: model, + ); + }); +} + +class AddSelectedProcedure extends StatefulWidget { + final ProcedureViewModel model; + + const AddSelectedProcedure({Key key, this.model}) : super(key: key); + @override + _AddSelectedProcedureState createState() => _AddSelectedProcedureState(); +} + +class _AddSelectedProcedureState extends State { TextEditingController procedureController = TextEditingController(); + + @override + Widget build(BuildContext context) { + return NetworkBaseView( + baseViewModel: widget.model, + child: SingleChildScrollView( + child: Container( + height: 490, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Select Procedure'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + if (widget.model.categoriesList.length != 0) + Container( + // child: ListView( + // children: [ + // Column( + // children: model.historyFamilyList + // .map((historyInfo) { + // return Column( + // children: [ + // Row( + // children: [ + // Checkbox( + // value: isServiceSelected( + // historyInfo), + // activeColor: + // Colors.red[800], + // onChanged: + // (bool newValue) { + // setState(() { + // if (isServiceSelected( + // historyInfo + // )) { + // widget + // .removeHistory( + // historyInfo + // ); + // } + // else { + // widget + // .myHistoryList + // .add( + // historyInfo); + // } + // }); + // }), + // Expanded( + // child: Padding( + // padding: + // const EdgeInsets + // .symmetric( + // horizontal: 10, + // vertical: 0), + // child: Texts( + // historyInfo.nameEn, + // variant: "bodyText", + // bold: true, + // color: + // Colors.black), + // ), + // ), + // ], + // ), + // DividerWithSpacesAround(), + // ], + // ); + // }).toList(), + // ), + // ], + // ), + height: 120.0, + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: widget.model.categoriesList[0].rowcount, + itemBuilder: (BuildContext ctxt, int index) { + return Container( + child: AppText(widget.model.categoriesList[0] + .entityList[index].procedureName), + ); + }), + ), + SizedBox( + height: 0.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Add Delected Procedures'.toUpperCase(), + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + controller: procedureController, + ), + ), + SizedBox( + height: 80.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context).addMedication, + onPressed: () { + Navigator.pop(context); + postProcedure(model: widget.model); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ), + ); + } +} + +// isServiceSelected(ProcedureViewModel masterKey) { +// Iterable history = widget.myHistoryList.where((element) => +// masterKey.id == element.id && masterKey.typeId == element.typeId); +// if (history.length > 0) { +// return true; +// } +// return false; +// } + +void updateProcedureForm(context) { showModalBottomSheet( context: context, + isScrollControlled: true, builder: (BuildContext bc) { - return BaseView( - onModelReady: (model) => model.getCategories(), - builder: - (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - height: 490, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Select Procedure'.toUpperCase(), - fontWeight: FontWeight.w900, + return Container( + height: 500, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Procedure Name'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 30.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Order ', + borderColor: Colors.white, + textInputType: TextInputType.number, + inputFormatter: ONLY_NUMBERS, ), - if (model.categoriesList.length != 0) - Container( - height: 120.0, - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.categoriesList[0].rowcount, - itemBuilder: (BuildContext ctxt, int index) { - return Container( - child: AppText(model.categoriesList[0] - .entityList[index].procedureName), - ); - }), - ), - SizedBox( - height: 0.0, + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: AppTextFormField( + labelText: 'Password', + borderColor: Colors.white, + textInputType: TextInputType.text, + inputFormatter: ONLY_LETTERS, + obscureText: true, ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: - 'Add Delected Procedures'.toUpperCase(), - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - controller: procedureController, - ), - ), - SizedBox( - height: 80.0, - ), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: - TranslationBase.of(context).addMedication, - onPressed: () { - Navigator.pop(context); - postProcedure(); - }, - ), - ], - ), + ), + SizedBox( + height: 190.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'CONTINUE', + onPressed: () { + Navigator.pop(context); + // authorizationForm(context); + }, ), ], - ) - ], - ), + ), + ), + ], ), ), - ), - ), - ); + )); }); } diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart index d4ed9c86..20833a02 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart @@ -24,9 +24,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class SubjectivePage extends StatefulWidget { final Function changePageViewIndex; final List myAllergiesList; - final List myHistoryList ; + final List myHistoryList; - SubjectivePage({Key key, this.changePageViewIndex, this.myAllergiesList, this.myHistoryList}); + SubjectivePage( + {Key key, + this.changePageViewIndex, + this.myAllergiesList, + this.myHistoryList}); @override _SubjectivePageState createState() => _SubjectivePageState(); @@ -102,15 +106,13 @@ class _SubjectivePageState extends State { minLines: 13, controller: complaintsController, validator: (value) { - if (value == null || value =="") - return TranslationBase - .of(context) + if (value == null || value == "") + return TranslationBase.of(context) .emptyMessage; else if (value.length < 25) - return TranslationBase - .of(context) + return TranslationBase.of(context) .chiefComplaintLength; - //""; + //""; else return null; }), @@ -129,9 +131,8 @@ class _SubjectivePageState extends State { minLines: 13, controller: illnessController, validator: (value) { - if (value == null || value =="") - return TranslationBase - .of(context) + if (value == null || value == "") + return TranslationBase.of(context) .emptyMessage; else return null; @@ -146,7 +147,6 @@ class _SubjectivePageState extends State { ), isExpand: isChiefExpand, ), - SizedBox( height: 30, ), @@ -222,15 +222,16 @@ class _SubjectivePageState extends State { : EvaIcons.plus)) ], ), - bodyWidget:Column( + bodyWidget: Column( children: [ - AddAllergiesWidget(myAllergiesList: widget.myAllergiesList,), + AddAllergiesWidget( + myAllergiesList: widget.myAllergiesList, + ), SizedBox( height: 30, ), ], - ) - , + ), isExpand: isAllergiesExpand, ), SizedBox( @@ -308,7 +309,6 @@ class _SubjectivePageState extends State { // } else { // helpers.showErrorToast('Please add required field correctly'); // } - } postAllergy( @@ -320,8 +320,8 @@ class _SubjectivePageState extends State { null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; //TODO: make static value dynamic - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM - .add(ListHisProgNotePatientAllergyDiseaseVM( + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, allergyDiseaseType: allergy.selectedAllergy.typeId, patientMRN: 3120690, @@ -331,9 +331,11 @@ class _SubjectivePageState extends State { remarks: allergy.remark, createdBy: 1485, // - createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", + createdOn: DateTime.now() + .toIso8601String(), //"2020-08-14T20:37:22.780Z", editedBy: 1485, - editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", + editedOn: DateTime.now() + .toIso8601String(), //"2020-08-14T20:37:22.780Z", isChecked: false, isUpdatedByNurse: false)); }); @@ -371,23 +373,21 @@ class _SubjectivePageState extends State { postChiefComplaint({SOAPViewModel model}) async { formKey.currentState.save(); - if(formKey.currentState.validate()){ + if (formKey.currentState.validate()) { PostChiefComplaintRequestModel postChiefComplaintRequestModel = - //TODO: make static value dynamic - new PostChiefComplaintRequestModel( - patientMRN: 3120690, - episodeID: 200012117, - appointmentNo: 2016054573, - chiefComplaint: complaintsController.text, - currentMedication: "currentMedication", - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - numberOfWeeks: 22); + //TODO: make static value dynamic + new PostChiefComplaintRequestModel( + patientMRN: 3120690, + episodeID: 200012117, + appointmentNo: 2016054573, + chiefComplaint: complaintsController.text, + currentMedication: "currentMedication", + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + numberOfWeeks: 22); await model.postChiefComplaint(postChiefComplaintRequestModel); - } - } } From 5142b5b6c7434efb291bb273ecba570d594bcf77 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 31 Dec 2020 13:38:47 +0200 Subject: [PATCH 085/421] finish admission request design --- lib/config/localized_values.dart | 23 + lib/core/enum/master_lookup_key.dart | 8 +- .../service/admission-request-service.dart | 5 - lib/core/service/base/lookup-service.dart | 20 +- .../patient-admission-request-service.dart | 31 ++ .../patient-admission-request-viewmodel.dart | 39 +- lib/locator.dart | 2 +- lib/routes.dart | 6 + .../admission-request-detail-screen.dart | 278 +++++++++++- .../admission-request-third-screen.dart | 208 +++++++++ .../admission-request_second-screen.dart | 402 ++++++++++++++++++ lib/util/helpers.dart | 45 ++ lib/util/translations_delegate_base.dart | 23 + 13 files changed, 1059 insertions(+), 31 deletions(-) delete mode 100644 lib/core/service/admission-request-service.dart create mode 100644 lib/core/service/patient-admission-request-service.dart create mode 100644 lib/screens/patients/profile/admission-request/admission-request-third-screen.dart create mode 100644 lib/screens/patients/profile/admission-request/admission-request_second-screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index adc3c25e..c84307a5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -278,6 +278,7 @@ const Map> localizedValues = { "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, + 'date': {'en': 'Date', 'ar': 'التاريخ'}, 'admissionNo': {'en': 'ADMISSION #: ', 'ar': 'قبول #:'}, 'losNo': {'en': 'LOS #:', 'ar': 'LOS #:'}, 'area': {'en': 'AREA:', 'ar': 'المنطقة'}, @@ -378,4 +379,26 @@ const Map> localizedValues = { 'admission': {'en': "Admission", 'ar': 'قبول'}, 'request': {'en': "Request", 'ar': 'طلب'}, 'admissionRequest': {'en': "Admission Request", 'ar': 'طلب قبول'}, + 'patientDetails': {'en': "Patient Details", 'ar': 'تفاصيل المريض'}, + 'specialityAndDoctorDetail': {'en': "SPECIALITY AND DOCTOR DETAILS", 'ar': 'تفاصيل التخصص والطبيب'}, + 'referringDate': {'en': "Referring Date", 'ar': 'تاريخ الإحالة'}, + 'referringDoctor': {'en': "Referring Doctor", 'ar': 'دكتور الإحالة'}, + 'otherInformation': {'en': "Other Information", 'ar': 'معلومات أخرى'}, + 'expectedDays': {'en': "Expected Days", 'ar': 'الأيام المتوقعة'}, + 'expectedAdmissionDate': {'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع'}, + 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, + 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, + 'treatmentLine': {'en': "Main line of treatment", 'ar': 'الخط الرئيسي للعلاج'}, + 'ward': {'en': "Ward", 'ar': 'رعاية'}, + 'preAnesthesiaReferred': {'en': "PRE ANESTHESIA REFERRED", 'ar': 'الاحالة قبل التخدير'}, + 'admissionType': {'en': "Admission Type", 'ar': 'نوع القبول'}, + 'diagnosis': {'en': "Diagnosis", 'ar': 'التشخيص'}, + 'allergies': {'en': "Allergies", 'ar': 'الحساسية'}, + 'preOperativeOrders': {'en': "Pre Operative Orders", 'ar': 'أوامر ما قبل العملية'}, + 'elementForImprovement': {'en': "Element For Improvement", 'ar': 'عنصر للتحسين'}, + 'dischargeDate': {'en': "Discharge Date", 'ar': 'تاريخ التفريغ'}, + 'dietType': {'en': "Diet Type", 'ar': 'نوع النظام الغذائي'}, + 'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, + 'save': {'en': "SAVE", 'ar': 'حفظ'}, + 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, }; diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index 8f5d76f8..f1ba1d46 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -10,7 +10,9 @@ enum MasterKeysService { physiotherapyGoals, DiagnosisCondition, DiagnosisType, - ICD10 + ICD10, + TemperatureMethods, + Speciality } extension SelectedMasterKeysService on MasterKeysService { @@ -51,6 +53,10 @@ extension SelectedMasterKeysService on MasterKeysService { break; case MasterKeysService.ICD10: return 2500; + case MasterKeysService.TemperatureMethods: + return 2005; + case MasterKeysService.Speciality: + return 10; break; } } diff --git a/lib/core/service/admission-request-service.dart b/lib/core/service/admission-request-service.dart deleted file mode 100644 index e98ac048..00000000 --- a/lib/core/service/admission-request-service.dart +++ /dev/null @@ -1,5 +0,0 @@ -import 'package:doctor_app_flutter/core/service/base/base_service.dart'; - -class AdmissionRequestService extends BaseService { - -} \ No newline at end of file diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index d677201b..df8ebc38 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -34,6 +34,8 @@ class LookupService extends BaseService { List listOfDiagnosisType = []; List listOfDiagnosisCondition = []; List listOfICD10 = []; + List listOfTemperatureMethods = []; + List listOfSpeciality = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -121,13 +123,27 @@ class LookupService extends BaseService { .add(MasterKeyModel.fromJson(v)); }); break; - case MasterKeysService.ICD10: - listOfICD10.clear(); + case MasterKeysService.ICD10: + listOfICD10.clear(); entryList.forEach((v) { listOfICD10 .add(MasterKeyModel.fromJson(v)); }); break; + case MasterKeysService.TemperatureMethods: + listOfTemperatureMethods.clear(); + entryList.forEach((v) { + listOfTemperatureMethods + .add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.Speciality: + listOfSpeciality.clear(); + entryList.forEach((v) { + listOfSpeciality + .add(MasterKeyModel.fromJson(v)); + }); + break; } } } diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart new file mode 100644 index 00000000..62932908 --- /dev/null +++ b/lib/core/service/patient-admission-request-service.dart @@ -0,0 +1,31 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; + +class AdmissionRequestService extends LookupService { + List doctorsList = []; + List specialityList = []; + + setSpecialityList() { + specialityList.clear(); + listOfSpeciality.forEach((element) { + specialityList.add(element.toJson()); + }); + } + + Future getDoctorsList() async { + hasError = false; + + await baseAppClient.post( + PATIENT_GET_DOCTOR_BY_CLINIC_URL, + onSuccess: (dynamic response, int statusCode) { + doctorsList = []; + doctorsList = response['List_Doctors_All']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } +} diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 28aaae8a..15f54e5d 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,9 +1,46 @@ -import 'package:doctor_app_flutter/core/service/admission-request-service.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import '../../locator.dart'; class AdmissionRequestViewModel extends BaseViewModel{ AdmissionRequestService _admissionRequestService = locator(); + + List get doctorsList => _admissionRequestService.doctorsList; + + List get speciality => _admissionRequestService.specialityList; + + String selectedLanguage; + + Future getLanguage() async { + selectedLanguage = await sharedPref.getString(APP_Language); + } + + Future getMasterLookup() async { + setState(ViewState.Busy); + await getLanguage(); + await _admissionRequestService.getMasterLookup(MasterKeysService.Speciality); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.Error); + } else { + _admissionRequestService.setSpecialityList(); + await getClinicDoctors(); + } + } + + Future getClinicDoctors() async { + setState(ViewState.Busy); + await _admissionRequestService.getDoctorsList(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 8c67b703..0b932a62 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:get_it/get_it.dart'; import 'core/service/SOAP_service.dart'; -import 'core/service/admission-request-service.dart'; +import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; import 'core/service/patient-vital-signs-service.dart'; diff --git a/lib/routes.dart b/lib/routes.dart index 52183a63..ff03096f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -42,6 +42,8 @@ import 'landing_page.dart'; import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart'; +import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; +import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; import 'screens/patients/profile/referral/refer-patient-screen.dart'; import 'screens/prescription/prescription_screen.dart'; @@ -84,6 +86,8 @@ const String CREATE_EPISODE = 'patients/create-episode'; const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String UPDATE_EPISODE = 'patients/create-episode'; const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; +const String PATIENT_ADMISSION_REQUEST_2 = 'patients/admission-request-second'; +const String PATIENT_ADMISSION_REQUEST_3 = 'patients/admission-request-third'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -129,6 +133,8 @@ var routes = { VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), + PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), + PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index dd628abf..9a474779 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -1,49 +1,285 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/util/helpers.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_buttons_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/dialogs/dailog-list-select.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../routes.dart'; +import 'admission-request_second-screen.dart'; + class AdmissionRequestDetailScreen extends StatefulWidget { @override - _AdmissionRequestDetailScreenState createState() => _AdmissionRequestDetailScreenState(); + _AdmissionRequestDetailScreenState createState() => + _AdmissionRequestDetailScreenState(); } -class _AdmissionRequestDetailScreenState extends State { +class _AdmissionRequestDetailScreenState + extends State { + DateTime selectedDate; + dynamic _selectedSpeciality; + dynamic _selectedDoctor; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) => model.getMasterLookup(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).admissionRequest, - body: Column( - children: [ - SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, + body: model.doctorsList != null + ? Column( children: [ - PatientPageHeaderWidget(patient), + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).patientDetails, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + decoration: + Helpers.containerBorderDecoration( + Color(0xFFEEEEEE), + Color(0xFFCCCCCC), + borderWidth: 0.0), + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + "Pre Admission Number :01", + null, + false), + enabled: false, + // controller: _remarksController, + keyboardType: TextInputType.text, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => _selectDate(context, model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .specialityAndDoctorDetail, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.speciality, + attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn' , + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedSpeciality = + selectedValue; + }); + }); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .speciality, + _selectedSpeciality != null + ? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).doctor, + _selectedDoctor != null + ? _selectedDoctor['DoctorName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + decoration: + Helpers.containerBorderDecoration( + Color(0xFFEEEEEE), + Color(0xFFCCCCCC), + borderWidth: 0.0), + child: InkWell( + onTap: () => null, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).referringDate, + null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Color(0xFFCCCCCC), + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + decoration: + Helpers.containerBorderDecoration( + Color(0xFFEEEEEE), + Color(0xFFCCCCCC), + borderWidth: 0.0), + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).referringDoctor, + null, + true, dropDownColor: Color(0xFFCCCCCC)), + enabled: false, + // controller: _remarksController, + keyboardType: TextInputType.text, + )), + ], + ), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: (){ + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient}); + }, + ), + ), ], - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).refer, - color: HexColor("#B8382B"), - onPressed: null, - ), - ), - ], - ), - ), + ) + : Container(), + ), + ); + } + + _selectDate(BuildContext context, AdmissionRequestViewModel model) async { + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now().add(Duration(hours: 2)), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, ); + if (picked != null && picked != selectedDate) { + setState(() { + selectedDate = picked; + }); + } } } diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart new file mode 100644 index 00000000..aacff6dd --- /dev/null +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -0,0 +1,208 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/util/helpers.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_buttons_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:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class AdmissionRequestThirdScreen extends StatefulWidget { + @override + _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); +} + +class _AdmissionRequestThirdScreenState extends State { + + final _postPlansEstimatedCostController = TextEditingController(); + final _dietTypeRemarksController = TextEditingController(); + DateTime _dischargeDate; + dynamic _selectedDietType; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + + return BaseView( + // onModelReady: (model) => model.getMasterLookup(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).admissionRequest, + body: model.doctorsList != null + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).postPlansEstimatedCost, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .postPlansEstimatedCost, + null, + false), + enabled: true, + controller: _postPlansEstimatedCostController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () { + if (_dischargeDate == null) { + _dischargeDate = DateTime.now(); + } + _selectDate( + context, _dischargeDate, + (picked) { + setState(() { + _dischargeDate = picked; + }); + }); + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedAdmissionDate, + _dischargeDate != null + ? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: /*model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + :*/ null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).dietType, + /* _admissionType != null + ? _admissionType['DoctorName'] + :*/ null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .dietTypeRemarks, + null, + false), + enabled: true, + controller: _dietTypeRemarksController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + ], + ), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).save, + color: HexColor("#B8382B"), + onPressed: null, + ), + ), + ], + ) + : Container(), + ), + ); + } + + Future _selectDate(BuildContext context, DateTime dateTime, + Function(DateTime picked) updateDate) async { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } + } +} diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart new file mode 100644 index 00000000..52995ab4 --- /dev/null +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -0,0 +1,402 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.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/util/helpers.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_buttons_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:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../../routes.dart'; + +class AdmissionRequestSecondScreen extends StatefulWidget { + @override + _AdmissionRequestSecondScreenState createState() => + _AdmissionRequestSecondScreenState(); +} + +class _AdmissionRequestSecondScreenState + extends State { + final _expectedDaysController = TextEditingController(); + final _treatmentLineController = TextEditingController(); + final _preOperativeOrdersController = TextEditingController(); + DateTime _expectedAdmissionDate; + bool _emergencyAdmission = false; + bool _patientPregnant = false; + bool _preAnesthesiaReferred = false; + dynamic _selectedWard; + dynamic _selectedAdmissionType; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + + return BaseView( + // onModelReady: (model) => model.getMasterLookup(), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).admissionRequest, + body: model.doctorsList != null + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).otherInformation, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedDays, + null, + false), + enabled: true, + controller: _expectedDaysController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () { + if (_expectedAdmissionDate == null) { + _expectedAdmissionDate = DateTime.now(); + } + _selectDate( + context, _expectedAdmissionDate, + (picked) { + setState(() { + _expectedAdmissionDate = picked; + }); + }); + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedAdmissionDate, + _expectedAdmissionDate != null + ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context) + .emergencyAdmission, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _emergencyAdmission, + onChanged: (newValue) { + setState(() { + _emergencyAdmission = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context) + .patientPregnant, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _patientPregnant, + onChanged: (newValue) { + setState(() { + _patientPregnant = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).treatmentLine, + null, + false), + enabled: true, + controller: _treatmentLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: /*model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + :*/ null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).ward, + /* _selectedWard != null + ? _selectedWard['DoctorName'] + :*/ null, + true), + enabled: false, + ), + ), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context) + .preAnesthesiaReferred, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _preAnesthesiaReferred, + onChanged: (newValue) { + setState(() { + _preAnesthesiaReferred = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: /*model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + :*/ null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).admissionType, + /* _admissionType != null + ? _admissionType['DoctorName'] + :*/ null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: /*model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + :*/ null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).diagnosis, + /* _admissionType != null + ? _admissionType['DoctorName'] + :*/ null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).preOperativeOrders, + null, + false), + enabled: true, + controller: _preOperativeOrdersController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: /*model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + :*/ null, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).allergies, + /* _admissionType != null + ? _admissionType['DoctorName'] + :*/ null, + true), + enabled: false, + ), + ), + ), + ], + ), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: (){ + Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient}); + }, + ), + ), + ], + ) + : Container(), + ), + ); + } + + Future _selectDate(BuildContext context, DateTime dateTime, + Function(DateTime picked) updateDate) async { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } + } +} diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index c1d70cef..a2692c74 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -352,4 +352,49 @@ class Helpers { // TODO Fix it // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } + + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon, Color dropDownColor}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: dropDownColor != null ? dropDownColor : Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + static BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, {double borderWidth = -1}) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: borderWidth == -1 ? 2.0 : borderWidth, + )), + ); + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 46f8a249..aeba8212 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -316,6 +316,7 @@ class TranslationBase { String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String get date => localizedValues['date'][locale.languageCode]; String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; String get losNo => localizedValues['losNo'][locale.languageCode]; String get area => localizedValues['area'][locale.languageCode]; @@ -415,6 +416,28 @@ class TranslationBase { String get admission => localizedValues['admission'][locale.languageCode]; String get request => localizedValues['request'][locale.languageCode]; String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; + String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; + String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get referringDate => localizedValues['referringDate'][locale.languageCode]; + String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; + String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; + String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; + String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; + String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; + String get ward => localizedValues['ward'][locale.languageCode]; + String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get admissionType => localizedValues['admissionType'][locale.languageCode]; + String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String get allergies => localizedValues['allergies'][locale.languageCode]; + String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; + String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; + String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; + String get dietType => localizedValues['dietType'][locale.languageCode]; + String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; + String get save => localizedValues['save'][locale.languageCode]; + String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f0fd5d30e134c8ac5d895b29ebb802c0c9d08bfe Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 14:00:22 +0200 Subject: [PATCH 086/421] First step from update process --- lib/config/config.dart | 25 +- lib/config/test.dart | 0 lib/core/service/SOAP_service.dart | 161 +++- lib/core/service/base/lookup-service.dart | 6 +- lib/core/viewModel/SOAP_view_model.dart | 127 +++- .../GetChiefComplaintResModel.dart | 60 ++ lib/models/SOAP/GeneralGetReqForSOAP.dart | 25 + .../SOAP/post_assessment_request_model.dart | 4 +- .../post_progress_note_request_model.dart | 4 +- lib/routes.dart | 5 +- .../profile/SOAP/assessment_page.dart | 56 +- .../patients/profile/SOAP/plan_page.dart | 34 +- .../SOAP/subjective/add_allergies_widget.dart | 6 +- .../profile/profile_medical_info_widget.dart | 2 +- .../subjective/update_allergies_widget.dart | 343 +++++++++ .../subjective/update_history_widget.dart | 574 ++++++++++++++ .../subjective/update_medication_widget.dart | 107 +++ .../subjective/update_subjective_page.dart | 405 ++++++++++ .../soap_update/update_assessment_page.dart | 706 ++++++++++++++++++ .../soap_update/update_objective_page.dart | 580 ++++++++++++++ .../profile/soap_update/update_plan_page.dart | 347 +++++++++ .../soap_update/update_soap_index.dart | 133 ++++ 22 files changed, 3648 insertions(+), 62 deletions(-) create mode 100644 lib/config/test.dart create mode 100644 lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart create mode 100644 lib/models/SOAP/GeneralGetReqForSOAP.dart create mode 100644 lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart create mode 100644 lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart create mode 100644 lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart create mode 100644 lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart create mode 100644 lib/widgets/patients/profile/soap_update/update_assessment_page.dart create mode 100644 lib/widgets/patients/profile/soap_update/update_objective_page.dart create mode 100644 lib/widgets/patients/profile/soap_update/update_plan_page.dart create mode 100644 lib/widgets/patients/profile/soap_update/update_soap_index.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 08417a05..4a1b706b 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -131,10 +131,33 @@ const POST_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PostPhysicalExam'; const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; - const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; + + +const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; +const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; +const PATCH_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/PatchChiefcomplaint'; +const PATCH_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; +const PATCH_PROGRESS_NOTE = + 'Services/DoctorApplication.svc/REST/PatchProgressNote'; +const PATCH_ASSESSMENT = + 'Services/DoctorApplication.svc/REST/PatchAssessment'; + +const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; +const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; +const GET_CHIEF_COMPLAINT = + 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; +const GET_PHYSICAL_EXAM = + 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; +const GET_PROGRESS_NOTE = + 'Services/DoctorApplication.svc/REST/GetProgressNote'; +const GET_ASSESSMENT = + 'Services/DoctorApplication.svc/REST/GetAssessment'; + const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetCategories'; diff --git a/lib/config/test.dart b/lib/config/test.dart new file mode 100644 index 00000000..e69de29b diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 3219ef6a..f4b8ef1c 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,4 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -7,17 +9,20 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'base/lookup-service.dart'; class SOAPService extends LookupService { + List chiefComplaintList = []; + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, onSuccess: (dynamic response, int statusCode) { - listOfAllergies.clear(); + allergiesList.clear(); response['List_Allergies']['entityList'].forEach((v) { - listOfAllergies.add(MasterKeyModel.fromJson(v)); + allergiesList.add(MasterKeyModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { @@ -99,4 +104,156 @@ class SOAPService extends LookupService { super.error = error; }, body: postAssessmentRequestModel.toJson()); } + + + + Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { + hasError = false; + + await baseAppClient.post(PATCH_ALLERGY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchAllergyRequestModel.toJson()); + } + + Future patchHistories( + PostHistoriesRequestModel patchHistoriesRequestModel) async { + hasError = false; + await baseAppClient.post(PATCH_HISTORY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchHistoriesRequestModel.toJson()); + } + + Future patchChiefComplaint( + PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + hasError = false; + await baseAppClient.post(PATCH_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchChiefComplaintRequestModel.toJson()); + } + + Future patchPhysicalExam( + PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + hasError = false; + await baseAppClient.post(PATCH_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchPhysicalExamRequestModel.toJson()); + } + + Future patchProgressNote( + PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + hasError = false; + await baseAppClient.post(PATCH_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchProgressNoteRequestModel.toJson()); + } + + Future patchAssessment( + PatchAssessmentReqModel patchAssessmentRequestModel) async { + hasError = false; + await baseAppClient.post(PATCH_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: patchAssessmentRequestModel.toJson()); + } + + + + Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async { + hasError = false; + + await baseAppClient.post (GET_ALLERGY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientAllergyRequestModel.toJson()); + } + + Future getPatientHistories( + PostHistoriesRequestModel getPatientHistoriesRequestModel) async { + hasError = false; + await baseAppClient.post (GET_HISTORY, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientHistoriesRequestModel.toJson()); + } + + Future getPatientChiefComplaint( + GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async { + hasError = false; + await baseAppClient.post (GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + chiefComplaintList.clear(); + response['List_ChiefComplaint']['entityList'].forEach((v) { + chiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientChiefComplaintRequestModel.toJson()); + } + + Future getPatientPhysicalExam( + PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async { + hasError = false; + await baseAppClient.post (GET_PHYSICAL_EXAM, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientPhysicalExamRequestModel.toJson()); + } + + Future getPatientProgressNote( + PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async { + hasError = false; + await baseAppClient.post (GET_PROGRESS_NOTE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientProgressNoteRequestModel.toJson()); + } + + Future getPatientAssessment( + PostAssessmentRequestModel getPatientAssessmentRequestModel) async { + hasError = false; + await baseAppClient.post (GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getPatientAssessmentRequestModel.toJson()); + } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index d677201b..eabac69b 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'base_service.dart'; class LookupService extends BaseService { - List listOfAllergies = []; + List allergiesList = []; List get allergySeverityList => _allergySeverityList; List _allergySeverityList = []; @@ -53,9 +53,9 @@ class LookupService extends BaseService { setMasterLookupInCorrectArray(entryList, MasterKeysService masterKeys) { switch (masterKeys) { case MasterKeysService.Allergies: - listOfAllergies.clear(); + allergiesList.clear(); entryList.forEach((v) { - listOfAllergies.add(MasterKeyModel.fromJson(v)); + allergiesList.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.HistoryFamily: diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 422f554a..43107275 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -10,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_mode import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -17,7 +19,7 @@ import 'base_view_model.dart'; class SOAPViewModel extends BaseViewModel { SOAPService _SOAPService = locator(); - List get listOfAllergies => _SOAPService.listOfAllergies; + List get allergiesList => _SOAPService.allergiesList; List get allergySeverityList => _SOAPService.allergySeverityList; @@ -120,4 +122,127 @@ class SOAPViewModel extends BaseViewModel { } + Future patchAllergy(PostAllergyRequestModel patchAllergyRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchAllergy(patchAllergyRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future patchHistories(PostHistoriesRequestModel patchHistoriesRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchHistories(patchHistoriesRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future patchChiefComplaint(PostChiefComplaintRequestModel patchChiefComplaintRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchChiefComplaint(patchChiefComplaintRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future patchPhysicalExam(PostPhysicalExamRequestModel patchPhysicalExamRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchPhysicalExam(patchPhysicalExamRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future patchProgressNote(PostProgressNoteRequestModel patchProgressNoteRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchProgressNote(patchProgressNoteRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future patchAssessment(PatchAssessmentReqModel patchAssessmentRequestModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.patchAssessment(patchAssessmentRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + + + + Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientAllergy(getPatientAllergyRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + + Future getPatientHistories(PostHistoriesRequestModel getPatientHistoriesRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientHistories(getPatientHistoriesRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + + Future getPatientChiefComplaint(GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientChiefComplaint(getPatientChiefComplaintRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + + Future getPatientPhysicalExam(PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientPhysicalExam(getPatientPhysicalExamRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + + Future getPatientProgressNote(PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientProgressNote(getPatientProgressNoteRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + + Future getPatientAssessment(PostAssessmentRequestModel getPatientAssessmentRequestModel) async { + setState(ViewState.Busy); + await _SOAPService.getPatientAssessment(getPatientAssessmentRequestModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.Busy); + } else + setState(ViewState.Idle); + } + } diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart new file mode 100644 index 00000000..85ada324 --- /dev/null +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart @@ -0,0 +1,60 @@ +class GetChiefComplaintResModel { + int appointmentNo; + String ccdate; + String chiefComplaint; + String clinicDescription; + int clinicID; + String currentMedication; + int doctorID; + String doctorName; + int episodeId; + String hopi; + int patientMRN; + int status; + + GetChiefComplaintResModel( + {this.appointmentNo, + this.ccdate, + this.chiefComplaint, + this.clinicDescription, + this.clinicID, + this.currentMedication, + this.doctorID, + this.doctorName, + this.episodeId, + this.hopi, + this.patientMRN, + this.status}); + + GetChiefComplaintResModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + ccdate = json['ccdate']; + chiefComplaint = json['chiefComplaint']; + clinicDescription = json['clinicDescription']; + clinicID = json['clinicID']; + currentMedication = json['currentMedication']; + doctorID = json['doctorID']; + doctorName = json['doctorName']; + episodeId = json['episodeId']; + hopi = json['hopi']; + patientMRN = json['patientMRN']; + status = json['status']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['ccdate'] = this.ccdate; + data['chiefComplaint'] = this.chiefComplaint; + data['clinicDescription'] = this.clinicDescription; + data['clinicID'] = this.clinicID; + data['currentMedication'] = this.currentMedication; + data['doctorID'] = this.doctorID; + data['doctorName'] = this.doctorName; + data['episodeId'] = this.episodeId; + data['hopi'] = this.hopi; + data['patientMRN'] = this.patientMRN; + data['status'] = this.status; + return data; + } +} diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart new file mode 100644 index 00000000..488a06d4 --- /dev/null +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -0,0 +1,25 @@ +class GeneralGetReqForSOAP { + int patientMRN; + int appointmentNo; + int episodeId; + String doctorID; + + GeneralGetReqForSOAP( + {this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + + GeneralGetReqForSOAP.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeId = json['EpisodeId']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeId'] = this.episodeId; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/models/SOAP/post_assessment_request_model.dart b/lib/models/SOAP/post_assessment_request_model.dart index c8a1ebfd..af577671 100644 --- a/lib/models/SOAP/post_assessment_request_model.dart +++ b/lib/models/SOAP/post_assessment_request_model.dart @@ -13,7 +13,7 @@ class PostAssessmentRequestModel { PostAssessmentRequestModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; - episodeId = json['EpisodeId']; + episodeId = json['EpisodeID']; if (json['icdCodeDetails'] != null) { icdCodeDetails = new List(); json['icdCodeDetails'].forEach((v) { @@ -26,7 +26,7 @@ class PostAssessmentRequestModel { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; data['AppointmentNo'] = this.appointmentNo; - data['EpisodeId'] = this.episodeId; + data['EpisodeID'] = this.episodeId; if (this.icdCodeDetails != null) { data['icdCodeDetails'] = this.icdCodeDetails.map((v) => v.toJson()).toList(); diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 2217d4ee..069f4dbf 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -9,7 +9,7 @@ class PostProgressNoteRequestModel { PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; - episodeId = json['EpisodeId']; + episodeId = json['EpisodeID']; patientMRN = json['PatientMRN']; planNote = json['PlanNote']; } @@ -17,7 +17,7 @@ class PostProgressNoteRequestModel { Map toJson() { final Map data = new Map(); data['AppointmentNo'] = this.appointmentNo; - data['EpisodeId'] = this.episodeId; + data['EpisodeID'] = this.episodeId; data['PatientMRN'] = this.patientMRN; data['PlanNote'] = this.planNote; return data; diff --git a/lib/routes.dart b/lib/routes.dart index 09e08b0e..1915a89d 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/add_SOAP_index.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'; import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; @@ -80,8 +81,8 @@ const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String CREATE_EPISODE = 'patients/create-episode'; +const String UPDATE_EPISODE = 'patients/update-episode'; const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; -const String UPDATE_EPISODE = 'patients/create-episode'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -127,7 +128,7 @@ var routes = { VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), - UPDATE_EPISODE: (_) => AddSOAPIndex(isUpdate: true,), + UPDATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 7c55dca6..722cefe0 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -310,34 +310,34 @@ class _AssessmentPageState extends State { } submitAssessment(SOAPViewModel model) async { - // if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - // widget.mySelectedAssessment.selectedDiagnosisType != null) { - // PostAssessmentRequestModel postAssessmentRequestModel = - // new PostAssessmentRequestModel( - // patientMRN: widget.patientInfo.patientMRN, - // episodeId: widget.patientInfo.episodeNo, - // appointmentNo: widget.patientInfo.appointmentNo, - // icdCodeDetails: [ - // new IcdCodeDetails( - // remarks: widget.mySelectedAssessment.remark, - // complexDiagnosis: true, - // conditionId: - // widget.mySelectedAssessment.selectedDiagnosisCondition.id, - // diagnosisTypeId: - // widget.mySelectedAssessment.selectedDiagnosisType.id, - // icdcode10Id: "1") - // ]); - // - // await model.postAssessment(postAssessmentRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(3); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null) { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: "1") + ]); + + await model.postAssessment(postAssessmentRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } widget.changePageViewIndex(3); } diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart index e0653b3e..1bde4b6c 100644 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ b/lib/widgets/patients/profile/SOAP/plan_page.dart @@ -269,24 +269,24 @@ class _PlanPageState extends State { } submitPlan(SOAPViewModel model) async { - // if (progressNoteController.text.isNotEmpty) { - // PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - // patientMRN: widget.patientInfo.patientMRN, - // episodeId: widget.patientInfo.episodeNo, - // appointmentNo: widget.patientInfo.appointmentNo, - // planNote: progressNoteController.text); - // - // - // await model.postProgressNote(postProgressNoteRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // Navigator.of(context).pop(); - // } - // } + if (progressNoteController.text.isNotEmpty) { + PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + planNote: progressNoteController.text); - Navigator.of(context).pop(); + + await model.postProgressNote(postProgressNoteRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + } + } + + // Navigator.of(context).pop(); } openProgressNote(BuildContext context) { diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 7f764a0d..e2c49d85 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -179,7 +179,7 @@ class _AddAllergiesState extends State { heightFactor: 0.7, child: BaseView( onModelReady: (model) async { - if (model.listOfAllergies.length == 0) { + if (model.allergiesList.length == 0) { await model.getMasterLookup(MasterKeysService.Allergies); } if (model.allergySeverityList.length == 0) { @@ -212,10 +212,10 @@ class _AddAllergiesState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfAllergies != null + onTap: model.allergiesList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfAllergies, + list: model.allergiesList, okText: TranslationBase .of(context) .ok, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 20038540..96d7fa35 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -41,7 +41,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, nameLine1: "Update", nameLine2: "Episode", - route: CREATE_EPISODE, + route: UPDATE_EPISODE, icon: 'heartbeat.png'), PatientProfileButton( key: key, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart new file mode 100644 index 00000000..d7bbd0af --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -0,0 +1,343 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdateAllergiesWidget extends StatefulWidget { + final List myAllergiesList; + + UpdateAllergiesWidget({Key key, this.myAllergiesList}); + + @override + _UpdateAllergiesWidgetState createState() => _UpdateAllergiesWidgetState(); +} + +class _UpdateAllergiesWidgetState extends State { + + TextEditingController remarkController = TextEditingController(); + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return Column( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Allergies", + fontSize: 13.5, + onTapTextFields: () { + openAllergiesList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: widget.myAllergiesList.map((selectedAllergy) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), + variant: "bodyText", bold: true, color: Colors.black), + Texts( + selectedAllergy.selectedAllergySeverity.nameEn + .toUpperCase(), + variant: "bodyText", + bold: true, + color: AppGlobal.appPrimaryColor), + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeAllergy(selectedAllergy), + ) + ], + ), + SizedBox( + height: 10, + ), + ], + ); + }).toList()), + ) + ], + ); + } + + removeAllergy(MySelectedAllergy mySelectedAllergy) { + Iterable allergy = + widget.myAllergiesList.where((element) => mySelectedAllergy == element); + + if (allergy.length > 0) + setState(() { + widget.myAllergiesList.remove(allergy.first); + }); + } + + openAllergiesList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddAllergies( + addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { + setState(() { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + }); + },); + }); + } + +} + +class AddAllergies extends StatefulWidget { + final Function addAllergiesFun; + + const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + + @override + _AddAllergiesState createState() => _AddAllergiesState(); +} + +class _AddAllergiesState extends State { + List allergiesList; + List allergySeverityList; + MasterKeyModel _selectedAllergySeverity; + MasterKeyModel _selectedAllergy; + TextEditingController remarkController = TextEditingController(); + + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.allergiesList.length == 0) { + await model.getMasterLookup(MasterKeysService.Allergies); + } + if (model.allergySeverityList.length == 0) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox( + height: 16, + ), + AppText( + "Add Allergy", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergiesList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.allergiesList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (MasterKeyModel selectedValue) { + setState(() { + _selectedAllergy = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Allergy", + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergySeverityList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.allergySeverityList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedAllergySeverity = + selectedValue; + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Severity", + _selectedAllergySeverity != null + ? _selectedAllergySeverity.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + selectedAllergySeverity: _selectedAllergySeverity); + widget.addAllergiesFun(mySelectedAllergy); + }, + ), + ] + + ), + ), + ), + )), + ), + ); + } +} + + + + + diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart new file mode 100644 index 00000000..d8f2b888 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -0,0 +1,574 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class UpdateHistoryWidget extends StatefulWidget { + final List myHistoryList; + + const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); + + @override + _UpdateHistoryWidgetState createState() => _UpdateHistoryWidgetState(); +} + +class _UpdateHistoryWidgetState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + void initState() { + _controller = new PageController(); + + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add History", + fontSize: 13.5, + onTapTextFields: () { + openHistoryList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: widget.myHistoryList.map((myHistory) { + return Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Texts(myHistory.nameEn, + variant: "bodyText", bold: true, color: Colors.black), + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeHistory(myHistory), + ) + ], + ), + SizedBox( + height: 20, + ), + ], + ); + }).toList(), + ), + ) + ], + ); + } + + removeHistory(MasterKeyModel masterKey) { + Iterable history = widget.myHistoryList.where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + + if (history.length > 0) + setState(() { + widget.myHistoryList.remove(history.first); + }); + } + + openHistoryList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddHistoryDialog( + changePageViewIndex: changePageViewIndex, + controller: _controller, + myHistoryList: widget.myHistoryList, + addSelectedHistories: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeHistory: (masterKey) => removeHistory(masterKey), + ); + }); + } +} + +class PriorityBar extends StatefulWidget { + final Function onTap; + + const PriorityBar({Key key, this.onTap}) : super(key: key); + + @override + _PriorityBarState createState() => _PriorityBarState(); +} + +class _PriorityBarState extends State { + int _activePriority = 0; + + List _priorities = [ + "Family", + "Surgical/Sports", + "Medical", + ]; + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 2.0, + )), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return Container( + height: screenSize.height * 0.070, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _priorities.map((item) { + bool _isActive = _priorities[_activePriority] == item ? true : false; + return Expanded( + child: InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + widget.onTap(_priorities.indexOf(item)); + + setState(() { + _activePriority = _priorities.indexOf(item); + }); + }), + ); + }).toList(), + ), + ); + } +} + +class AddHistoryDialog extends StatefulWidget { + final Function changePageViewIndex; + final PageController controller; + final List myHistoryList; + final Function addSelectedHistories; + final Function (MasterKeyModel) removeHistory; + + const AddHistoryDialog( + {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) + : super(key: key); + + @override + _AddHistoryDialogState createState() => _AddHistoryDialogState(); +} + +class _AddHistoryDialogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.historyFamilyList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistoryFamily); + } + }, + builder: (_, model, w) => AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 10, + ), + PriorityBar(onTap: (activePriority) async { + widget.changePageViewIndex(activePriority); + if(activePriority ==1) { + if (model.historySurgicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistorySurgical); + await model.getMasterLookup(MasterKeysService.HistorySports); + } + } + if(activePriority ==2) { + if (model.historyMedicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistoryMedical); + } + } + }), + SizedBox( + height: 20, + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: widget.controller, + onPageChanged: (index) { + setState(() { + // currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.historyFamilyList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + historyInfo), + activeColor: + Colors.red[800], + onChanged: + (bool newValue) { + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, + ), + ], + ), + ), + Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.mergeHistorySurgicalWithHistorySportList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + historyInfo), + activeColor: + Colors.red[800], + onChanged: + ( + bool newValue) { + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, + ), + ], + ), + ), + Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model.historyMedicalList + .map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + historyInfo), + activeColor: + Colors.red[800], + onChanged: + ( + bool newValue) { + setState(() { + if (isServiceSelected( + historyInfo + )) { + widget + .removeHistory( + historyInfo + ); + } + else { + widget + .myHistoryList + .add( + historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES" + .toUpperCase(), + onPressed: () { + setState(() { + widget.addSelectedHistories(); + }); + }, + ), + ], + ), + ), + ], + ), + ), + ], + ), + )), + ), + ), + )); + } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable history = + widget + .myHistoryList + .where((element) => + masterKey.id == element.id && masterKey.typeId == element.typeId); + if (history.length > 0) { + return true; + } + return false; + } + +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart new file mode 100644 index 00000000..6584d415 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart @@ -0,0 +1,107 @@ + +import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdateMedication extends StatefulWidget { + @override + _UpdateMedicationState createState() => _UpdateMedicationState(); +} + +class _UpdateMedicationState extends State { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Current Medications", + fontSize: 13.5, + onTapTextFields: () { + openMedicationsList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: + EdgeInsets.only(left: 15, right: 15, top: 15), + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Abdomen Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + SizedBox( + height: 20, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts('Back Pain', + variant: "bodyText", + bold: true, + color: Colors.black), + Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ) + ], + ), + ], + ), + ) + ], + ); + } + openMedicationsList(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: Container( + child: Center( + child: Texts("dfdfd"), + )), + ); + }); + } + +} + diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart new file mode 100644 index 00000000..24be10e1 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -0,0 +1,405 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdateSubjectivePage extends StatefulWidget { + final Function changePageViewIndex; + final List myAllergiesList; + final List myHistoryList; + final PatiantInformtion patientInfo; + + UpdateSubjectivePage( + {Key key, + this.changePageViewIndex, + this.myAllergiesList, + this.myHistoryList, + this.patientInfo}); + + @override + _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); +} + +class _UpdateSubjectivePageState extends State { + bool isChiefExpand = false; + bool isHistoryExpand = false; + bool isAllergiesExpand = false; + TextEditingController illnessController = TextEditingController(); + TextEditingController complaintsController = TextEditingController(); + final formKey = GlobalKey(); + + @override + Widget build(BuildContext context) { + return BaseView( + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + baseViewModel: model, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('CHIEF COMPLAINTS', + variant: isChiefExpand ? "bodyText" : '', + bold: isChiefExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isChiefExpand = !isChiefExpand; + }); + }, + child: Icon( + isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) + ], + ), + bodyWidget: Form( + key: formKey, + child: Column(children: [ + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Chief Complaints", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: complaintsController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else if (value.length < 25) + return TranslationBase + .of(context) + .chiefComplaintLength; + //""; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "History of Present Illness", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: illnessController, + validator: (value) { + if (value == null || value =="") + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + // TODO return it back when we need it. + // AddMedication(), + ]), + ), + isExpand: isChiefExpand, + ), + + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('History'.toUpperCase(), + variant: isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + UpdateHistoryWidget(myHistoryList: widget.myHistoryList) + ], + ), + isExpand: isHistoryExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Allergies'.toUpperCase(), + variant: isAllergiesExpand ? "bodyText" : '', + bold: isAllergiesExpand ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAllergiesExpand = !isAllergiesExpand; + }); + }, + child: Icon(isAllergiesExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget:Column( + children: [ + UpdateAllergiesWidget(myAllergiesList: widget.myAllergiesList,), + SizedBox( + height: 30, + ), + ], + ) + , + isExpand: isAllergiesExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + addSubjectiveInfo( + model: model, + myAllergiesList: widget.myAllergiesList, + myHistoryList: widget.myHistoryList); + }, + ), + ], + ), + ), + ), + ), + ), + ); + } + + addSubjectiveInfo( + {SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { + formKey.currentState.save(); + formKey.currentState.validate(); + + + // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { + // await postChiefComplaint(model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myHistoryList.length != 0) { + // await postHistories(model: model, myHistoryList: myHistoryList); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } else { + // widget.changePageViewIndex(1); + // + // } + // + // } + // } else { + // if (myAllergiesList.length != 0) { + // await postAllergy(myAllergiesList: myAllergiesList, model: model); + // if (model.state == ViewState.ErrorLocal) { + // helpers.showErrorToast(model.error); + // } else { + // widget.changePageViewIndex(1); + // } + // } else { + // widget.changePageViewIndex(1); + // } + // } + // } + // } else { + // helpers.showErrorToast('Please add required field correctly'); + // } + + widget.changePageViewIndex(1); + + } + + postAllergy( + {List myAllergiesList, SOAPViewModel model}) async { + PostAllergyRequestModel postAllergyRequestModel = + new PostAllergyRequestModel(); + widget.myAllergiesList.forEach((allergy) { + if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == + null) + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; + //TODO: make static value dynamic + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM + .add(ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: 1485, + // + createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", + editedBy: 1485, + editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", + isChecked: false, + isUpdatedByNurse: false)); + }); + await model.patchAllergy(postAllergyRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } + } + + postHistories( + {List myHistoryList, SOAPViewModel model}) async { + PostHistoriesRequestModel postHistoriesRequestModel = + new PostHistoriesRequestModel(); + widget.myHistoryList.forEach((history) { + if (postHistoriesRequestModel.listMedicalHistoryVM == null) + postHistoriesRequestModel.listMedicalHistoryVM = []; + //TODO: make static value dynamic + postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: "", + historyId: history.id, + historyType: history.typeId, + isChecked: false, + )); + }); + await model.patchHistories(postHistoriesRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } + } + + postChiefComplaint({SOAPViewModel model}) async { + formKey.currentState.save(); + if(formKey.currentState.validate()){ + PostChiefComplaintRequestModel postChiefComplaintRequestModel = + //TODO: make static value dynamic + new PostChiefComplaintRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: " currentMedication ", + hopi: illnessController.text, + isLactation: false, + ispregnant: false, + numberOfWeeks: 22); + + await model.patchChiefComplaint(postChiefComplaintRequestModel); + + } + + } +} diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart new file mode 100644 index 00000000..556949e8 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -0,0 +1,706 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdateAssessmentPage extends StatefulWidget { + final Function changePageViewIndex; + final MySelectedAssessment mySelectedAssessment; + final PatiantInformtion patientInfo; + + UpdateAssessmentPage( + {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); + + @override + _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); +} + +class _UpdateAssessmentPageState extends State { + bool isAssessmentExpand = false; + + List assessmentList; + dynamic _referTo; + + TextEditingController remarksController = TextEditingController(); + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('ASSESSMENT', + variant: + isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: TextFields( + hintText: "Add ASSESSMENT", + fontSize: 13.5, + onTapTextFields: () { + openAssessmentDialog(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + if(widget.mySelectedAssessment != null && + widget.mySelectedAssessment + .appointmentId != + null && widget.mySelectedAssessment + .selectedDiagnosisType != null && + widget.mySelectedAssessment + .selectedDiagnosisCondition != null) + Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Appointment #: ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.mySelectedAssessment + .appointmentId + .toString(), + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameEn, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Type : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + widget.mySelectedAssessment + .selectedDiagnosisType + .nameEn, + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Doc : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + AppText( + widget.mySelectedAssessment.remark, + fontSize: 10, + color: Colors.grey, + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + + children: [ + AppText( + "ICD: ".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "R07.1".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + children: [ + InkWell( + onTap: () { + openAssessmentDialog(context); + }, + child: Icon(EvaIcons + .edit2Outline), + ) + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isAssessmentExpand, + ), + DividerWithSpacesAround( + height: 30, + ), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitAssessment(model); + }, + ), + SizedBox( + height: 30, + ), + ], + ), + ), + ), + ))); + } + + submitAssessment(SOAPViewModel model) async { + if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && + widget.mySelectedAssessment.selectedDiagnosisType != null) { + PatchAssessmentReqModel patchAssessmentReqModel = + new PatchAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: "1", + prevIcdCode10ID: "1" + ); + + await model.patchAssessment(patchAssessmentReqModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(3); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } + + widget.changePageViewIndex(3); + } + + openAssessmentDialog(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddAssessmentDetails( + mySelectedAssessment: widget.mySelectedAssessment, + addSelectedAssessment: () { + setState(() { + Navigator.of(context).pop(); + }); + }); + }); + } + +} + +class AddAssessmentDetails extends StatefulWidget { + final MySelectedAssessment mySelectedAssessment; + final Function() addSelectedAssessment; + + const AddAssessmentDetails( + {Key key, this.mySelectedAssessment, this.addSelectedAssessment}) + : super(key: key); + + @override + _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); +} + +class _AddAssessmentDetailsState extends State { + // MasterKeyModel _selectedDiagnosisCondition; + // MasterKeyModel _selectedDiagnosisType; + TextEditingController remarkController = TextEditingController(); + TextEditingController appointmentIdController = TextEditingController( + text: "234567"); + + @override + Widget build(BuildContext context) { + remarkController.text = widget.mySelectedAssessment.remark??""; + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { + //TODO: make one Input InputDecoration for all + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + return FractionallySizedBox( + heightFactor: 0.75, + child: BaseView( + onModelReady: (model) async { + if (model.listOfDiagnosisCondition.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (model.listOfDiagnosisType.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisType); + } + // if (model.listOfICD10.length == 0) { + // await model.getMasterLookup(MasterKeysService.ICD10); + // } + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Assessment Details".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Appointment Number", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + readOnly: true, + controller: appointmentIdController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + isICD: true, + list: model.listOfDiagnosisType, + selectedValue: widget + .mySelectedAssessment + .selectedICD, + okText: TranslationBase + .of(context) + .ok, + okFunction: + (MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedICD = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Name / ICD", + widget.mySelectedAssessment + .selectedICD != + null + ? widget.mySelectedAssessment + .selectedICD.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisCondition != + null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisCondition, + okText: TranslationBase + .of(context) + .ok, + okFunction: ( + MasterKeyModel selectedValue) { + setState(() { + widget.mySelectedAssessment + .selectedDiagnosisCondition = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Condition", + widget.mySelectedAssessment + .selectedDiagnosisCondition != null + ? widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisType != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.listOfDiagnosisType, + okText: TranslationBase + .of(context) + .ok, + okFunction: ( + MasterKeyModel selectedValue) { + setState(() { + // _selectedDiagnosisType = + // selectedValue; + widget.mySelectedAssessment + .selectedDiagnosisType = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Type", + widget.mySelectedAssessment + .selectedDiagnosisType != null + ? widget.mySelectedAssessment + .selectedDiagnosisType.nameEn + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only( + left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 18, + minLines: 5, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + setState(() { + widget.mySelectedAssessment.remark = + remarkController.text; + widget.mySelectedAssessment + .appointmentId = int.parse( + appointmentIdController.text); + + widget.addSelectedAssessment(); + }); + }, + ), + ])), + ), + ), + ))), + ); + } +} + + +class PatchAssessmentReqModel { + int patientMRN; + int appointmentNo; + int episodeId; + String icdcode10Id; + String prevIcdCode10ID; + int conditionId; + int diagnosisTypeId; + bool complexDiagnosis; + String remarks; + + PatchAssessmentReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeId, + this.icdcode10Id, + this.prevIcdCode10ID, + this.conditionId, + this.diagnosisTypeId, + this.complexDiagnosis, + this.remarks}); + + PatchAssessmentReqModel.fromJson(Map json) { + patientMRN = json['patientMRN']; + appointmentNo = json['appointmentNo']; + episodeId = json['episodeId']; + icdcode10Id = json['icdcode10Id']; + prevIcdCode10ID = json['prevIcdCode10ID']; + conditionId = json['conditionId']; + diagnosisTypeId = json['diagnosisTypeId']; + complexDiagnosis = json['complexDiagnosis']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['appointmentNo'] = this.appointmentNo; + data['episodeId'] = this.episodeId; + data['icdcode10Id'] = this.icdcode10Id; + data['prevIcdCode10ID'] = this.prevIcdCode10ID; + data['conditionId'] = this.conditionId; + data['diagnosisTypeId'] = this.diagnosisTypeId; + data['complexDiagnosis'] = this.complexDiagnosis; + data['remarks'] = this.remarks; + return data; + } +} + + diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart new file mode 100644 index 00000000..a073c578 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -0,0 +1,580 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdateObjectivePage extends StatefulWidget { + final Function changePageViewIndex; + final List mySelectedExamination; + final PatiantInformtion patientInfo; + UpdateObjectivePage( + {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); + + @override + _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); +} + +class _UpdateObjectivePageState extends State { + bool isSysExaminationExpand = false; + TextEditingController remarksController = TextEditingController(); + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 0.5, + )), + ); + } + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Physical/System Examination', + variant: + isSysExaminationExpand ? "bodyText" : '', + bold: isSysExaminationExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isSysExaminationExpand = + !isSysExaminationExpand; + }); + }, + child: Icon(isSysExaminationExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Examination", + fontSize: 13.5, + onTapTextFields: () { + openExaminationList(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + Column( + children: + widget.mySelectedExamination.map((examination) { + return Container( + margin: EdgeInsets.only( + left: 15, right: 15, top: 15), + child: Column(children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts( + examination + .selectedExamination.nameEn + .toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black) + ], + ), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + examination + .isNormal + ? Color( + 0xFF515A5D) + : Colors + .white, + Colors.grey), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Normal", + style: TextStyle( + fontSize: 12, + color: + examination + .isNormal + ? Colors.white + : Colors + .black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), + ), + )), + ), + onTap: () { + setState(() { + examination.isAbnormal = + !examination.isAbnormal; + examination.isNormal = + !examination.isNormal; + }); + }), + SizedBox( + width: 12, + ), + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + examination + .isAbnormal + ? Color( + 0xFF515A5D) + : Colors + .white, + Colors.black), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Abnormal", + style: TextStyle( + fontSize: 12, + color: + examination + .isAbnormal + ? Colors.white + : Colors + .black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), + ), + )), + ), + onTap: () { + setState(() { + examination.isAbnormal = + !examination.isAbnormal; + examination.isNormal = + !examination.isNormal; + }); + }), + ], + ), + InkWell( + + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeExamination( + examination.selectedExamination), + ) + ], + ), + SizedBox( + height: 20, + ), + Container( + margin: EdgeInsets.only( + left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarksController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + ])); + }).toList(), + ) + ], + ) + ]), + isExpand: isSysExaminationExpand, + ), + DividerWithSpacesAround(height: 30,), + AppButton( + title: TranslationBase.of(context).next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitUpdateObjectivePage(model); + }, + ), + SizedBox( + height: 30, + ), + ], + ), + ), + ), + ))); + } + + submitUpdateObjectivePage(SOAPViewModel model) async { + if(widget.mySelectedExamination.isNotEmpty){ + PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); + widget.mySelectedExamination.forEach((exam) { + if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == + null) + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; + + postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( + ListHisProgNotePhysicalExaminationVM( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: exam.remark ?? '', + createdBy: 4709, + createdOn: DateTime.now().toIso8601String(), + editedBy: 4709, + editedOn: DateTime.now().toIso8601String(), + examId: exam.selectedExamination.id, + examType: exam.selectedExamination.typeId, + isAbnormal: exam.isAbnormal, + isNormal: exam.isNormal, + masterDescription: exam.selectedExamination, + notExamined: false + + )); + }); + + await model.patchPhysicalExam(postPhysicalExamRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(2); + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } + + widget.changePageViewIndex(2); + } + + removeExamination(MasterKeyModel masterKey) { + Iterable history = widget.mySelectedExamination + .where( + (element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + + if (history.length > 0) + setState(() { + widget.mySelectedExamination.remove(history.first); + }); + } + + openExaminationList(BuildContext context) { + final screenSize = MediaQuery + .of(context) + .size; + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return AddExaminationDailog( + mySelectedExamination: widget.mySelectedExamination, + addSelectedExamination: () { + setState(() { + Navigator.of(context).pop(); + }); + }, + removeExamination: (masterKey) => removeExamination(masterKey),); + }); + } +} + +class AddExaminationDailog extends StatefulWidget { + final List mySelectedExamination; + final Function addSelectedExamination; + final Function (MasterKeyModel) removeExamination; + + const AddExaminationDailog( + {Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) + : super(key: key); + + @override + _AddExaminationDailogState createState() => _AddExaminationDailogState(); +} + +class _AddExaminationDailogState extends State { + @override + Widget build(BuildContext context) { + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.physicalExaminationList.length == 0) { + await model.getMasterLookup( + MasterKeysService.PhysicalExamination); + } + }, + builder: (_, model, w) => + AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + body: Center( + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Examinations", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + NetworkBaseView( + baseViewModel: model, + child: Container( + height: + MediaQuery + .of(context) + .size + .height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius + .circular(12), + color: Colors.white), + child: ListView( + children: [ + Column( + children: model + .physicalExaminationList + .map((examinationInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: isServiceSelected( + examinationInfo), + activeColor: + Colors.red[800], + onChanged: + ( + bool newValue) { + setState(() { + if (isServiceSelected( + examinationInfo + )) { + widget + .removeExamination( + examinationInfo + ); + } + else { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: examinationInfo + ); + widget + .mySelectedExamination + .add( + mySelectedExamination); + } + }); + }), + Expanded( + child: Padding( + padding: + const EdgeInsets + .symmetric( + horizontal: 10, + vertical: 0), + child: Texts( + examinationInfo + .nameEn, + variant: "bodyText", + bold: true, + color: + Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED Examinations" + .toUpperCase(), + onPressed: () { + widget.addSelectedExamination(); + }, + ), + ]), + ))), + )), + ); + } + + isServiceSelected(MasterKeyModel masterKey) { + Iterable exam = + widget + .mySelectedExamination + .where((element) => + masterKey.id == element.selectedExamination.id && + masterKey.typeId == element.selectedExamination.typeId); + if (exam.length > 0) { + return true; + } + return false; + } +} diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart new file mode 100644 index 00000000..a6ce8fad --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -0,0 +1,347 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; + +class UpdatePlanPage extends StatefulWidget { + final Function changePageViewIndex; + final PatiantInformtion patientInfo; + + UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo}); + + @override + _UpdatePlanPageState createState() => _UpdatePlanPageState(); +} + +class _UpdatePlanPageState extends State { + bool isProgressNoteExpand = false; + + List progressNoteList; + + TextEditingController progressNoteController = + TextEditingController(text: null); + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(6)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: 0.5, + )), + ); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + + return BaseView( + // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + builder: (_, model, w) => AppScaffold( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Progress Note', + variant: + isProgressNoteExpand ? "bodyText" : '', + bold: isProgressNoteExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isProgressNoteExpand = + !isProgressNoteExpand; + }); + }, + child: Icon(isProgressNoteExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: "Add Progress Note", + fontSize: 13.5, + onTapTextFields: () { + openProgressNote(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 20, + ), + if (progressNoteController.text.isNotEmpty) + Container( + margin: + EdgeInsets.only(left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), + fontSize: 10, + color: Colors.grey, + ), + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Padding( + padding: const EdgeInsets.all(0.0), + child: Container( + width: MediaQuery + .of(context) + .size + .width * 0.6, + child: AppText( + progressNoteController.text, + fontSize: 10, + + color: Colors.grey, + ), + ), + ), + ], + ), SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Created By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Anas Abdullah on 12 De", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Edited By : ", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + AppText( + "Rahim on 13 Dec", + fontSize: 10, + color: Colors.grey, + ), + ], + ), + + ], + ), + Column( + children: [ + InkWell( + onTap: () { + openProgressNote(context); + }, + child: Icon(EvaIcons.edit2Outline), + ) + ], + ), + ], + ), + ) + ], + ) + ]), + isExpand: isProgressNoteExpand, + ), + DividerWithSpacesAround(height: 30,), + AppButton( + title: TranslationBase + .of(context) + .next, + loading: model.state == ViewState.BusyLocal, + onPressed: () { + + submitPlan(model); + // widget.changePageViewIndex(2); + }, + ), + SizedBox( + height: 30, + ), + ], + ), + ), + ), + ),),); + } + + submitPlan(SOAPViewModel model) async { + if (progressNoteController.text.isNotEmpty) { + PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + planNote: progressNoteController.text); + + + await model.patchProgressNote(postProgressNoteRequestModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + Navigator.of(context).pop(); + } + } + } + + openProgressNote(BuildContext context) { + showModalBottomSheet( + backgroundColor: Colors.white, + isScrollControlled: true, + context: context, + builder: (context) { + return FractionallySizedBox( + heightFactor: 0.5, + child: Container( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Progress Note", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Add progress note here", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 16, + minLines: 8, + controller: progressNoteController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + ),SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + Navigator.of(context).pop(); + }, + ), + ]), + )), + ); + }); + } +} diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart new file mode 100644 index 00000000..59557145 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -0,0 +1,133 @@ +import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/steps_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_plan_page.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + + +class UpdateSoapIndex extends StatefulWidget { + final bool isUpdate; + + const UpdateSoapIndex({Key key, this.isUpdate}) : super(key: key); + @override + _UpdateSoapIndexState createState() => _UpdateSoapIndexState(); +} + +class _UpdateSoapIndexState extends State + with TickerProviderStateMixin { + PageController _controller; + int _currentIndex = 0; + List myAllergiesList= List(); + List myHistoryList = List(); + List mySelectedExamination = List(); + MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); + changePageViewIndex(pageIndex) { + _controller.jumpToPage(pageIndex); + } + + @override + void initState() { + // TODO: implement initState + _controller = new PageController(); + + super.initState(); + } + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).healthRecordInformation, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: + BoxDecoration(boxShadow: [], color: Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + FractionallySizedBox( + child: SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 0.75, + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + left: + MediaQuery.of(context).size.width * 0.05, + right: + MediaQuery.of(context).size.width * 0.05), + child: StepsWidget( + index: _currentIndex, + changeCurrentTab: changePageViewIndex, + ), + ), + Expanded( + child: PageView( + physics: NeverScrollableScrollPhysics(), + controller: _controller, + onPageChanged: (index) { + setState(() { + _currentIndex = index; + }); + }, + scrollDirection: Axis.horizontal, + children: [ + UpdateSubjectivePage( + changePageViewIndex: changePageViewIndex, + myAllergiesList: myAllergiesList, + myHistoryList: myHistoryList, + patientInfo: patient, + ), + UpdateObjectivePage( + changePageViewIndex: changePageViewIndex, + mySelectedExamination: + mySelectedExamination, + patientInfo: patient, + ), + UpdateAssessmentPage( + changePageViewIndex: changePageViewIndex, + mySelectedAssessment: + mySelectedAssessment, + patientInfo: patient, + ), + UpdatePlanPage( + changePageViewIndex: changePageViewIndex, + patientInfo: patient, + ) + ], + ), + ), + ], + ), + ), + ), + ) + ], + ), + ), + ], + ), + ), + ), + ); + } +} From 93bece09d72e8201ce5509dd8cdf62926d606d9b Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 31 Dec 2020 16:28:15 +0200 Subject: [PATCH 087/421] add search in SOAP --- .../profile/SOAP/assessment_page.dart | 62 ++-- .../patients/profile/SOAP/objective_page.dart | 112 ++---- .../SOAP/subjective/add_allergies_widget.dart | 56 ++- .../SOAP/subjective/add_history_widget.dart | 326 +++--------------- .../master_key_checkbox_search_widget.dart | 149 ++++++++ pubspec.lock | 7 + pubspec.yaml | 3 + 7 files changed, 292 insertions(+), 423 deletions(-) create mode 100644 lib/widgets/shared/master_key_checkbox_search_widget.dart diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 22778913..eadc327b 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -1,8 +1,10 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; @@ -19,6 +21,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class AssessmentPage extends StatefulWidget { final Function changePageViewIndex; @@ -375,15 +378,17 @@ class _AddAssessmentDetailsState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController( text: "234567"); + GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); remarkController.text = widget.mySelectedAssessment.remark??""; final screenSize = MediaQuery .of(context) .size; InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { + String selectedText, bool isDropDown,{IconData icon}) { //TODO: make one Input InputDecoration for all return InputDecoration( focusedBorder: OutlineInputBorder( @@ -399,7 +404,7 @@ class _AddAssessmentDetailsState extends State { borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null, hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, @@ -470,43 +475,28 @@ class _AddAssessmentDetailsState extends State { child: InkWell( onTap: model.listOfICD10 != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - isICD: true, - list: model.listOfICD10, - selectedValue: widget - .mySelectedAssessment - .selectedICD, - okText: TranslationBase - .of(context) - .ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedICD = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); + setState(() { + widget.mySelectedAssessment.selectedICD = null; + }); } : null, - child: TextField( + child:widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => new Padding( + child:Texts( suggestion.description +" / "+ suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase()) + ||suggestion.code.toLowerCase().startsWith(input.toLowerCase()) + , + ): TextField( decoration: textFieldSelectorDecoration( - "Name / ICD", - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true), + widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", + widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart index 8d12e1c9..a4d94279 100644 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ b/lib/widgets/patients/profile/SOAP/objective_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -469,98 +470,35 @@ class _AddExaminationDailogState extends State { SizedBox( height: 16, ), + NetworkBaseView( baseViewModel: model, - child: Container( - height: - MediaQuery - .of(context) - .size - .height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius - .circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model - .physicalExaminationList - .map((examinationInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - examinationInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - examinationInfo - )) { - widget - .removeExamination( - examinationInfo - ); - } - else { - MySelectedExamination mySelectedExamination = new MySelectedExamination( - selectedExamination: examinationInfo - ); - widget - .mySelectedExamination - .add( - mySelectedExamination); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - examinationInfo - .nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED Examinations" - .toUpperCase(), - onPressed: () { + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.physicalExaminationList, + removeHistory: (history){ + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (history){ + setState(() { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: history + ); + widget + .mySelectedExamination + .add( + mySelectedExamination); + }); + }, + addSelectedHistories: (){ widget.addSelectedExamination(); }, + isServiceSelected: (master) =>isServiceSelected(master), ), + ), + ]), ))), )), diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 7f764a0d..fd3cb917 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -1,6 +1,8 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -14,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class AddAllergiesWidget extends StatefulWidget { final List myAllergiesList; @@ -43,11 +46,9 @@ class _AddAllergiesWidgetState extends State { openAllergiesList(context); }, readOnly: true, - // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, suffixIconColor: AppGlobal.appPrimaryColor, fontWeight: FontWeight.w600, - // controller: messageController, validator: (value) { if (value == null) return TranslationBase @@ -147,7 +148,7 @@ class _AddAllergiesState extends State { InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { + String selectedText, bool isDropDown,{IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -162,16 +163,19 @@ class _AddAllergiesState extends State { borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + suffixIcon: isDropDown ? Icon(icon?? Icons.arrow_drop_down) : null, hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, ), ); } + bool _isShowSearch = false; + GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); final screenSize = MediaQuery .of(context) .size; @@ -209,38 +213,30 @@ class _AddAllergiesState extends State { SizedBox( height: 16, ), + Container( height: screenSize.height * 0.070, child: InkWell( onTap: model.listOfAllergies != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfAllergies, - okText: TranslationBase - .of(context) - .ok, - okFunction: (MasterKeyModel selectedValue) { - setState(() { - _selectedAllergy = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } + setState(() { + _selectedAllergy = null; + }); + } : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Allergy", - _selectedAllergy != null - ? _selectedAllergy.nameEn - : null, - true), + child: _selectedAllergy==null? AutoCompleteTextField( + decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), + itemSubmitted: (item) => setState(() => _selectedAllergy = item), + key: key, + suggestions: model.listOfAllergies, + itemBuilder: (context, suggestion) => new Padding( + child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()), + ):TextField( + decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart index 1907453d..6e7bbe00 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart @@ -16,6 +16,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../shared/master_key_checkbox_search_widget.dart'; + class AddHistoryWidget extends StatefulWidget { final List myHistoryList; @@ -280,273 +282,59 @@ class _AddHistoryDialogState extends State { }, scrollDirection: Axis.horizontal, children: [ - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.historyFamilyList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - (bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.mergeHistorySurgicalWithHistorySportList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.historyMedicalList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - setState(() { - widget.addSelectedHistories(); - }); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), ], ), @@ -559,12 +347,10 @@ class _AddHistoryDialogState extends State { )); } - isServiceSelected(MasterKeyModel masterKey) { + bool isServiceSelected(MasterKeyModel masterKey) { Iterable history = - widget - .myHistoryList - .where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + widget.myHistoryList.where((element) => masterKey.id == element.id && masterKey.typeId == element.typeId); + if (history.length > 0) { return true; } diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart new file mode 100644 index 00000000..550d3127 --- /dev/null +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -0,0 +1,149 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class MasterKeyCheckboxSearchWidget extends StatefulWidget { + final SOAPViewModel model; + final Function addSelectedHistories; + final Function(MasterKeyModel) removeHistory; + final Function(MasterKeyModel) addHistory; + final bool Function(MasterKeyModel) isServiceSelected; + final List masterList; + + MasterKeyCheckboxSearchWidget( + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isServiceSelected}) + : super(key: key); + + @override + _MasterKeyCheckboxSearchWidgetState createState() => _MasterKeyCheckboxSearchWidgetState(); +} + +class _MasterKeyCheckboxSearchWidgetState extends State { + List items = List(); + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: widget.model, + child: Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + TextFields( + hintText: 'Search history', + suffixIcon: EvaIcons.search, + onChanged: (value) { + filterSearchResults(value); + }, + ), + SizedBox(height: 15,), + Column( + children: items.map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: + widget.isServiceSelected(historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget + .isServiceSelected(historyInfo)) { + widget.removeHistory(historyInfo); + } else { + widget.addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts(historyInfo.nameEn, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (widget.model.state == ViewState.Idle) + AppButton( + title: "Add SELECTED HISTORIES".toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((item) { + if (item.nameAr.toLowerCase().contains(query.toLowerCase()) || + item.nameEn.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(item); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} diff --git a/pubspec.lock b/pubspec.lock index 17f02b95..c6829dad 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -36,6 +36,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.5.0-nullsafety.1" + autocomplete_textfield: + dependency: "direct main" + description: + name: autocomplete_textfield + url: "https://pub.dartlang.org" + source: hosted + version: "1.7.3" barcode_scan: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index aa7499d5..e15a7182 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -60,6 +60,9 @@ dependencies: get_it: ^4.0.2 + #Autocomplete TextField + autocomplete_textfield: ^1.7.3 + #speech to text From 45edddb49ff06a5f14b2529c27557cf94962214e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 31 Dec 2020 17:19:35 +0200 Subject: [PATCH 088/421] Add search in Procedure Screen --- .../entity_list_checkbox_search_widget.dart | 148 ++++++++ lib/screens/procedures/procedure_screen.dart | 334 ++++++++---------- 2 files changed, 294 insertions(+), 188 deletions(-) create mode 100644 lib/screens/procedures/entity_list_checkbox_search_widget.dart diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart new file mode 100644 index 00000000..b9962d27 --- /dev/null +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -0,0 +1,148 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class EntityListCheckboxSearchWidget extends StatefulWidget { + final ProcedureViewModel model; + final Function addSelectedHistories; + final Function(EntityList) removeHistory; + final Function(EntityList) addHistory; + final bool Function(EntityList) isEntityListSelected; + final List masterList; + + EntityListCheckboxSearchWidget( + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isEntityListSelected}) + : super(key: key); + + @override + _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); +} + +class _EntityListCheckboxSearchWidgetState extends State { + List items = List(); + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: widget.model, + child: Container( + height: MediaQuery.of(context).size.height * 0.5, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + TextFields( + hintText: 'Search ', + suffixIcon: EvaIcons.search, + onChanged: (value) { + filterSearchResults(value); + }, + ), + SizedBox(height: 15,), + Column( + children: items.map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: + widget.isEntityListSelected(historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget + .isEntityListSelected(historyInfo)) { + widget.removeHistory(historyInfo); + } else { + widget.addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts(historyInfo.procedureName, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ), + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + if (widget.model.state == ViewState.Idle) + AppButton(//TODO change the button name + title: "Add ".toUpperCase(), + onPressed: () { + widget.addSelectedHistories(); + }, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((item) { + if (item.procedureName.toLowerCase().contains(query.toLowerCase()) ) { + dummyListData.add(item); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} \ No newline at end of file diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 2bdb7f78..97ac65dd 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -2,21 +2,27 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.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_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -249,121 +255,121 @@ class _ProcedureScreenState extends State { ], ), ), - Container( - height: 120, - width: 325.0, - child: Column( - children: [ - Row( - children: [ - AppText( - 'Code #: ', - fontWeight: - FontWeight - .w700, - fontSize: 15.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .procedureId - .toString(), - fontSize: 13.0, - ), - SizedBox( - width: 12.0, - ), - AppText( - 'Order Type: ', - fontWeight: - FontWeight - .w700, - fontSize: 15.0, - ), - AppText( - 'Urgent', - fontSize: 13.0, - color: - Colors.red, - ), - ], - ), - Row( - children: [ - Container( - child: Expanded( - child: - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .procedureName, - fontWeight: - FontWeight - .w800, - ), + Expanded( + child: Container( + height: 120, + width: 325.0, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Code #: ', + fontWeight: + FontWeight + .w700, + fontSize: 15.0, + ), + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .procedureId + .toString(), + fontSize: 13.0, ), - ) - ], - ), + SizedBox( + width: 12.0, + ), + AppText( + 'Order Type: ', + fontWeight: + FontWeight + .w700, + fontSize: 15.0, + ), + AppText( + 'Urgent', + fontSize: 13.0, + color: + Colors.red, + ), + ], + ), + Row( + children: [ + Container( + child: Expanded( + child: + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .procedureName, + fontWeight: + FontWeight + .w800, + ), + ), + ) + ], + ), - Row( - children: [ - AppText( - 'Price: ', - fontWeight: - FontWeight - .w700, - ), - Expanded( - child: AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .price - .toString(), - fontSize: - 13.0), - ) - ], - ), - SizedBox( - height: 10.0, - ), + Row( + children: [ + AppText( + 'Price: ', + fontWeight: + FontWeight + .w700, + ), + Expanded( + child: AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .price + .toString(), + fontSize: + 13.0), + ) + ], + ), + SizedBox( + height: 10.0, + ), - Row( - children: [ - AppText( - 'Some short remark about the procedure', - fontSize: 13.5, - ), - ], - ), - SizedBox( - height: 10.0, - ), + Row( + children: [ + AppText( + 'Some short remark about the procedure', + fontSize: 13.5, + ), + ], + ), + SizedBox( + height: 10.0, + ), - Divider( - height: 5.0, - thickness: 1.0, - color: Colors.grey, - ) - // SizedBox( - // height: 40, - // ), - ], + Divider( + height: 5.0, + thickness: 1.0, + color: Colors.grey, + ) + // SizedBox( + // height: 40, + // ), + ], + ), ), ), Container( - width: 30, - height: 120, child: Column( children: [ Icon(Icons.edit) @@ -420,6 +426,7 @@ postProcedure({ProcedureViewModel model}) async { void addSelectedProcedure(context, ProcedureViewModel model) { showModalBottomSheet( context: context, + isScrollControlled: true, builder: (BuildContext bc) { return AddSelectedProcedure( model: model, @@ -437,14 +444,14 @@ class AddSelectedProcedure extends StatefulWidget { class _AddSelectedProcedureState extends State { TextEditingController procedureController = TextEditingController(); - + List entityList= List(); @override Widget build(BuildContext context) { return NetworkBaseView( baseViewModel: widget.model, child: SingleChildScrollView( child: Container( - height: 490, + //height: 490, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -455,76 +462,26 @@ class _AddSelectedProcedureState extends State { fontWeight: FontWeight.w900, ), if (widget.model.categoriesList.length != 0) - Container( - // child: ListView( - // children: [ - // Column( - // children: model.historyFamilyList - // .map((historyInfo) { - // return Column( - // children: [ - // Row( - // children: [ - // Checkbox( - // value: isServiceSelected( - // historyInfo), - // activeColor: - // Colors.red[800], - // onChanged: - // (bool newValue) { - // setState(() { - // if (isServiceSelected( - // historyInfo - // )) { - // widget - // .removeHistory( - // historyInfo - // ); - // } - // else { - // widget - // .myHistoryList - // .add( - // historyInfo); - // } - // }); - // }), - // Expanded( - // child: Padding( - // padding: - // const EdgeInsets - // .symmetric( - // horizontal: 10, - // vertical: 0), - // child: Texts( - // historyInfo.nameEn, - // variant: "bodyText", - // bold: true, - // color: - // Colors.black), - // ), - // ), - // ], - // ), - // DividerWithSpacesAround(), - // ], - // ); - // }).toList(), - // ), - // ], - // ), - height: 120.0, - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: widget.model.categoriesList[0].rowcount, - itemBuilder: (BuildContext ctxt, int index) { - return Container( - child: AppText(widget.model.categoriesList[0] - .entityList[index].procedureName), - ); - }), - ), + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget.model.categoriesList[0].entityList, + removeHistory: (item){ + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history){ + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: (){ + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => isEntityListSelected(master), + ), + SizedBox( height: 0.0, ), @@ -571,16 +528,17 @@ class _AddSelectedProcedureState extends State { ), ); } + bool isEntityListSelected(EntityList masterKey) { + Iterable history = + entityList.where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } } -// isServiceSelected(ProcedureViewModel masterKey) { -// Iterable history = widget.myHistoryList.where((element) => -// masterKey.id == element.id && masterKey.typeId == element.typeId); -// if (history.length > 0) { -// return true; -// } -// return false; -// } + void updateProcedureForm(context) { showModalBottomSheet( From 39970fe1a830fc3ea3e38c133af6573fc8ace6e0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 17:20:58 +0200 Subject: [PATCH 089/421] get update_subjective_page.dart --- lib/core/service/SOAP_service.dart | 21 ++- lib/core/service/base/lookup-service.dart | 2 + lib/core/viewModel/SOAP_view_model.dart | 174 ++++++++++++++++-- lib/models/SOAP/GetAllergiesResModel.dart | 60 ++++++ .../subjective/update_subjective_page.dart | 162 ++++++++++------ .../soap_update/update_soap_index.dart | 4 + 6 files changed, 344 insertions(+), 79 deletions(-) create mode 100644 lib/models/SOAP/GetAllergiesResModel.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index f4b8ef1c..8c7631a3 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -14,7 +15,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_a import 'base/lookup-service.dart'; class SOAPService extends LookupService { - List chiefComplaintList = []; + List patientChiefComplaintList = []; + List patientAllergiesList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( @@ -181,16 +183,19 @@ class SOAPService extends LookupService { - Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; await baseAppClient.post (GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { - print("Success"); + patientAllergiesList.clear(); + response['List_Allergies']['entityList'].forEach((v) { + patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientAllergyRequestModel.toJson()); + }, body: generalGetReqForSOAP.toJson()); } Future getPatientHistories( @@ -206,19 +211,19 @@ class SOAPService extends LookupService { } Future getPatientChiefComplaint( - GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async { + GeneralGetReqForSOAP generalGetReqForSOAP) async { hasError = false; await baseAppClient.post (GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { print("Success"); - chiefComplaintList.clear(); + patientChiefComplaintList.clear(); response['List_ChiefComplaint']['entityList'].forEach((v) { - chiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); + patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientChiefComplaintRequestModel.toJson()); + }, body: generalGetReqForSOAP.toJson()); } Future getPatientPhysicalExam( diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index eabac69b..a57c939b 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:flutter/cupertino.dart'; import 'base_service.dart'; @@ -130,4 +131,5 @@ class LookupService extends BaseService { break; } } + } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 43107275..bcc98a7b 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; -import 'package:doctor_app_flutter/models/SOAP/Allergy_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; +import 'package:flutter/material.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -32,14 +34,29 @@ class SOAPViewModel extends BaseViewModel { List get historySportList => _SOAPService.historySportList; List get historySocialList => _SOAPService.historySocialList; - List get historySurgicalList => _SOAPService.historySurgicalList; - List get mergeHistorySurgicalWithHistorySportList => [...historySurgicalList,...historySportList]; - List get physicalExaminationList => _SOAPService.physicalExaminationList; - List get listOfDiagnosisType => _SOAPService.listOfDiagnosisType; - List get listOfDiagnosisCondition => _SOAPService.listOfDiagnosisCondition; - List get listOfICD10 => _SOAPService.listOfICD10; + List get historySurgicalList => + _SOAPService.historySurgicalList; + List get mergeHistorySurgicalWithHistorySportList => + [...historySurgicalList, ...historySportList]; + + List get physicalExaminationList => + _SOAPService.physicalExaminationList; + + List get listOfDiagnosisType => + _SOAPService.listOfDiagnosisType; + + List get listOfDiagnosisCondition => + _SOAPService.listOfDiagnosisCondition; + + List get listOfICD10 => _SOAPService.listOfICD10; + + List get chiefComplaintList => + _SOAPService.patientChiefComplaintList; + + List get patientAllergiesList => + _SOAPService.patientAllergiesList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); @@ -183,11 +200,9 @@ class SOAPViewModel extends BaseViewModel { } - - - Future getPatientAllergy(PostAllergyRequestModel getPatientAllergyRequestModel) async { + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { setState(ViewState.Busy); - await _SOAPService.getPatientAllergy(getPatientAllergyRequestModel); + await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); @@ -205,9 +220,10 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientChiefComplaint(GeneralGetReqForSOAP getPatientChiefComplaintRequestModel) async { + Future getPatientChiefComplaint( + GeneralGetReqForSOAP generalGetReqForSOAP) async { setState(ViewState.Busy); - await _SOAPService.getPatientChiefComplaint(getPatientChiefComplaintRequestModel); + await _SOAPService.getPatientChiefComplaint(generalGetReqForSOAP); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); @@ -235,7 +251,8 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientAssessment(PostAssessmentRequestModel getPatientAssessmentRequestModel) async { + Future getPatientAssessment( + PostAssessmentRequestModel getPatientAssessmentRequestModel) async { setState(ViewState.Busy); await _SOAPService.getPatientAssessment(getPatientAssessmentRequestModel); if (_SOAPService.hasError) { @@ -245,4 +262,133 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + + // ignore: missing_return + MasterKeyModel getOneMasterKey( + {@required MasterKeysService masterKeys, int id, int typeId}) { + switch (masterKeys) { + case MasterKeysService.Allergies: + List result = allergiesList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + + case MasterKeysService.HistoryFamily: + List result = historyFamilyList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.HistoryMedical: + List result = historyMedicalList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.HistorySocial: + List result = historySocialList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.HistorySports: + List result = historySocialList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.HistorySurgical: + List result = historySurgicalList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.PhysicalExamination: + List result = physicalExaminationList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.AllergySeverity: + List result = allergySeverityList.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + // case MasterKeysService.physiotherapyGoals: + // listOfPhysiotherapyGoals.clear(); + // entryList.forEach((v) { + // listOfPhysiotherapyGoals.add(MasterKeyModel.fromJson(v)); + // }); + // break; + + case MasterKeysService.DiagnosisType: + List result = listOfDiagnosisType.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.DiagnosisCondition: + List result = listOfDiagnosisCondition.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + case MasterKeysService.ICD10: + listOfICD10.clear(); + List result = listOfICD10.where((element) { + print(element.id == id); + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + break; + break; + } + } + + } diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart new file mode 100644 index 00000000..a403bd2e --- /dev/null +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -0,0 +1,60 @@ +class GetAllergiesResModel { + int allergyDiseaseId; + String allergyDiseaseName; + int allergyDiseaseType; + int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + int episodeID; + bool isChecked; + bool isUpdatedByNurse; + int severity; + String severityName; + + GetAllergiesResModel( + {this.allergyDiseaseId, + this.allergyDiseaseName, + this.allergyDiseaseType, + this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.episodeID, + this.isChecked, + this.isUpdatedByNurse, + this.severity, + this.severityName}); + + GetAllergiesResModel.fromJson(Map json) { + allergyDiseaseId = json['allergyDiseaseId']; + allergyDiseaseName = json['allergyDiseaseName']; + allergyDiseaseType = json['allergyDiseaseType']; + appointmentNo = json['appointmentNo']; + createdBy = json['createdBy']; + createdByName = json['createdByName']; + createdOn = json['createdOn']; + episodeID = json['episodeID']; + isChecked = json['isChecked']; + isUpdatedByNurse = json['isUpdatedByNurse']; + severity = json['severity']; + severityName = json['severityName']; + } + + Map toJson() { + final Map data = new Map(); + data['allergyDiseaseId'] = this.allergyDiseaseId; + data['allergyDiseaseName'] = this.allergyDiseaseName; + data['allergyDiseaseType'] = this.allergyDiseaseType; + data['appointmentNo'] = this.appointmentNo; + data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; + data['createdOn'] = this.createdOn; + data['episodeID'] = this.episodeID; + data['isChecked'] = this.isChecked; + data['isUpdatedByNurse'] = this.isUpdatedByNurse; + data['severity'] = this.severity; + data['severityName'] = this.severityName; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 24be10e1..9fae8b21 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,7 +1,9 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -10,8 +12,6 @@ import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -51,7 +51,41 @@ class _UpdateSubjectivePageState extends State { @override Widget build(BuildContext context) { return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + onModelReady: (model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo); + + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); + await model.getPatientChiefComplaint(generalGetReqForSOAP); + if (model.chiefComplaintList.isNotEmpty) { + complaintsController.text = + model.chiefComplaintList[0].chiefComplaint; + illnessController.text = model.chiefComplaintList[0].hopi; + } + await model.getPatientAllergy(generalGetReqForSOAP); + if (model.patientAllergiesList.isNotEmpty) { + model.patientAllergiesList.forEach((element) { + MasterKeyModel selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( + selectedAllergy: selectedAllergy, + selectedAllergySeverity: selectedAllergySeverity); + + widget.myAllergiesList.add(mySelectedAllergy); + }); + } + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, baseViewModel: model, @@ -279,45 +313,45 @@ class _UpdateSubjectivePageState extends State { formKey.currentState.validate(); - // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // - // } - // - // } - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // } - // } - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } + if (complaintsController.text.isNotEmpty && + illnessController.text.isNotEmpty && + complaintsController.text.length > 25) { + await postChiefComplaint(model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + } + } + } else { + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + widget.changePageViewIndex(1); + } + } else { + widget.changePageViewIndex(1); + } + } + } + } else { + helpers.showErrorToast('Please add required field correctly'); + } widget.changePageViewIndex(1); @@ -334,22 +368,28 @@ class _UpdateSubjectivePageState extends State { //TODO: make static value dynamic postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM .add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 1485, - // - createdOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", - editedBy: 1485, - editedOn: DateTime.now().toIso8601String(),//"2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false)); + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.id, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: 4709, + // + createdOn: DateTime.now().toIso8601String(), + //"2020-08-14T20:37:22.780Z", + editedBy: 4709, + editedOn: DateTime.now().toIso8601String(), + //"2020-08-14T20:37:22.780Z", + isChecked: false, + isUpdatedByNurse: false)); }); - await model.patchAllergy(postAllergyRequestModel); + if (model.patientAllergiesList.isEmpty) { + await model.postAllergy(postAllergyRequestModel); + } else { + await model.patchAllergy(postAllergyRequestModel); + } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); @@ -374,6 +414,14 @@ class _UpdateSubjectivePageState extends State { isChecked: false, )); }); + + + if (model.patientAllergiesList.isEmpty) { + await model.postHistories(postHistoriesRequestModel); + } else { + await model.patchHistories(postHistoriesRequestModel); + } + await model.patchHistories(postHistoriesRequestModel); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 59557145..744f5244 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -6,7 +6,11 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/steps_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; From 9bf08e81dab7ba6eea875cea1d90aa7001034d55 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 31 Dec 2020 17:34:23 +0200 Subject: [PATCH 090/421] Add search button name and hint search text in MasterKeyCheckboxSearchWidget --- lib/widgets/shared/master_key_checkbox_search_widget.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 550d3127..f164be4b 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -17,6 +17,8 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { final Function(MasterKeyModel) addHistory; final bool Function(MasterKeyModel) isServiceSelected; final List masterList; + final String buttonName; + final String hintSearchText; MasterKeyCheckboxSearchWidget( {Key key, @@ -25,7 +27,7 @@ class MasterKeyCheckboxSearchWidget extends StatefulWidget { this.removeHistory, this.masterList, this.addHistory, - this.isServiceSelected}) + this.isServiceSelected, this.buttonName, this.hintSearchText}) : super(key: key); @override @@ -59,7 +61,7 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Thu, 31 Dec 2020 17:45:18 +0200 Subject: [PATCH 091/421] fix merger --- lib/screens/patients/patients_screen.dart | 184 +++++++++--------- .../profile/SOAP/assessment_page.dart | 3 +- .../SOAP/subjective/add_allergies_widget.dart | 6 +- 3 files changed, 98 insertions(+), 95 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index cb0c7248..74c9234c 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -569,100 +569,102 @@ class _PatientsScreenState extends State { ), ], ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - // mainAxisAlignment: - // MainAxisAlignment - // .spaceBetween, - children: < - Widget>[ - SizedBox( - height: - 0.5, - ), - SizedBox( - height: - 0, - ), - Wrap( - children: [ - AppText( - TranslationBase.of(context).age2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.age.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 2.5, - ), - Wrap( - children: [ - AppText( - TranslationBase.of(context).gender2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.gender.toString() == '1' ? 'Male' : 'Female', - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 8, - ), - SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + // mainAxisAlignment: + // MainAxisAlignment + // .spaceBetween, + children: < + Widget>[ + SizedBox( + height: + 0.5, + ), + SizedBox( + height: + 0, + ), + Wrap( + children: [ + AppText( + TranslationBase.of(context).age2, + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + AppText( + item.age.toString(), + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + backGroundcolor: Colors.white, + ), + ], + ), + SizedBox( + height: + 2.5, + ), + Wrap( + children: [ + AppText( + TranslationBase.of(context).gender2, + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + AppText( + item.gender.toString() == '1' ? 'Male' : 'Female', + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + backGroundcolor: Colors.white, + ), + ], + ), + SizedBox( + height: + 8, + ), + SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" + ? Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + height: 15, + width: 60, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(25), + color: HexColor("#20A169"), + ), + child: AppText( + item.startTime, + color: Colors.white, + fontSize: 1.5 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + ), ), - child: AppText( - item.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, + SizedBox( + width: 3.5, ), - ), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(item.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + Container( + child: AppText( + convertDateFormat2(item.appointmentDate.toString()), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), ), - ), - SizedBox( - height: 25.5, - ), - ], - ) - : SizedBox( - height: 15, - ), - ], + SizedBox( + height: 25.5, + ), + ], + ) + : SizedBox( + height: 15, + ), + ], + ), ), ], ), diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart index 1527d46b..0f7a8e31 100644 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ b/lib/widgets/patients/profile/SOAP/assessment_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.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/helpers.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/TextFields.dart'; @@ -43,7 +44,7 @@ class _AssessmentPageState extends State { dynamic _referTo; TextEditingController remarksController = TextEditingController(); - + Helpers helpers = Helpers(); @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 446df7ee..0a4ce08e 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -183,7 +183,7 @@ class _AddAllergiesState extends State { heightFactor: 0.7, child: BaseView( onModelReady: (model) async { - if (model.listOfAllergies.length == 0) { + if (model.allergiesList.length == 0) { await model.getMasterLookup(MasterKeysService.Allergies); } if (model.allergySeverityList.length == 0) { @@ -216,7 +216,7 @@ class _AddAllergiesState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.listOfAllergies != null + onTap: model.allergiesList != null ? () { setState(() { _selectedAllergy = null; @@ -227,7 +227,7 @@ class _AddAllergiesState extends State { decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), itemSubmitted: (item) => setState(() => _selectedAllergy = item), key: key, - suggestions: model.listOfAllergies, + suggestions: model.allergiesList, itemBuilder: (context, suggestion) => new Padding( child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), padding: EdgeInsets.all(8.0)), From adb803313861e1b8304f07d43f6a37c27116cae0 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 31 Dec 2020 17:47:17 +0200 Subject: [PATCH 092/421] update prescription --- lib/config/config.dart | 6 +- lib/core/service/prescription_service.dart | 17 ++ lib/core/service/procedure_service.dart | 15 ++ .../viewModel/prescription_view_model.dart | 15 ++ lib/core/viewModel/procedure_View_model.dart | 12 ++ .../prescription/prescription_screen.dart | 196 +++++++++++++++++- 6 files changed, 258 insertions(+), 3 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3cfb84c7..b7582800 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -132,11 +132,13 @@ const POST_PHYSICAL_EXAM = const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; -const POST_ASSESSMENT = - 'Services/DoctorApplication.svc/REST/PostAssessment'; +const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; +const UPDATE_PRESCRIPTION = + 'Services/DoctorApplication.svc/REST/PatchPrescription'; var selectedPatientType = 1; diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 9d1cb102..ced17cd4 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -46,4 +46,21 @@ class PrescriptionService extends BaseService { body: postProcedureReqModel.toJson(), ); } + + Future updatePrescription( + PostPrescriptionReqModel updatePrescriptionReqModel) async { + hasError = false; + //_prescriptionList.clear(); + await baseAppClient.post( + UPDATE_PRESCRIPTION, + onSuccess: (dynamic response, int statusCode) { + print("Accepted"); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: updatePrescriptionReqModel.toJson(), + ); + } } diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 7ffd9310..c7319eed 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -72,4 +72,19 @@ class ProcedureService extends BaseService { super.error = error; }, body: postProcedureReqModel.toJson()); } + + Future updateProcedure() async { + hasError = false; + _procedureList.clear(); + await baseAppClient.post( + GET_CATEGORISE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + print("ACCEPTED"); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + ); + } } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 7923c3d7..14684aeb 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -38,4 +38,19 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future updatePrescription( + PostPrescriptionReqModel updatePrescriptionReqModel) async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _prescriptionService.updatePrescription(updatePrescriptionReqModel); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else { + await getPrescription(); + setState(ViewState.Idle); + } + } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index b051d04d..ab4deee1 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -50,4 +50,16 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future updateProcedure() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.updateProcedure(); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4f6fe133..2b1e5454 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -1,14 +1,19 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.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_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -425,7 +430,29 @@ class _NewPrescriptionScreenState extends State { 0.06, child: Column( children: [ - Icon(Icons.edit) + InkWell( + child: Icon( + Icons.edit), + onTap: () { + updatePrescriptionForm( + context, + model + .prescriptionList[ + 0] + .entityList[ + index] + .medicationName, + model + .prescriptionList[ + 0] + .entityList[ + index] + .medicineCode, + model, + ); + //model.postPrescription(); + }, + ), ], ), ), @@ -446,4 +473,171 @@ class _NewPrescriptionScreenState extends State { )), ); } + + void updatePrescriptionForm( + context, String drugName, int drugId, PrescriptionViewModel model) { + TextEditingController remarksController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + TextEditingController frequencyController = TextEditingController(); + TextEditingController routeController = TextEditingController(); + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return Container( + height: 600, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + drugName.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 30.0, + ), + Column( + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'route', + controller: routeController, + keyboardType: TextInputType.number, + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'Dose', + controller: doseController, + keyboardType: TextInputType.number, + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'Frequency', + controller: frequencyController, + keyboardType: TextInputType.number, + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'Remarks', + controller: remarksController, + maxLines: 7, + minLines: 4, + ), + ), + SizedBox( + height: 12.0, + ), + SizedBox( + height: 140.0, + ), + Container( + margin: + EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'update prescription'.toUpperCase(), + onPressed: () { + updatePrescription( + model: model, + drugId: drugId, + remarks: remarksController.text, + route: routeController.text, + frequency: frequencyController.text, + dose: doseController.text); + Navigator.pop(context); + }, + ), + ], + ), + ), + ], + ), + ], + ), + ), + )); + }); + } + + updatePrescription({ + PrescriptionViewModel model, + int drugId, + String remarks, + String dose, + String frequency, + String route, + }) async { + //PrescriptionViewModel model = PrescriptionViewModel(); + PostPrescriptionReqModel updatePrescriptionReqModel = + new PostPrescriptionReqModel(); + List sss = List(); + + updatePrescriptionReqModel.appointmentNo = 2016055159; + updatePrescriptionReqModel.clinicID = 17; + updatePrescriptionReqModel.episodeID = 200012330; + updatePrescriptionReqModel.patientMRN = 3120877; + updatePrescriptionReqModel.vidaAuthTokenID = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; + sss.add(PrescriptionRequestModel( + covered: true, + dose: frequency.isNotEmpty ? int.parse(dose) : 1, + itemId: drugId, + doseUnitId: 1, + route: frequency.isNotEmpty ? int.parse(route) : 1, + frequency: frequency.isNotEmpty ? int.parse(frequency) : 1, + remarks: remarks.isEmpty ? '' : remarks, + approvalRequired: true, + icdcode10Id: "test2", + doseTime: 1, + duration: 2, + doseStartDate: "2020-12-20T13:07:41.769Z")); + updatePrescriptionReqModel.prescriptionRequestModel = sss; + //postProcedureReqModel.procedures = controlsProcedure; + + await model.updatePrescription(updatePrescriptionReqModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('Medication has been updated'); + } + } } From cb4ee05b409c0f8ce21cb4e609faaf99e400c160 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 31 Dec 2020 17:52:32 +0200 Subject: [PATCH 093/421] working on ucaf --- lib/config/localized_values.dart | 1 + lib/core/service/patient-ucaf-service.dart | 5 ++++ .../viewModel/patient-ucaf-viewmodel.dart | 9 ++++++ lib/locator.dart | 4 +++ lib/routes.dart | 3 ++ .../profile/UCAF/UCAF-input-screen.dart | 28 +++++++++++++++++++ lib/util/translations_delegate_base.dart | 1 + .../profile/profile_medical_info_widget.dart | 9 ++++++ 8 files changed, 60 insertions(+) create mode 100644 lib/core/service/patient-ucaf-service.dart create mode 100644 lib/core/viewModel/patient-ucaf-viewmodel.dart create mode 100644 lib/screens/patients/profile/UCAF/UCAF-input-screen.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c84307a5..453cef8f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -401,4 +401,5 @@ const Map> localizedValues = { 'dietTypeRemarks': {'en': "Remarks on diet type", 'ar': 'ملاحظات على نوع النظام الغذائي'}, 'save': {'en': "SAVE", 'ar': 'حفظ'}, 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, + 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, }; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart new file mode 100644 index 00000000..e776720c --- /dev/null +++ b/lib/core/service/patient-ucaf-service.dart @@ -0,0 +1,5 @@ +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class UcafService extends BaseService { + +} \ No newline at end of file diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart new file mode 100644 index 00000000..cf11854b --- /dev/null +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -0,0 +1,9 @@ +import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; + +import '../../locator.dart'; + +class UcafViewModel extends BaseViewModel { + + UcafService _ucafService = locator(); +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 0b932a62..7225f1d9 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -14,6 +14,7 @@ import 'core/service/SOAP_service.dart'; import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; +import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; import 'core/service/referral_patient_service.dart'; @@ -23,6 +24,7 @@ import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/patient-admission-request-viewmodel.dart'; +import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; import 'core/viewModel/referral_view_model.dart'; @@ -48,6 +50,7 @@ void setupLocator() { locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => VitalSignsService()); locator.registerLazySingleton(() => AdmissionRequestService()); + locator.registerLazySingleton(() => UcafService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -64,4 +67,5 @@ void setupLocator() { locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => VitalSignsViewModel()); locator.registerFactory(() => AdmissionRequestViewModel()); + locator.registerFactory(() => UcafViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index ff03096f..a8def67f 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/root_page.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'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; @@ -88,6 +89,7 @@ const String UPDATE_EPISODE = 'patients/create-episode'; const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; 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 BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -149,4 +151,5 @@ var routes = { // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), + PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), }; diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart new file mode 100644 index 00000000..f48fadb0 --- /dev/null +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -0,0 +1,28 @@ +import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; + +class UCAFInputScreen extends StatefulWidget { + @override + _UCAFInputScreenState createState() => _UCAFInputScreenState(); +} + +class _UCAFInputScreenState extends State { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).ucaf, + body: Container(), + ), + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7e61362b..a67463a0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -438,6 +438,7 @@ class TranslationBase { String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; String get save => localizedValues['save'][locale.languageCode]; String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 78334e5f..dd12e6cf 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -137,6 +137,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png')), + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5, + child: PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'lab.png')), ]); } } From 3578c82f629d04704f8a37eb44e2c37e8162e35e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 31 Dec 2020 18:20:10 +0200 Subject: [PATCH 094/421] solve hacking patient screen --- lib/screens/patients/patient_search_screen.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index ba32fbe1..61eb5fcf 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -69,19 +69,19 @@ class _PatientSearchScreenState extends State { try { - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + /* Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile); + new DoctorProfileModel.fromJson(profile)*/; if (_formKey.currentState.validate()) { _formKey.currentState.save(); - sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); + /* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); String token = await sharedPref.getString(TOKEN); _patientSearchFormValues.TokenID = token; _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + _patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/ if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && From c92a848851054f012c6b49902148445aa487e815 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 18:57:15 +0200 Subject: [PATCH 095/421] Finish Update Subjective Page --- lib/core/service/SOAP_service.dart | 11 ++- lib/core/viewModel/SOAP_view_model.dart | 8 +- lib/models/SOAP/GetHistoryReqModel.dart | 18 +++++ lib/models/SOAP/GetHistoryResModel.dart | 40 ++++++++++ .../subjective/update_subjective_page.dart | 73 ++++++++++++++++++- 5 files changed, 142 insertions(+), 8 deletions(-) create mode 100644 lib/models/SOAP/GetHistoryReqModel.dart create mode 100644 lib/models/SOAP/GetHistoryResModel.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 8c7631a3..9679293b 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -17,6 +19,7 @@ import 'base/lookup-service.dart'; class SOAPService extends LookupService { List patientChiefComplaintList = []; List patientAllergiesList = []; + List patientHistoryList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( @@ -199,15 +202,19 @@ class SOAPService extends LookupService { } Future getPatientHistories( - PostHistoriesRequestModel getPatientHistoriesRequestModel) async { + GetHistoryReqModel getHistoryReqModel) async { hasError = false; await baseAppClient.post (GET_HISTORY, onSuccess: (dynamic response, int statusCode) { print("Success"); + patientHistoryList.clear(); + response['List_History']['entityList'].forEach((v) { + patientHistoryList.add(GetHistoryResModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientHistoriesRequestModel.toJson()); + }, body: getHistoryReqModel.toJson()); } Future getPatientChiefComplaint( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index bcc98a7b..8a3b787e 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -57,6 +59,8 @@ class SOAPViewModel extends BaseViewModel { List get patientAllergiesList => _SOAPService.patientAllergiesList; + List get patientHistoryList => + _SOAPService.patientHistoryList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); @@ -210,9 +214,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientHistories(PostHistoriesRequestModel getPatientHistoriesRequestModel) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getPatientHistoriesRequestModel); + await _SOAPService.getPatientHistories(getHistoryReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart new file mode 100644 index 00000000..9b852e9b --- /dev/null +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -0,0 +1,18 @@ +class GetHistoryReqModel { + int patientMRN; + int historyType; + + GetHistoryReqModel({this.patientMRN, this.historyType}); + + GetHistoryReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + historyType = json['HistoryType']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['HistoryType'] = this.historyType; + return data; + } +} diff --git a/lib/models/SOAP/GetHistoryResModel.dart b/lib/models/SOAP/GetHistoryResModel.dart new file mode 100644 index 00000000..c4b4f129 --- /dev/null +++ b/lib/models/SOAP/GetHistoryResModel.dart @@ -0,0 +1,40 @@ +class GetHistoryResModel { + int appointmentNo; + int episodeId; + int historyId; + int historyType; + bool isChecked; + int patientMRN; + String remarks; + + GetHistoryResModel( + {this.appointmentNo, + this.episodeId, + this.historyId, + this.historyType, + this.isChecked, + this.patientMRN, + this.remarks}); + + GetHistoryResModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + episodeId = json['episodeId']; + historyId = json['historyId']; + historyType = json['historyType']; + isChecked = json['isChecked']; + patientMRN = json['patientMRN']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['episodeId'] = this.episodeId; + data['historyId'] = this.historyId; + data['historyType'] = this.historyType; + data['isChecked'] = this.isChecked; + data['patientMRN'] = this.patientMRN; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 9fae8b21..33a691cb 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -47,7 +48,67 @@ class _UpdateSubjectivePageState extends State { TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); final formKey = GlobalKey(); + getHistory(SOAPViewModel model) async{ + GetHistoryReqModel getHistoryMedicalReqModel = GetHistoryReqModel( + patientMRN: widget.patientInfo.patientMRN, + historyType: + MasterKeysService.HistoryMedical.getMasterKeyService()); + GetHistoryReqModel getHistorySportsReqModel = GetHistoryReqModel( + patientMRN: widget.patientInfo.patientMRN, + historyType: + MasterKeysService.HistorySports.getMasterKeyService()); + GetHistoryReqModel getHistorySurgicalReqModel = GetHistoryReqModel( + patientMRN: widget.patientInfo.patientMRN, + historyType: + MasterKeysService.HistorySurgical.getMasterKeyService()); + GetHistoryReqModel getHistoryFamilyReqModel = GetHistoryReqModel( + patientMRN: widget.patientInfo.patientMRN, + historyType: + MasterKeysService.HistoryFamily.getMasterKeyService()); + await model.getPatientHistories(getHistoryMedicalReqModel); + await model.getPatientHistories(getHistorySportsReqModel); + await model.getPatientHistories(getHistorySurgicalReqModel); + await model.getPatientHistories(getHistoryFamilyReqModel); + + if(model.patientHistoryList.isNotEmpty) { + if (model.historyFamilyList.isEmpty) { + await model.getMasterLookup(MasterKeysService.HistoryFamily); + } + if (model.historyMedicalList.isEmpty) { + await model.getMasterLookup(MasterKeysService.HistoryMedical); + } + if (model.historySurgicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistorySurgical); + await model.getMasterLookup(MasterKeysService.HistorySports); + } + model.patientHistoryList.forEach((element) { + if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { + widget.myHistoryList.add( model.getOneMasterKey( + masterKeys: MasterKeysService.HistoryFamily, + id: element.historyId, + )); + }if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { + widget.myHistoryList.add( model.getOneMasterKey( + masterKeys: MasterKeysService.HistoryMedical, + id: element.historyId, + )); + }if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { + widget.myHistoryList.add( model.getOneMasterKey( + masterKeys: MasterKeysService.HistorySports, + id: element.historyId, + )); + } + if (element.historyType == + MasterKeysService.HistorySurgical.getMasterKeyService()) { + widget.myHistoryList.add(model.getOneMasterKey( + masterKeys: MasterKeysService.HistorySurgical, + id: element.historyId, + )); + } + }); + } + } @override Widget build(BuildContext context) { return BaseView( @@ -57,10 +118,6 @@ class _UpdateSubjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo); - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); await model.getPatientChiefComplaint(generalGetReqForSOAP); if (model.chiefComplaintList.isNotEmpty) { complaintsController.text = @@ -69,6 +126,11 @@ class _UpdateSubjectivePageState extends State { } await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); + model.patientAllergiesList.forEach((element) { MasterKeyModel selectedAllergy = model.getOneMasterKey( masterKeys: MasterKeysService.Allergies, @@ -85,6 +147,9 @@ class _UpdateSubjectivePageState extends State { widget.myAllergiesList.add(mySelectedAllergy); }); } + + await getHistory(model); + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, From 46043efb42a37c4a6f2ed51e4ccae764c749998d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 22:28:02 +0200 Subject: [PATCH 096/421] Finish Update objective code Page --- lib/core/service/SOAP_service.dart | 12 ++- lib/core/viewModel/SOAP_view_model.dart | 10 +- .../GetChiefComplaintReqModel.dart | 25 +++++ .../SOAP/GetPhysicalExamListResModel.dart | 64 +++++++++++++ lib/models/SOAP/GetPhysicalExamReqModel.dart | 32 +++++++ .../subjective/update_subjective_page.dart | 38 ++++---- .../soap_update/update_objective_page.dart | 92 ++++++++++++------- 7 files changed, 218 insertions(+), 55 deletions(-) create mode 100644 lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart create mode 100644 lib/models/SOAP/GetPhysicalExamListResModel.dart create mode 100644 lib/models/SOAP/GetPhysicalExamReqModel.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 9679293b..a7cc33ce 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -20,6 +22,7 @@ class SOAPService extends LookupService { List patientChiefComplaintList = []; List patientAllergiesList = []; List patientHistoryList = []; + List patientPhysicalExamList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( @@ -234,15 +237,18 @@ class SOAPService extends LookupService { } Future getPatientPhysicalExam( - PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async { + GetPhysicalExamReqModel getPhysicalExamReqModel) async { hasError = false; await baseAppClient.post (GET_PHYSICAL_EXAM, onSuccess: (dynamic response, int statusCode) { - print("Success"); + patientPhysicalExamList.clear(); + response['PhysicalExamList']['entityList'].forEach((v) { + patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientPhysicalExamRequestModel.toJson()); + }, body: getPhysicalExamReqModel.toJson()); } Future getPatientProgressNote( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8a3b787e..849d2333 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -54,13 +56,15 @@ class SOAPViewModel extends BaseViewModel { List get listOfICD10 => _SOAPService.listOfICD10; - List get chiefComplaintList => + List get patientChiefComplaintList => _SOAPService.patientChiefComplaintList; List get patientAllergiesList => _SOAPService.patientAllergiesList; List get patientHistoryList => _SOAPService.patientHistoryList; + List get patientPhysicalExamList => + _SOAPService.patientPhysicalExamList; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); @@ -235,9 +239,9 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getPatientPhysicalExam(PostPhysicalExamRequestModel getPatientPhysicalExamRequestModel) async { + Future getPatientPhysicalExam(GetPhysicalExamReqModel getPhysicalExamReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientPhysicalExam(getPatientPhysicalExamRequestModel); + await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart new file mode 100644 index 00000000..68ab6c40 --- /dev/null +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -0,0 +1,25 @@ +class GetChiefComplaintReqModel { + int patientMRN; + int appointmentNo; + int episodeId; + int episodeID; + + GetChiefComplaintReqModel( + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID}); + + GetChiefComplaintReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeId = json['EpisodeId']; + episodeID = json['EpisodeID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeId'] = this.episodeId; + data['EpisodeID'] = this.episodeID; + return data; + } +} diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart new file mode 100644 index 00000000..f9b2f44f --- /dev/null +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -0,0 +1,64 @@ +class GetPhysicalExamResModel { + int appointmentNo; + int createdBy; + String createdOn; + int editedBy; + String editedOn; + int episodeId; + int examId; + int examType; + bool isAbnormal; + bool isNormal; + bool notExamined; + int patientMRN; + String remarks; + + GetPhysicalExamResModel( + {this.appointmentNo, + this.createdBy, + this.createdOn, + this.editedBy, + this.editedOn, + this.episodeId, + this.examId, + this.examType, + this.isAbnormal, + this.isNormal, + this.notExamined, + this.patientMRN, + this.remarks}); + + GetPhysicalExamResModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + episodeId = json['episodeId']; + examId = json['examId']; + examType = json['examType']; + isAbnormal = json['isAbnormal']; + isNormal = json['isNormal']; + notExamined = json['notExamined']; + patientMRN = json['patientMRN']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['episodeId'] = this.episodeId; + data['examId'] = this.examId; + data['examType'] = this.examType; + data['isAbnormal'] = this.isAbnormal; + data['isNormal'] = this.isNormal; + data['notExamined'] = this.notExamined; + data['patientMRN'] = this.patientMRN; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart new file mode 100644 index 00000000..ce045c22 --- /dev/null +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -0,0 +1,32 @@ +class GetPhysicalExamReqModel { + int patientMRN; + int appointmentNo; + String episodeID; + String from; + String to; + + GetPhysicalExamReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to}); + + GetPhysicalExamReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + from = json['From']; + to = json['To']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['From'] = this.from; + data['To'] = this.to; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 33a691cb..cbdc12b0 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; @@ -117,12 +118,12 @@ class _UpdateSubjectivePageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo); - + GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(); await model.getPatientChiefComplaint(generalGetReqForSOAP); - if (model.chiefComplaintList.isNotEmpty) { + if (model.patientChiefComplaintList.isNotEmpty) { complaintsController.text = - model.chiefComplaintList[0].chiefComplaint; - illnessController.text = model.chiefComplaintList[0].hopi; + model.patientChiefComplaintList[0].chiefComplaint; + illnessController.text = model.patientChiefComplaintList[0].hopi; } await model.getPatientAllergy(generalGetReqForSOAP); if (model.patientAllergiesList.isNotEmpty) { @@ -499,19 +500,22 @@ class _UpdateSubjectivePageState extends State { if(formKey.currentState.validate()){ PostChiefComplaintRequestModel postChiefComplaintRequestModel = //TODO: make static value dynamic - new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: " currentMedication ", - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - numberOfWeeks: 22); - - await model.patchChiefComplaint(postChiefComplaintRequestModel); - + new PostChiefComplaintRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + chiefComplaint: complaintsController.text, + currentMedication: " currentMedication ", + hopi: illnessController.text, + isLactation: false, + ispregnant: true, + numberOfWeeks: 22); + if (model.patientChiefComplaintList.isEmpty) { + // TODO: make it postChiefComplaint after it start to work + await model.postChiefComplaint(postChiefComplaintRequestModel); + } else { + await model.patchChiefComplaint(postChiefComplaintRequestModel); + } } } diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index a073c578..d7123678 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; @@ -53,40 +54,67 @@ class _UpdateObjectivePageState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + onModelReady: (model) async { + GetPhysicalExamReqModel getPhysicalExamReqModel = + GetPhysicalExamReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); + + await model.getPatientPhysicalExam(getPhysicalExamReqModel); + if (model.patientPhysicalExamList.isNotEmpty) { + if (model.physicalExaminationList.length == 0) { + await model + .getMasterLookup(MasterKeysService.PhysicalExamination); + } + model.patientPhysicalExamList.forEach((element) { + MasterKeyModel examMaster = model.getOneMasterKey( + masterKeys: MasterKeysService.PhysicalExamination, + id: element.examId, + ); + MySelectedExamination tempEam = MySelectedExamination( + selectedExamination: examMaster, + remark: element.remarks, + isNormal: element.isNormal, + isAbnormal: element.isAbnormal); + widget.mySelectedExamination.add(tempEam); + }); + } + }, builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + isShowAppBar: false, + body: SingleChildScrollView( + physics: ScrollPhysics(), + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('Physical/System Examination', - variant: - isSysExaminationExpand ? "bodyText" : '', - bold: isSysExaminationExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { + Row( + children: [ + Texts('Physical/System Examination', + variant: isSysExaminationExpand + ? "bodyText" + : '', + bold: isSysExaminationExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { setState(() { isSysExaminationExpand = !isSysExaminationExpand; From 311bee5136b97af425fd7468827fa01dfadb4c86 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 22:38:46 +0200 Subject: [PATCH 097/421] try to fix get --- lib/core/service/SOAP_service.dart | 5 +++-- lib/core/viewModel/SOAP_view_model.dart | 5 +++-- .../soap_update/subjective/update_subjective_page.dart | 9 +++++++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index a7cc33ce..65b6d0cc 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; @@ -221,7 +222,7 @@ class SOAPService extends LookupService { } Future getPatientChiefComplaint( - GeneralGetReqForSOAP generalGetReqForSOAP) async { + GetChiefComplaintReqModel getChiefComplaintReqModel) async { hasError = false; await baseAppClient.post (GET_CHIEF_COMPLAINT, onSuccess: (dynamic response, int statusCode) { @@ -233,7 +234,7 @@ class SOAPService extends LookupService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: generalGetReqForSOAP.toJson()); + }, body: getChiefComplaintReqModel.toJson()); } Future getPatientPhysicalExam( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 849d2333..4226643a 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; @@ -229,9 +230,9 @@ class SOAPViewModel extends BaseViewModel { } Future getPatientChiefComplaint( - GeneralGetReqForSOAP generalGetReqForSOAP) async { + GetChiefComplaintReqModel getChiefComplaintReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientChiefComplaint(generalGetReqForSOAP); + await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index cbdc12b0..1339c2f2 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -118,8 +118,13 @@ class _UpdateSubjectivePageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo); - GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel(); - await model.getPatientChiefComplaint(generalGetReqForSOAP); + GetChiefComplaintReqModel getChiefComplaintReqModel = + GetChiefComplaintReqModel( + patientMRN: widget.patientInfo.patientMRN, + appointmentNo: widget.patientInfo.appointmentNo, + episodeId: widget.patientInfo.episodeNo, + episodeID: widget.patientInfo.episodeNo); + await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { complaintsController.text = model.patientChiefComplaintList[0].chiefComplaint; From b3567df020748910e3d8ac40f3d14e0517c2d0fa Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 31 Dec 2020 23:08:47 +0200 Subject: [PATCH 098/421] medical file model --- lib/config/config.dart | 14 +- lib/core/model/medical_file_model.dart | 1161 +++++++++++++++++ .../prescription/add_prescription_form.dart | 4 +- pubspec.lock | 8 +- 4 files changed, 1171 insertions(+), 16 deletions(-) create mode 100644 lib/core/model/medical_file_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e71209b0..3e7d9ea7 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -133,8 +133,6 @@ const POST_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PostProgressNote'; const POST_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PostAssessment'; - - const PATCH_ALLERGY = 'Services/DoctorApplication.svc/REST/PatchAllergies'; const PATCH_HISTORY = 'Services/DoctorApplication.svc/REST/PatchHistory'; const PATCH_CHIEF_COMPLAINT = @@ -143,19 +141,15 @@ const PATCH_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/PatchPhysicalExam'; const PATCH_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/PatchProgressNote'; -const PATCH_ASSESSMENT = - 'Services/DoctorApplication.svc/REST/PatchAssessment'; +const PATCH_ASSESSMENT = 'Services/DoctorApplication.svc/REST/PatchAssessment'; const GET_ALLERGY = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_HISTORY = 'Services/DoctorApplication.svc/REST/GetHistory'; const GET_CHIEF_COMPLAINT = 'Services/DoctorApplication.svc/REST/GetChiefcomplaint'; -const GET_PHYSICAL_EXAM = - 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; -const GET_PROGRESS_NOTE = - 'Services/DoctorApplication.svc/REST/GetProgressNote'; -const GET_ASSESSMENT = - 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; +const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; +const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart new file mode 100644 index 00000000..201c88f3 --- /dev/null +++ b/lib/core/model/medical_file_model.dart @@ -0,0 +1,1161 @@ +class MedicalFileModel { + List entityList; + int rowcount; + Null statusMessage; + + MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); + + MedicalFileModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + List admissions; + ClinicalSummary clinicalSummary; + List doctorWisePatientEpisodes; + List procedures; + List lstAllEpisodes; + List timelines; + + EntityList( + {this.admissions, + this.clinicalSummary, + this.doctorWisePatientEpisodes, + this.procedures, + this.lstAllEpisodes, + this.timelines}); + + EntityList.fromJson(Map json) { + if (json['Admissions'] != null) { + admissions = new List(); + json['Admissions'].forEach((v) { + admissions.add(new Admissions.fromJson(v)); + }); + } + clinicalSummary = json['ClinicalSummary'] != null + ? new ClinicalSummary.fromJson(json['ClinicalSummary']) + : null; + if (json['DoctorWisePatientEpisodes'] != null) { + doctorWisePatientEpisodes = new List(); + json['DoctorWisePatientEpisodes'].forEach((v) { + doctorWisePatientEpisodes + .add(new DoctorWisePatientEpisodes.fromJson(v)); + }); + } + if (json['Procedures'] != null) { + procedures = new List(); + json['Procedures'].forEach((v) { + procedures.add(new Procedures.fromJson(v)); + }); + } + if (json['lstAllEpisodes'] != null) { + lstAllEpisodes = new List(); + json['lstAllEpisodes'].forEach((v) { + lstAllEpisodes.add(new LstAllEpisodes.fromJson(v)); + }); + } + if (json['Timelines'] != null) { + timelines = new List(); + json['Timelines'].forEach((v) { + timelines.add(new Timelines.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.admissions != null) { + data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); + } + if (this.clinicalSummary != null) { + data['ClinicalSummary'] = this.clinicalSummary.toJson(); + } + if (this.doctorWisePatientEpisodes != null) { + data['DoctorWisePatientEpisodes'] = + this.doctorWisePatientEpisodes.map((v) => v.toJson()).toList(); + } + if (this.procedures != null) { + data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); + } + if (this.lstAllEpisodes != null) { + data['lstAllEpisodes'] = + this.lstAllEpisodes.map((v) => v.toJson()).toList(); + } + if (this.timelines != null) { + data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Admissions { + String admissionDate; + int admissionNo; + String clinic; + String doctor; + int projectID; + String projectName; + String setupID; + List lstDischargeDiag; + + Admissions( + {this.admissionDate, + this.admissionNo, + this.clinic, + this.doctor, + this.projectID, + this.projectName, + this.setupID, + this.lstDischargeDiag}); + + Admissions.fromJson(Map json) { + admissionDate = json['AdmissionDate']; + admissionNo = json['AdmissionNo']; + clinic = json['Clinic']; + doctor = json['Doctor']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + if (json['lstDischargeDiag'] != null) { + lstDischargeDiag = new List(); + json['lstDischargeDiag'].forEach((v) { + lstDischargeDiag.add(new LstDischargeDiag.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionDate'] = this.admissionDate; + data['AdmissionNo'] = this.admissionNo; + data['Clinic'] = this.clinic; + data['Doctor'] = this.doctor; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + if (this.lstDischargeDiag != null) { + data['lstDischargeDiag'] = + this.lstDischargeDiag.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class LstDischargeDiag { + int admissionNo; + String codeID; + String description; + int dischargeNo; + int projectID; + String projectName; + String remarks; + String setupID; + List timeLineEvents; + + LstDischargeDiag( + {this.admissionNo, + this.codeID, + this.description, + this.dischargeNo, + this.projectID, + this.projectName, + this.remarks, + this.setupID, + this.timeLineEvents}); + + LstDischargeDiag.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + codeID = json['CodeID']; + description = json['Description']; + dischargeNo = json['DischargeNo']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + // if (json['TimeLineEvents'] != null) { + // timeLineEvents = new List(); + // json['TimeLineEvents'].forEach((v) { + // timeLineEvents.add(new TimeLineEvents.fromJson(v)); + // }); + // } + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['CodeID'] = this.codeID; + data['Description'] = this.description; + data['DischargeNo'] = this.dischargeNo; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + if (this.timeLineEvents != null) { + data['TimeLineEvents'] = + this.timeLineEvents.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class TimeLineEvents { + List admissions; + String colorClass; + List consulations; + String disPlayName; + Null doctorName; + ERData eRData; + int eventId; + String fullName; + String iconClass; + bool isDisabled; + List labOrders; + List radReports; + String toolTip; + + TimeLineEvents( + {this.admissions, + this.colorClass, + this.consulations, + this.disPlayName, + this.doctorName, + this.eRData, + this.eventId, + this.fullName, + this.iconClass, + this.isDisabled, + this.labOrders, + this.radReports, + this.toolTip}); + + // TimeLineEvents.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // colorClass = json['ColorClass']; + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + // disPlayName = json['DisPlayName']; + // doctorName = json['DoctorName']; + // eRData = + // json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; + // eventId = json['EventId']; + // fullName = json['FullName']; + // iconClass = json['IconClass']; + // isDisabled = json['IsDisabled']; + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + // toolTip = json['ToolTip']; + // } + + Map toJson() { + final Map data = new Map(); + // if (this.admissions != null) { + // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); + // } + data['ColorClass'] = this.colorClass; + // if (this.consulations != null) { + // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + // } + data['DisPlayName'] = this.disPlayName; + data['DoctorName'] = this.doctorName; + if (this.eRData != null) { + data['ERData'] = this.eRData.toJson(); + } + data['EventId'] = this.eventId; + data['FullName'] = this.fullName; + data['IconClass'] = this.iconClass; + data['IsDisabled'] = this.isDisabled; + // if (this.labOrders != null) { + // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); + // } + // if (this.radReports != null) { + // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); + // } + data['ToolTip'] = this.toolTip; + return data; + } +} + +class ERData { + List admissions; + List consulations; + List labOrders; + List radReports; + List lstErDischargeSummary; + + ERData( + {this.admissions, + this.consulations, + this.labOrders, + this.radReports, + this.lstErDischargeSummary}); + + // ERData.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstErDischargeSummary'] != null) { + // lstErDischargeSummary = new List(); + // json['lstErDischargeSummary'].forEach((v) { + // lstErDischargeSummary.add(new Null.fromJson(v)); + // }); + // } + // } + + Map toJson() { + final Map data = new Map(); + // if (this.admissions != null) { + // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); + // } + // if (this.consulations != null) { + // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); + // } + // if (this.labOrders != null) { + // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); + // } + // if (this.radReports != null) { + // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); + // } + // if (this.lstErDischargeSummary != null) { + // data['lstErDischargeSummary'] = + // this.lstErDischargeSummary.map((v) => v.toJson()).toList(); + // } + return data; + } +} + +class ClinicalSummary { + List labAbnormalResults; + List lstAllergy; + List lstComplaintsDetail; + List lstDiagnosis; + List lstEncounterHistory; + List lstMedication; + List lstPastHistory; + + ClinicalSummary( + {this.labAbnormalResults, + this.lstAllergy, + this.lstComplaintsDetail, + this.lstDiagnosis, + this.lstEncounterHistory, + this.lstMedication, + this.lstPastHistory}); + + ClinicalSummary.fromJson(Map json) { + if (json['LabAbnormalResults'] != null) { + labAbnormalResults = new List(); + json['LabAbnormalResults'].forEach((v) { + labAbnormalResults.add(new LabAbnormalResults.fromJson(v)); + }); + } + if (json['lstAllergy'] != null) { + lstAllergy = new List(); + json['lstAllergy'].forEach((v) { + lstAllergy.add(new LstAllergy.fromJson(v)); + }); + } + if (json['lstComplaintsDetail'] != null) { + lstComplaintsDetail = new List(); + json['lstComplaintsDetail'].forEach((v) { + lstComplaintsDetail.add(new LstComplaintsDetail.fromJson(v)); + }); + } + if (json['lstDiagnosis'] != null) { + lstDiagnosis = new List(); + json['lstDiagnosis'].forEach((v) { + lstDiagnosis.add(new LstDiagnosis.fromJson(v)); + }); + } + if (json['lstEncounterHistory'] != null) { + lstEncounterHistory = new List(); + json['lstEncounterHistory'].forEach((v) { + lstEncounterHistory.add(new LstEncounterHistory.fromJson(v)); + }); + } + if (json['lstMedication'] != null) { + lstMedication = new List(); + json['lstMedication'].forEach((v) { + lstMedication.add(new LstMedication.fromJson(v)); + }); + } + if (json['lstPastHistory'] != null) { + lstPastHistory = new List(); + json['lstPastHistory'].forEach((v) { + lstPastHistory.add(new LstPastHistory.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.labAbnormalResults != null) { + data['LabAbnormalResults'] = + this.labAbnormalResults.map((v) => v.toJson()).toList(); + } + if (this.lstAllergy != null) { + data['lstAllergy'] = this.lstAllergy.map((v) => v.toJson()).toList(); + } + if (this.lstComplaintsDetail != null) { + data['lstComplaintsDetail'] = + this.lstComplaintsDetail.map((v) => v.toJson()).toList(); + } + if (this.lstDiagnosis != null) { + data['lstDiagnosis'] = this.lstDiagnosis.map((v) => v.toJson()).toList(); + } + if (this.lstEncounterHistory != null) { + data['lstEncounterHistory'] = + this.lstEncounterHistory.map((v) => v.toJson()).toList(); + } + if (this.lstMedication != null) { + data['lstMedication'] = + this.lstMedication.map((v) => v.toJson()).toList(); + } + if (this.lstPastHistory != null) { + data['lstPastHistory'] = + this.lstPastHistory.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class LabAbnormalResults { + String createdOn; + String description; + bool isPackage; + int orderNo; + int packageID; + String packageName; + int projectID; + String projectName; + String referenceRange; + double referenceRangeLow; + double referenceRangeHigh; + String resultCriticalFlag; + String resultValue; + String resultValueFlag; + String setupID; + String testCode; + int testID; + String verifiedOn; + bool isAbnormal; + bool isCritical; + String unit; + + LabAbnormalResults( + {this.createdOn, + this.description, + this.isPackage, + this.orderNo, + this.packageID, + this.packageName, + this.projectID, + this.projectName, + this.referenceRange, + this.referenceRangeLow, + this.referenceRangeHigh, + this.resultCriticalFlag, + this.resultValue, + this.resultValueFlag, + this.setupID, + this.testCode, + this.testID, + this.verifiedOn, + this.isAbnormal, + this.isCritical, + this.unit}); + + LabAbnormalResults.fromJson(Map json) { + createdOn = json['CreatedOn']; + description = json['Description']; + isPackage = json['IsPackage']; + orderNo = json['OrderNo']; + packageID = json['PackageID']; + packageName = json['PackageName']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + referenceRange = json['ReferenceRange']; + referenceRangeLow = json['ReferenceRange_Low']; + referenceRangeHigh = json['ReferenceRange_high']; + resultCriticalFlag = json['ResultCriticalFlag']; + resultValue = json['ResultValue']; + resultValueFlag = json['ResultValueFlag']; + setupID = json['SetupID']; + testCode = json['TestCode']; + testID = json['TestID']; + verifiedOn = json['VerifiedOn']; + isAbnormal = json['isAbnormal']; + isCritical = json['isCritical']; + unit = json['unit']; + } + + Map toJson() { + final Map data = new Map(); + data['CreatedOn'] = this.createdOn; + data['Description'] = this.description; + data['IsPackage'] = this.isPackage; + data['OrderNo'] = this.orderNo; + data['PackageID'] = this.packageID; + data['PackageName'] = this.packageName; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ReferenceRange'] = this.referenceRange; + data['ReferenceRange_Low'] = this.referenceRangeLow; + data['ReferenceRange_high'] = this.referenceRangeHigh; + data['ResultCriticalFlag'] = this.resultCriticalFlag; + data['ResultValue'] = this.resultValue; + data['ResultValueFlag'] = this.resultValueFlag; + data['SetupID'] = this.setupID; + data['TestCode'] = this.testCode; + data['TestID'] = this.testID; + data['VerifiedOn'] = this.verifiedOn; + data['isAbnormal'] = this.isAbnormal; + data['isCritical'] = this.isCritical; + data['unit'] = this.unit; + return data; + } +} + +class LstAllergy { + String allergy; + int projectID; + String projectName; + String setupID; + + LstAllergy({this.allergy, this.projectID, this.projectName, this.setupID}); + + LstAllergy.fromJson(Map json) { + allergy = json['Allergy']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['Allergy'] = this.allergy; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + return data; + } +} + +class LstComplaintsDetail { + String cCDate; + String createdBy; + String plainChiefComplaint; + int projectID; + String projectName; + String setupID; + String rtfChiefComplaint; + + LstComplaintsDetail( + {this.cCDate, + this.createdBy, + this.plainChiefComplaint, + this.projectID, + this.projectName, + this.setupID, + this.rtfChiefComplaint}); + + LstComplaintsDetail.fromJson(Map json) { + cCDate = json['CCDate']; + createdBy = json['CreatedBy']; + plainChiefComplaint = json['PlainChiefComplaint']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + rtfChiefComplaint = json['rtfChiefComplaint']; + } + + Map toJson() { + final Map data = new Map(); + data['CCDate'] = this.cCDate; + data['CreatedBy'] = this.createdBy; + data['PlainChiefComplaint'] = this.plainChiefComplaint; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['rtfChiefComplaint'] = this.rtfChiefComplaint; + return data; + } +} + +class LstDiagnosis { + String diagnosis; + int projectID; + String projectName; + String setupID; + String state; + String status; + + LstDiagnosis( + {this.diagnosis, + this.projectID, + this.projectName, + this.setupID, + this.state, + this.status}); + + LstDiagnosis.fromJson(Map json) { + diagnosis = json['Diagnosis']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + state = json['State']; + status = json['Status']; + } + + Map toJson() { + final Map data = new Map(); + data['Diagnosis'] = this.diagnosis; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['State'] = this.state; + data['Status'] = this.status; + return data; + } +} + +class LstEncounterHistory { + String clinician; + String date; + String encounterType; + int projectID; + String projectName; + String reason; + String setupID; + String speciality; + String type; + + LstEncounterHistory( + {this.clinician, + this.date, + this.encounterType, + this.projectID, + this.projectName, + this.reason, + this.setupID, + this.speciality, + this.type}); + + LstEncounterHistory.fromJson(Map json) { + clinician = json['Clinician']; + date = json['Date']; + encounterType = json['EncounterType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + reason = json['Reason']; + setupID = json['SetupID']; + speciality = json['Speciality']; + type = json['Type']; + } + + Map toJson() { + final Map data = new Map(); + data['Clinician'] = this.clinician; + data['Date'] = this.date; + data['EncounterType'] = this.encounterType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Reason'] = this.reason; + data['SetupID'] = this.setupID; + data['Speciality'] = this.speciality; + data['Type'] = this.type; + return data; + } +} + +class LstMedication { + String date; + int doseDurationDays; + String lastFilled; + String medication; + String prescription; + int projectID; + String projectName; + String setupID; + String icon; + + LstMedication( + {this.date, + this.doseDurationDays, + this.lastFilled, + this.medication, + this.prescription, + this.projectID, + this.projectName, + this.setupID, + this.icon}); + + LstMedication.fromJson(Map json) { + date = json['Date']; + doseDurationDays = json['DoseDurationDays']; + lastFilled = json['LastFilled']; + medication = json['Medication']; + prescription = json['Prescription']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + icon = json['icon']; + } + + Map toJson() { + final Map data = new Map(); + data['Date'] = this.date; + data['DoseDurationDays'] = this.doseDurationDays; + data['LastFilled'] = this.lastFilled; + data['Medication'] = this.medication; + data['Prescription'] = this.prescription; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['icon'] = this.icon; + return data; + } +} + +class LstPastHistory { + String history; + String historyType; + String historyTypeID; + String historyTypeName; + int projectID; + String projectName; + String remarks; + String setupID; + + LstPastHistory( + {this.history, + this.historyType, + this.historyTypeID, + this.historyTypeName, + this.projectID, + this.projectName, + this.remarks, + this.setupID}); + + LstPastHistory.fromJson(Map json) { + history = json['History']; + historyType = json['HistoryType']; + historyTypeID = json['HistoryTypeID']; + historyTypeName = json['HistoryTypeName']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['History'] = this.history; + data['HistoryType'] = this.historyType; + data['HistoryTypeID'] = this.historyTypeID; + data['HistoryTypeName'] = this.historyTypeName; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + return data; + } +} + +class DoctorWisePatientEpisodes { + String clinicName; + String lastVisitDate; + int projectID; + String projectName; + String setupID; + int doctorID; + String doctorName; + + DoctorWisePatientEpisodes( + {this.clinicName, + this.lastVisitDate, + this.projectID, + this.projectName, + this.setupID, + this.doctorID, + this.doctorName}); + + DoctorWisePatientEpisodes.fromJson(Map json) { + clinicName = json['ClinicName']; + lastVisitDate = json['LastVisitDate']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + doctorID = json['doctorID']; + doctorName = json['doctorName']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicName'] = this.clinicName; + data['LastVisitDate'] = this.lastVisitDate; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['doctorID'] = this.doctorID; + data['doctorName'] = this.doctorName; + return data; + } +} + +class Procedures { + int appointmentNo; + int episodeID; + String orderDate; + int patientID; + String patientType; + String procName; + String procedureId; + int projectID; + String projectName; + String setupID; + String dispalyName; + + Procedures( + {this.appointmentNo, + this.episodeID, + this.orderDate, + this.patientID, + this.patientType, + this.procName, + this.procedureId, + this.projectID, + this.projectName, + this.setupID, + this.dispalyName}); + + Procedures.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientType = json['PatientType']; + procName = json['ProcName']; + procedureId = json['ProcedureId']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + dispalyName = json['dispalyName']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ProcName'] = this.procName; + data['ProcedureId'] = this.procedureId; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['dispalyName'] = this.dispalyName; + return data; + } +} + +class LstAllEpisodes { + int admissionNo; + String appointmentDate; + int appointmentNo; + String appointmentType; + String clinicID; + String clinicName; + int doctorID; + String doctorName; + String endTime; + String episodeDate; + int episodeID; + int patientID; + int projectID; + String projectName; + String remarks; + String setupID; + String startTime; + String visitFor; + String visitType; + String dispalyName; + List lstAssessments; + List lstCheifComplaint; + List lstMedicalHistory; + List lstMedicine; + List lstPhysicalExam; + List lstProcedure; + List lstTreatmentPlan; + List lstVitalSign; + + LstAllEpisodes( + {this.admissionNo, + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.clinicID, + this.clinicName, + this.doctorID, + this.doctorName, + this.endTime, + this.episodeDate, + this.episodeID, + this.patientID, + this.projectID, + this.projectName, + this.remarks, + this.setupID, + this.startTime, + this.visitFor, + this.visitType, + this.dispalyName, + this.lstAssessments, + this.lstCheifComplaint, + this.lstMedicalHistory, + this.lstMedicine, + this.lstPhysicalExam, + this.lstProcedure, + this.lstTreatmentPlan, + this.lstVitalSign}); + + LstAllEpisodes.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + appointmentType = json['AppointmentType']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + endTime = json['EndTime']; + episodeDate = json['EpisodeDate']; + episodeID = json['EpisodeID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + startTime = json['StartTime']; + visitFor = json['VisitFor']; + visitType = json['VisitType']; + dispalyName = json['dispalyName']; + // if (json['lstAssessments'] != null) { + // lstAssessments = new List(); + // json['lstAssessments'].forEach((v) { + // lstAssessments.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstCheifComplaint'] != null) { + // lstCheifComplaint = new List(); + // json['lstCheifComplaint'].forEach((v) { + // lstCheifComplaint.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstMedicalHistory'] != null) { + // lstMedicalHistory = new List(); + // json['lstMedicalHistory'].forEach((v) { + // lstMedicalHistory.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstMedicine'] != null) { + // lstMedicine = new List(); + // json['lstMedicine'].forEach((v) { + // lstMedicine.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstPhysicalExam'] != null) { + // lstPhysicalExam = new List(); + // json['lstPhysicalExam'].forEach((v) { + // lstPhysicalExam.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstProcedure'] != null) { + // lstProcedure = new List(); + // json['lstProcedure'].forEach((v) { + // lstProcedure.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstTreatmentPlan'] != null) { + // lstTreatmentPlan = new List(); + // json['lstTreatmentPlan'].forEach((v) { + // lstTreatmentPlan.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstVitalSign'] != null) { + // lstVitalSign = new List(); + // json['lstVitalSign'].forEach((v) { + // lstVitalSign.add(new Null.fromJson(v)); + // }); + // } + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentType'] = this.appointmentType; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['EndTime'] = this.endTime; + data['EpisodeDate'] = this.episodeDate; + data['EpisodeID'] = this.episodeID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + data['StartTime'] = this.startTime; + data['VisitFor'] = this.visitFor; + data['VisitType'] = this.visitType; + data['dispalyName'] = this.dispalyName; + // if (this.lstAssessments != null) { + // data['lstAssessments'] = + // this.lstAssessments.map((v) => v.toJson()).toList(); + // } + // if (this.lstCheifComplaint != null) { + // data['lstCheifComplaint'] = + // this.lstCheifComplaint.map((v) => v.toJson()).toList(); + // } + // if (this.lstMedicalHistory != null) { + // data['lstMedicalHistory'] = + // this.lstMedicalHistory.map((v) => v.toJson()).toList(); + // } + // if (this.lstMedicine != null) { + // data['lstMedicine'] = this.lstMedicine.map((v) => v.toJson()).toList(); + // } + // if (this.lstPhysicalExam != null) { + // data['lstPhysicalExam'] = + // this.lstPhysicalExam.map((v) => v.toJson()).toList(); + // } + // if (this.lstProcedure != null) { + // data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + // } + // if (this.lstTreatmentPlan != null) { + // data['lstTreatmentPlan'] = + // this.lstTreatmentPlan.map((v) => v.toJson()).toList(); + // } + // if (this.lstVitalSign != null) { + // data['lstVitalSign'] = this.lstVitalSign.map((v) => v.toJson()).toList(); + // } + return data; + } +} + +class Timelines { + int clinicId; + String clinicName; + String date; + int doctorId; + String doctorImage; + String doctorName; + int encounterNumber; + String encounterType; + int projectID; + String projectName; + String setupID; + + Timelines( + {this.clinicId, + this.clinicName, + this.date, + this.doctorId, + this.doctorImage, + this.doctorName, + this.encounterNumber, + this.encounterType, + this.projectID, + this.projectName, + this.setupID}); + + Timelines.fromJson(Map json) { + clinicId = json['ClinicId']; + clinicName = json['ClinicName']; + date = json['Date']; + doctorId = json['DoctorId']; + doctorImage = json['DoctorImage']; + doctorName = json['DoctorName']; + encounterNumber = json['EncounterNumber']; + encounterType = json['EncounterType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + } + + Map toJson() { + final Map data = new Map(); + data['ClinicId'] = this.clinicId; + data['ClinicName'] = this.clinicName; + data['Date'] = this.date; + data['DoctorId'] = this.doctorId; + data['DoctorImage'] = this.doctorImage; + data['DoctorName'] = this.doctorName; + data['EncounterNumber'] = this.encounterNumber; + data['EncounterType'] = this.encounterType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + return data; + } +} diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a988b61c..ce58776d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -284,7 +284,7 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { formKey.currentState.save(); if (formKey.currentState.validate()) { - postPrescription( + postProcedure( model: model, duration: durationController.text, dose: doseController.text, @@ -326,7 +326,7 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { }); } -postPrescription( +postProcedure( {String duration, String dose, String drugId, diff --git a/pubspec.lock b/pubspec.lock index c6829dad..493985a1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -440,7 +440,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -482,7 +482,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -739,7 +739,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -874,5 +874,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From d5bde6228a53969d3a7f3f93ecb04234fc7047b2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 31 Dec 2020 23:29:31 +0200 Subject: [PATCH 099/421] add search in update assessment page --- .../soap_update/update_assessment_page.dart | 65 ++++++++----------- 1 file changed, 26 insertions(+), 39 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 556949e8..61c7f20b 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,3 +1,4 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; @@ -377,6 +378,7 @@ class _AddAssessmentDetailsState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController( text: "234567"); + GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { @@ -385,7 +387,7 @@ class _AddAssessmentDetailsState extends State { .of(context) .size; InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { + String selectedText, bool isDropDown,{IconData icon}) { //TODO: make one Input InputDecoration for all return InputDecoration( focusedBorder: OutlineInputBorder( @@ -401,7 +403,7 @@ class _AddAssessmentDetailsState extends State { borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null, hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, @@ -418,9 +420,9 @@ class _AddAssessmentDetailsState extends State { if (model.listOfDiagnosisType.length == 0) { await model.getMasterLookup(MasterKeysService.DiagnosisType); } - // if (model.listOfICD10.length == 0) { - // await model.getMasterLookup(MasterKeysService.ICD10); - // } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } }, builder: (_, model, w) => AppScaffold( @@ -472,43 +474,28 @@ class _AddAssessmentDetailsState extends State { child: InkWell( onTap: model.listOfDiagnosisType != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - isICD: true, - list: model.listOfDiagnosisType, - selectedValue: widget - .mySelectedAssessment - .selectedICD, - okText: TranslationBase - .of(context) - .ok, - okFunction: - (MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedICD = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); + setState(() { + widget.mySelectedAssessment.selectedICD = null; + }); } : null, - child: TextField( + child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), + key: key, + suggestions: model.listOfICD10, + itemBuilder: (context, suggestion) => new Padding( + child:Texts( suggestion.description +" / "+ suggestion.code.toString()), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase()) + ||suggestion.code.toLowerCase().startsWith(input.toLowerCase()) + , + ): TextField( decoration: textFieldSelectorDecoration( - "Name / ICD", - widget.mySelectedAssessment - .selectedICD != - null - ? widget.mySelectedAssessment - .selectedICD.nameEn - : null, - true), + widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", + widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), From 1af5f1040fbeca3b36b6f4895e061af9270871d2 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 31 Dec 2020 23:45:55 +0200 Subject: [PATCH 100/421] add search in soap update --- .../SOAP/subjective/add_allergies_widget.dart | 3 +- .../subjective/update_allergies_widget.dart | 53 ++- .../subjective/update_history_widget.dart | 317 +++--------------- .../soap_update/update_objective_page.dart | 110 ++---- 4 files changed, 102 insertions(+), 381 deletions(-) diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart index 0a4ce08e..43748f3d 100644 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart @@ -242,7 +242,8 @@ class _AddAllergiesState extends State { ), SizedBox( height: 10, - ), Container( + ), + Container( height: screenSize.height * 0.070, child: InkWell( onTap: model.allergySeverityList != null diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index d7bbd0af..fa6b8acb 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -1,6 +1,8 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -14,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class UpdateAllergiesWidget extends StatefulWidget { final List myAllergiesList; @@ -144,10 +147,11 @@ class _AddAllergiesState extends State { MasterKeyModel _selectedAllergySeverity; MasterKeyModel _selectedAllergy; TextEditingController remarkController = TextEditingController(); + GlobalKey key = new GlobalKey>(); InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { + String selectedText, bool isDropDown,{IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -162,7 +166,7 @@ class _AddAllergiesState extends State { borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, hintStyle: TextStyle( fontSize: 14, color: Colors.grey.shade600, @@ -172,6 +176,7 @@ class _AddAllergiesState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); final screenSize = MediaQuery .of(context) .size; @@ -214,40 +219,32 @@ class _AddAllergiesState extends State { child: InkWell( onTap: model.allergiesList != null ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.allergiesList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (MasterKeyModel selectedValue) { - setState(() { - _selectedAllergy = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); + setState(() { + _selectedAllergy = null; + }); } : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Allergy", - _selectedAllergy != null - ? _selectedAllergy.nameEn - : null, - true), + child: _selectedAllergy==null? AutoCompleteTextField( + decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), + itemSubmitted: (item) => setState(() => _selectedAllergy = item), + key: key, + suggestions: model.allergiesList, + itemBuilder: (context, suggestion) => new Padding( + child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()), + ):TextField( + decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), ), SizedBox( height: 10, - ), Container( + ), + Container( height: screenSize.height * 0.070, child: InkWell( onTap: model.allergySeverityList != null diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index d8f2b888..5e033127 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -280,273 +281,59 @@ class _AddHistoryDialogState extends State { }, scrollDirection: Axis.horizontal, children: [ - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.historyFamilyList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - (bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.mergeHistorySurgicalWithHistorySportList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - widget.addSelectedHistories(); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), - Container( - child: Column( - children: [ - NetworkBaseView( - baseViewModel: model, - child: Container( - height: - MediaQuery.of(context).size.height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model.historyMedicalList - .map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - historyInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - historyInfo - )) { - widget - .removeHistory( - historyInfo - ); - } - else { - widget - .myHistoryList - .add( - historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - historyInfo.nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED HISTORIES" - .toUpperCase(), - onPressed: () { - setState(() { - widget.addSelectedHistories(); - }); - }, - ), - ], - ), + MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + widget.myHistoryList.add(history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index d7123678..b43db98d 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -17,6 +17,7 @@ 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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -497,96 +498,31 @@ class _AddExaminationDailogState extends State { ), NetworkBaseView( baseViewModel: model, - child: Container( - height: - MediaQuery - .of(context) - .size - .height * 0.5, - child: Center( - child: Container( - margin: EdgeInsets.only(top: 15), - decoration: BoxDecoration( - borderRadius: BorderRadius - .circular(12), - color: Colors.white), - child: ListView( - children: [ - Column( - children: model - .physicalExaminationList - .map((examinationInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: isServiceSelected( - examinationInfo), - activeColor: - Colors.red[800], - onChanged: - ( - bool newValue) { - setState(() { - if (isServiceSelected( - examinationInfo - )) { - widget - .removeExamination( - examinationInfo - ); - } - else { - MySelectedExamination mySelectedExamination = new MySelectedExamination( - selectedExamination: examinationInfo - ); - widget - .mySelectedExamination - .add( - mySelectedExamination); - } - }); - }), - Expanded( - child: Padding( - padding: - const EdgeInsets - .symmetric( - horizontal: 10, - vertical: 0), - child: Texts( - examinationInfo - .nameEn, - variant: "bodyText", - bold: true, - color: - Colors.black), - ), - ), - ], - ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), - ], - ), - )), - ), - ), - SizedBox( - height: 10, - ), - if (model.state == ViewState.Idle) - AppButton( - title: "Add SELECTED Examinations" - .toUpperCase(), - onPressed: () { + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.physicalExaminationList, + removeHistory: (history){ + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (history){ + setState(() { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: history + ); + widget + .mySelectedExamination + .add( + mySelectedExamination); + }); + }, + addSelectedHistories: (){ widget.addSelectedExamination(); }, + isServiceSelected: (master) =>isServiceSelected(master), ), + ), ]), ))), )), From 4caf40a2ab4f368e00b39a5ca3f98b715bcb237c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 31 Dec 2020 23:49:18 +0200 Subject: [PATCH 101/421] finish plan page --- lib/core/service/SOAP_service.dart | 12 ++- lib/core/viewModel/SOAP_view_model.dart | 13 ++- .../SOAP/GetGetProgressNoteReqModel.dart | 40 ++++++++++ .../SOAP/GetGetProgressNoteResModel.dart | 25 ++++++ .../soap_update/update_objective_page.dart | 2 + .../profile/soap_update/update_plan_page.dart | 79 +++++++++++-------- 6 files changed, 133 insertions(+), 38 deletions(-) create mode 100644 lib/models/SOAP/GetGetProgressNoteReqModel.dart create mode 100644 lib/models/SOAP/GetGetProgressNoteResModel.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 65b6d0cc..09530d50 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; @@ -24,6 +26,7 @@ class SOAPService extends LookupService { List patientAllergiesList = []; List patientHistoryList = []; List patientPhysicalExamList = []; + List patientProgressNoteList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( @@ -246,6 +249,7 @@ class SOAPService extends LookupService { response['PhysicalExamList']['entityList'].forEach((v) { patientPhysicalExamList.add(GetPhysicalExamResModel.fromJson(v)); }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -253,15 +257,19 @@ class SOAPService extends LookupService { } Future getPatientProgressNote( - PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async { + GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { hasError = false; await baseAppClient.post (GET_PROGRESS_NOTE, onSuccess: (dynamic response, int statusCode) { print("Success"); + patientProgressNoteList.clear(); + response['ProgressNoteList']['entityList'].forEach((v) { + patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientProgressNoteRequestModel.toJson()); + }, body: getGetProgressNoteReqModel.toJson()); } Future getPatientAssessment( diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 4226643a..8d03a04e 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; @@ -67,6 +69,9 @@ class SOAPViewModel extends BaseViewModel { List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; + List get patientProgressNoteList => + _SOAPService.patientProgressNoteList; + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); @@ -245,17 +250,17 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.getPatientPhysicalExam(getPhysicalExamReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientProgressNote(PostProgressNoteRequestModel getPatientProgressNoteRequestModel) async { + Future getPatientProgressNote(GetGetProgressNoteReqModel getGetProgressNoteReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientProgressNote(getPatientProgressNoteRequestModel); + await _SOAPService.getPatientProgressNote(getGetProgressNoteReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart new file mode 100644 index 00000000..936c6f65 --- /dev/null +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -0,0 +1,40 @@ +class GetGetProgressNoteReqModel { + int patientMRN; + int appointmentNo; + String episodeID; + String from; + String to; + int clinicID; + int doctorID; + + GetGetProgressNoteReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.doctorID}); + + GetGetProgressNoteReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + from = json['From']; + to = json['To']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['From'] = this.from; + data['To'] = this.to; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart new file mode 100644 index 00000000..bbc184f1 --- /dev/null +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -0,0 +1,25 @@ +class GetGetProgressNoteResModel { + int appointmentNo; + int episodeId; + int patientMRN; + String planNote; + + GetGetProgressNoteResModel( + {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + + GetGetProgressNoteResModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + episodeId = json['episodeId']; + patientMRN = json['patientMRN']; + planNote = json['planNote']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['episodeId'] = this.episodeId; + data['patientMRN'] = this.patientMRN; + data['planNote'] = this.planNote; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index d7123678..4884422c 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -83,6 +83,8 @@ class _UpdateObjectivePageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + //TODO: retrun it back + // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index a6ce8fad..506ff103 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -53,8 +54,21 @@ class _UpdatePlanPageState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), + onModelReady: (model) async { + GetGetProgressNoteReqModel getGetProgressNoteReqModel = + GetGetProgressNoteReqModel( + appointmentNo: widget.patientInfo.appointmentNo, + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString()); + await model.getPatientProgressNote(getGetProgressNoteReqModel); + + if (model.patientProgressNoteList.isNotEmpty) { + progressNoteController.text = + model.patientProgressNoteList[0].planNote; + } + }, builder: (_, model, w) => AppScaffold( + baseViewModel: model, isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), @@ -74,8 +88,7 @@ class _UpdatePlanPageState extends State { Row( children: [ Texts('Progress Note', - variant: - isProgressNoteExpand ? "bodyText" : '', + variant: isProgressNoteExpand ? "bodyText" : '', bold: isProgressNoteExpand ? true : false, color: Colors.black), Icon( @@ -88,8 +101,7 @@ class _UpdatePlanPageState extends State { InkWell( onTap: () { setState(() { - isProgressNoteExpand = - !isProgressNoteExpand; + isProgressNoteExpand = !isProgressNoteExpand; }); }, child: Icon(isProgressNoteExpand @@ -105,7 +117,7 @@ class _UpdatePlanPageState extends State { children: [ Container( margin: - EdgeInsets.only(left: 10, right: 10, top: 15), + EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( hintText: "Add Progress Note", fontSize: 13.5, @@ -120,8 +132,7 @@ class _UpdatePlanPageState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase - .of(context) + return TranslationBase.of(context) .emptyMessage; else return null; @@ -133,10 +144,10 @@ class _UpdatePlanPageState extends State { if (progressNoteController.text.isNotEmpty) Container( margin: - EdgeInsets.only(left: 5, right: 5, top: 15), + EdgeInsets.only(left: 5, right: 5, top: 15), child: Row( mainAxisAlignment: - MainAxisAlignment.spaceBetween, + MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( @@ -144,9 +155,9 @@ class _UpdatePlanPageState extends State { children: [ Column( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( "12".toUpperCase(), @@ -163,13 +174,12 @@ class _UpdatePlanPageState extends State { ], ), Column( - crossAxisAlignment: CrossAxisAlignment - .start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ SizedBox( height: 6, @@ -177,25 +187,25 @@ class _UpdatePlanPageState extends State { Padding( padding: const EdgeInsets.all(0.0), child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.6, + width: MediaQuery.of(context) + .size + .width * + 0.6, child: AppText( progressNoteController.text, fontSize: 10, - color: Colors.grey, ), ), ), ], - ), SizedBox( + ), + SizedBox( height: 8, ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( "Created By : ", @@ -211,7 +221,7 @@ class _UpdatePlanPageState extends State { ), Row( mainAxisAlignment: - MainAxisAlignment.start, + MainAxisAlignment.start, children: [ AppText( "Edited By : ", @@ -225,7 +235,6 @@ class _UpdatePlanPageState extends State { ), ], ), - ], ), Column( @@ -246,14 +255,13 @@ class _UpdatePlanPageState extends State { ]), isExpand: isProgressNoteExpand, ), - DividerWithSpacesAround(height: 30,), + DividerWithSpacesAround( + height: 30, + ), AppButton( - title: TranslationBase - .of(context) - .next, + title: TranslationBase.of(context).next, loading: model.state == ViewState.BusyLocal, onPressed: () { - submitPlan(model); // widget.changePageViewIndex(2); }, @@ -265,7 +273,9 @@ class _UpdatePlanPageState extends State { ), ), ), - ),),); + ), + ), + ); } submitPlan(SOAPViewModel model) async { @@ -276,8 +286,13 @@ class _UpdatePlanPageState extends State { appointmentNo: widget.patientInfo.appointmentNo, planNote: progressNoteController.text); + if(model.patientProgressNoteList.isEmpty){ + await model.postProgressNote(postProgressNoteRequestModel); + + }else { + await model.patchProgressNote(postProgressNoteRequestModel); - await model.patchProgressNote(postProgressNoteRequestModel); + } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From 3c968f0de11e8428a5a67cc9d8dbfd4731229396 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Fri, 1 Jan 2021 09:59:00 +0300 Subject: [PATCH 102/421] doctor leave --- assets/fonts/DoctorApp.ttf | Bin 17812 -> 15928 bytes assets/images/leaves.svg | 7 + lib/config/config.dart | 9 +- lib/config/localized_values.dart | 4 + lib/core/service/sickleave_service.dart | 53 ++- .../viewModel/leave_rechdule_response.dart | 52 +++ lib/core/viewModel/patient_view_model.dart | 2 +- lib/core/viewModel/sick_leave_view_model.dart | 17 +- lib/icons_app/config.json | 41 +- lib/icons_app/doctor_app_icons.dart | 91 ++-- lib/screens/dashboard_screen.dart | 3 +- .../add-rescheduleleave.dart | 259 +++++++----- .../reschedule-leaves/reschedule_leave.dart | 395 +++++++++++++++--- lib/util/translations_delegate_base.dart | 6 + lib/widgets/shared/app_drawer_widget.dart | 39 +- 15 files changed, 730 insertions(+), 248 deletions(-) create mode 100644 assets/images/leaves.svg create mode 100644 lib/core/viewModel/leave_rechdule_response.dart diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 21ce4a5dcc4d71ffbba5bd4b4b466b06d1b154c3..22539da0652f12c82f86a0652f0c69f2a8f697c8 100644 GIT binary patch delta 901 zcmYL_K}-`-5Qb-V+ikb)0^KbYTIfOxNCFgXVFLsUQKN}RK@);V*0Kmm3)mKg1j7wf zI3VR3v0o} za|{5k0>H(1Qk@xo`C}M>83bUPuO{ZlV~>~m0jyg9(d`LM9jkqCpM2OMDH8Z<{yTGHmu(8_3e?;bc=od|48EqDG|W6v1jRQ3wRcA)o^ zmU*ux8^CMWmR-X>RI=}IVUbg5l5QB3w31j-E6GAL3Z+p1FNm6#Tgf^~+ydsP3ffe! zm+Mu!PnY$e-l!{PCmnQ&NPtMgA))I33+Y}Mx@h+R+XKDXSImjL!MKo5{4J`@do1nP z7Nk}rpueLx915z*HXaImWR*jKKYPm>wXIkEuI{hi&A+x9;rwiOGn1d~yM&8Q!!Rb< zuj~bIf(vA*gAO2!BA zwPRBmQ|b1YoQ=pBz)E)+wqqD6t3<646+PIcVX=9f3{8ZdImQrtMsnN;! N^c0uS)azOr;14+9%>V!Z delta 2668 zcmZ`)X>1$E6`r@t-4&P1m6qi0iWEulUda+ki`PnFL@`ie_^f3$QWV#|iM-eh!mPHhcCLC> zqm2e3t7O%Qdq3T;J%D;WB!xek3WGi@gd??^%x1w$d?@2zQCM)`sYET{9G&s$UI|!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y51_Ueo-BEHtxa26oOKaDJcU8Z(c29U&U&EVng!1)2 z*w5MZ#KNI%TKCxD%A_F$b(EaS7^BOlpXy8=95(k=O}i?|D!6Sy!{|umddve^#_MHr z`%TvSWi=61EWx;C@F`cwZQHq2?C2;i?X^cptSv$%gda>d5f7Ftr6c7Pc9?-Nxl*2;pP64MA1jxZXXdO&m*X>wv*q}JxLiJ1US2L8 pi4U~3w&huSOKGWee7?MJ+;Z&9!i+e(Tsl==o}XD + + + + + + diff --git a/lib/config/config.dart b/lib/config/config.dart index 7d39df7b..ef5898b3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = @@ -109,9 +109,10 @@ const GET_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; - +const GET_COVERING_DOCTORS = + 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const GET_RESCHEDULE_LEAVE = - 'Services/DoctorApplication.svc/REST/GetAllSickLeaves'; + 'Services/DoctorApplication.svc/REST/GetRequisition'; const GET_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/GetPrescription'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f9a1fcd5..127ee975 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -386,4 +386,8 @@ const Map> localizedValues = { 'fio2': {'en': "FIO2(%)", 'ar': 'FIO2(%)'}, 'sao2': {'en': "SAO2(%)", 'ar': 'SAO2(%)'}, 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, + 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, + 'to': {'en': "To", 'ar': 'إلى'}, + 'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, + 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'} }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 926187dd..cd0dbf50 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; @@ -8,11 +9,18 @@ import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.d class SickLeaveService extends BaseService { Map get sickLeavestatisitics => _statistics; Map _statistics = {}; - var offTime = []; - - get getOffTimeList => offTime; + List get getOffTimeList => offTime; + List offTime = []; + List get getReasons => reasonse; + List reasonse = []; List get getAllSickLeave => _getAllsickLeave; List _getAllsickLeave = []; + List get coveringDoctorsList => _coveringDoctors; + List _coveringDoctors = []; + + List get getAllRescheduleLeave => + _getReScheduleLeave; + List _getReScheduleLeave = []; Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -38,7 +46,7 @@ class SickLeaveService extends BaseService { ADD_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { Future.value(response); - print(response); + //print(response); // _statistics = {}; // _statistics = response['SickLeaveStatistics']; }, @@ -99,16 +107,16 @@ class SickLeaveService extends BaseService { GET_RESCHEDULE_LEAVE, onSuccess: (dynamic response, int statusCode) { Future.value(response); - _getAllsickLeave.clear(); - // response['SickLeavesList']['entityList'].forEach((v) { - // _getAllsickLeave.add(GetAllSickLeaveResponse.fromJson(v)); - // }); + _getReScheduleLeave.clear(); + response['requisitionList']['entityList'].forEach((v) { + _getReScheduleLeave.add(GetRescheduleLeavesResponse.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, - body: {'PatientMRN': 3120772}, + body: {'ClinicID': 1}, ); } @@ -119,7 +127,7 @@ class SickLeaveService extends BaseService { GET_OFFTIME, onSuccess: (dynamic response, int statusCode) { offTime = []; - offTime = response[' ']; + offTime = response['MasterLookUpList']['entityList']; }, onFailure: (String error, int statusCode) { hasError = true; @@ -129,20 +137,37 @@ class SickLeaveService extends BaseService { ); } - Future getReasons(id) async { + Future getReasonsByID({id}) async { hasError = false; await baseAppClient.post( GET_OFFTIME, onSuccess: (dynamic response, int statusCode) { - offTime = []; - offTime = response[' ']; + reasonse = []; + reasonse = response['MasterLookUpList']['entityList']; + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: {"MasterInput": id ?? 18}, + ); + } + + Future getCoveringDoctors() async { + hasError = false; + + await baseAppClient.post( + GET_COVERING_DOCTORS, + onSuccess: (dynamic response, int statusCode) { + _coveringDoctors = []; + _coveringDoctors = response['coveringDoctorList']['entityList']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, - body: {"MasterInput": id}, + body: {"ClinicID": 1}, ); } } diff --git a/lib/core/viewModel/leave_rechdule_response.dart b/lib/core/viewModel/leave_rechdule_response.dart new file mode 100644 index 00000000..d7cab8bf --- /dev/null +++ b/lib/core/viewModel/leave_rechdule_response.dart @@ -0,0 +1,52 @@ +class GetRescheduleLeavesResponse { + int clinicId; + var coveringDoctorId; + String date; + String dateTimeFrom; + String dateTimeTo; + int doctorId; + int reasonId; + int requisitionNo; + int requisitionType; + int status; + + GetRescheduleLeavesResponse( + {this.clinicId, + this.coveringDoctorId, + this.date, + this.dateTimeFrom, + this.dateTimeTo, + this.doctorId, + this.reasonId, + this.requisitionNo, + this.requisitionType, + this.status}); + + GetRescheduleLeavesResponse.fromJson(Map json) { + clinicId = json['clinicId']; + coveringDoctorId = json['coveringDoctorId']; + date = json['date']; + dateTimeFrom = json['dateTimeFrom']; + dateTimeTo = json['dateTimeTo']; + doctorId = json['doctorId']; + reasonId = json['reasonId']; + requisitionNo = json['requisitionNo']; + requisitionType = json['requisitionType']; + status = json['status']; + } + + Map toJson() { + final Map data = new Map(); + data['clinicId'] = this.clinicId; + data['coveringDoctorId'] = this.coveringDoctorId; + data['date'] = this.date; + data['dateTimeFrom'] = this.dateTimeFrom; + data['dateTimeTo'] = this.dateTimeTo; + data['doctorId'] = this.doctorId; + data['reasonId'] = this.reasonId; + data['requisitionNo'] = this.requisitionNo; + data['requisitionType'] = this.requisitionType; + data['status'] = this.status; + return data; + } +} diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 9672da83..2fcdc779 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,7 +49,7 @@ class PatientViewModel extends BaseViewModel { List get referralFrequencyList => _patientService.referalFrequancyList; - Future getPatientList( patient, patientType, + Future getPatientList(patient, patientType, {bool isBusyLocal = false}) async { if (isBusyLocal) { setState(ViewState.BusyLocal); diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 2e07d3b0..7c162ad1 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -12,7 +12,10 @@ class SickLeaveViewModel extends BaseViewModel { SickLeaveService _sickLeaveService = locator(); get sickLeaveStatistics => _sickLeaveService.sickLeavestatisitics; get getAllSIckLeave => _sickLeaveService.getAllSickLeave; - get allOffTime => _sickLeaveService.getOffTimeList; + List get allOffTime => _sickLeaveService.getOffTimeList; + List get allReasons => _sickLeaveService.getReasons; + List get coveringDoctors => _sickLeaveService.coveringDoctorsList; + get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); @@ -75,7 +78,17 @@ class SickLeaveViewModel extends BaseViewModel { Future getReasons(id) async { setState(ViewState.Busy); - await _sickLeaveService.getReasons(id); + await _sickLeaveService.getReasonsByID(id: id); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getCoveringDoctors() async { + setState(ViewState.Busy); + await _sickLeaveService.getCoveringDoctors(); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index fef927b0..ede09595 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -384,6 +384,34 @@ "sync" ] }, + { + "uid": "a0f7dbb184f90f285a9cba8cf09a9b6a", + "css": "drawer_icon", + "code": 59429, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z", + "width": 1633 + }, + "search": [ + "drawer_icon" + ] + }, + { + "uid": "764baf138776221a3e1e845391b188a4", + "css": "leaves", + "code": 59446, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M968.7 468.7H572.9A31.3 31.3 0 1 1 572.9 406.2H968.7A31.3 31.3 0 1 1 968.7 468.7ZM968.7 468.7M812.5 625A31.3 31.3 0 0 1 790.4 571.6L924.5 437.5 790.4 303.3A31.3 31.3 0 0 1 834.6 259.1L990.9 415.4A31.3 31.3 0 0 1 990.9 459.6L834.6 615.8A31.2 31.2 0 0 1 812.5 625ZM812.5 625M333.3 1000A83.3 83.3 0 0 0 416.7 916.7V166.7A83.9 83.9 0 0 0 360.3 87.5L109.9 4.1A84.2 84.2 0 0 0 0 83.4V833.4A83.9 83.9 0 0 0 56.4 912.4L306.8 995.8A87.2 87.2 0 0 0 333.3 1000ZM83.3 62.5A24.5 24.5 0 0 1 90.8 63.6L340.1 146.7A21.4 21.4 0 0 1 354.2 166.6V916.6A22 22 0 0 1 325.9 936.4L76.6 853.3A21.5 21.5 0 0 1 62.5 833.3V83.3A20.9 20.9 0 0 1 83.3 62.5ZM83.3 62.5M635.4 208.3A31.3 31.3 0 0 0 666.7 177.1V114.6A114.7 114.7 0 0 0 552.1 0H83.3A31.3 31.3 0 0 0 83.3 62.5H552.1A52.1 52.1 0 0 1 604.2 114.6V177.1A31.3 31.3 0 0 0 635.4 208.3ZM635.4 208.3M385.4 875H552.1A114.7 114.7 0 0 0 666.6 760.4V697.9A31.3 31.3 0 0 0 604.1 697.9V760.4A52.1 52.1 0 0 1 552.1 812.5H385.4A31.3 31.3 0 0 0 385.4 875ZM385.4 875", + "width": 1000 + }, + "search": [ + "leaves" + ] + }, { "uid": "740f78c2b53c8cc100a8b0d283bbd34f", "css": "home_icon-1", @@ -481,19 +509,6 @@ "search": [ "scdedule_icon_active" ] - }, { - "uid": "a0f7dbb184f90f285a9cba8cf09a9b6a", - "css": "drawer_icon", - "code": 59429, - "src": "custom_icons", - "selected": true, - "svg": { - "path": "M1564.7 1000H68C30.6 1000 0 958.7 0 908.2H0C0 857.6 30.6 816.3 68 816.3H1564.7C1602 816.3 1632.7 857.6 1632.7 908.2H1632.7C1632.7 958.7 1602 1000 1564.7 1000ZM911.6 591.8H68C30.6 591.8 0 550.5 0 500H0C0 449.5 30.6 408.2 68 408.2H911.6C949 408.2 979.6 449.5 979.6 500H979.6C979.6 550.5 949 591.8 911.6 591.8ZM1238.1 183.7H68C30.6 183.7 0 142.4 0 91.8H0C0 41.3 30.6 0 68 0H1238.1C1275.5 0 1306.1 41.3 1306.1 91.8H1306.1C1306.1 142.4 1275.5 183.7 1238.1 183.7Z", - "width": 1633 - }, - "search": [ - "drawer_icon" - ] } ] } \ No newline at end of file diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 80db55c1..ef01c934 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -19,35 +19,64 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const _kFontPkg = null; - - static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = IconData(0xe820, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = IconData(0xe821, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = IconData(0xe823, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const String _kFontPkg = null; + static const IconData female_icon = + IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = + IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = + IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = + IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = + IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = + IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = + IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = + IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = + IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = + IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = + IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = + IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = + IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = + IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = + IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = + IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = + IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = + IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = + IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = + IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = + IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = + IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = + IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 948c41f5..292cd585 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -964,9 +964,8 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - Icons.rule_folder, + DoctorApp.leaves, size: 50, - color: Colors.black, ), AppText( TranslationBase.of(context).rescheduleLeaves, diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 8963f306..79b47523 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.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'; @@ -8,6 +10,7 @@ import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.da import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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'; @@ -17,119 +20,179 @@ class AddRescheduleLeavScreen extends StatelessWidget { @override Widget build(BuildContext context) { return BaseView( - onModelReady: (model) => model.getRescheduleLeave(), + onModelReady: (model) => + {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: model.getAllSIckLeave.length > 0 + body: model.getReschduleLeave.length > 0 ? SingleChildScrollView( child: 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( + margin: + EdgeInsets.only(left: 15, right: 15, top: 20), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: + TranslationBase.of(context).requestLeave, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + Icons.add_circle, + color: Colors.red, + )), + textInputType: TextInputType.text, + onTap: () { + openLeave( + context, + false, + ); + }, + inputFormatter: ONLY_LETTERS, + ) + ], + ), + ), + Column( + children: model.getReschduleLeave.map( + (GetRescheduleLeavesResponse 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( children: [ - Container( - padding: EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .approved - : item.status == 2 + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: + EdgeInsets.all(3), + child: AppText( + item.status == 1 ? TranslationBase .of(context) - .extended - : TranslationBase - .of(context) - .pending, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - color: item.status == 1 - ? Colors.green - : Colors.yellow[800], - ), - Row( - children: [ - AppText( + .approved + : item.status == 2 + ? TranslationBase.of( + context) + .pending + : TranslationBase.of( + context) + .rejected, + fontWeight: + FontWeight.bold, + color: Colors.white, + ), + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? Colors + .yellow[800] + : Colors.red[800], + ), + SizedBox( + height: 5, + ), + Container( + child: AppText( TranslationBase.of( context) - .leaveStartDate + + .holiday + ' ', fontWeight: FontWeight.bold, + )), + Row( + children: [ + Flexible( + child: Text( + item.dateTimeFrom + + ' ' + + TranslationBase.of( + context) + .to + + ' ' + + item.dateTimeTo, + // overflow: + // TextOverflow.ellipsis, + )) + ], ), - Flexible( - child: Text( - item.startDate, - overflow: - TextOverflow.ellipsis, - )) - ], - ), - AppText( - item.noOfDays.toString() + - ' ' + + SizedBox( + height: 5, + ), + AppText( TranslationBase.of( context) - .daysSickleave, - fontWeight: FontWeight.bold, + .coveringDoctor, + fontWeight: + FontWeight.bold, + ), + model.coveringDoctors + .length > + 0 + ? Row(children: [ + AppText(getDoctor( + model + .coveringDoctors, + item.doctorId)) + ]) + : SizedBox(), + ], + ), + SizedBox( + width: 10, ), - Row(children: [ - AppText( - item.remarks, - ) - ]), ], ), - SizedBox( - width: 20, - ), - ], - ), - ), - (item.status == 1 || item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.open_in_full, - size: 40, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - // openSickLeave(context, true, - // extendedData: item) - }, - )) - : SizedBox(), - ], - )), - SizedBox( - height: 20, - ), - Divider( - height: 1, - ), - ], - )); - }).toList(), + ), + (item.status == 1) + ? Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.edit_outlined, + size: 30, + ), + // color: Colors.green, //Colors.black, + onPressed: () => { + // openSickLeave(context, true, + // extendedData: item) + }, + )) + : SizedBox(), + ], + )), + SizedBox( + height: 10, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ) + ], ), ) : new Builder(builder: (context) { @@ -190,4 +253,12 @@ class AddRescheduleLeavScreen extends StatelessWidget { )); }); } + + getDoctor(model, doctorId) { + var obj; + obj = model.where((i) => i['doctorID'] == doctorId).toList(); + print(obj); + + return obj.length > 0 ? obj[0]['doctorName'] : ""; + } } diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 6de0779e..9ed6dae7 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; 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/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -20,6 +21,7 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:provider/provider.dart'; Helpers helpers = Helpers(); @@ -32,6 +34,7 @@ class RescheduleLeaveScreen extends StatefulWidget { class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); + ProjectViewModel projectsProvider; String _selectedClinic; Map profile = {}; AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); @@ -59,17 +62,23 @@ class _RescheduleLeaveScreen extends State { @override void initState() { getProfile(); + super.initState(); } @override Widget build(BuildContext context) { + projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( - onModelReady: (model2) => model2.getOffTime(), + onModelReady: (model2) => { + model2.getOffTime(), + model2.getReasons(18), + model2.getCoveringDoctors() + }, builder: (_, model2, w) => AppScaffold( - baseViewModel: model, + baseViewModel: model2, isShowAppBar: false, body: Center( child: Container( @@ -79,8 +88,7 @@ class _RescheduleLeaveScreen extends State { child: ListView( children: [ Container( - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), @@ -98,10 +106,6 @@ class _RescheduleLeaveScreen extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).clinicName, - // fontSize: 10, - // ), Row( mainAxisSize: MainAxisSize.max, children: [ @@ -163,11 +167,9 @@ class _RescheduleLeaveScreen extends State { ], ), )), - SizedBox( - height: 10, - ), + Container( - margin: EdgeInsets.only(left: 10, right: 10), + margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), @@ -181,7 +183,9 @@ class _RescheduleLeaveScreen extends State { ignoring: true, child: AppTextFormField( readOnly: true, - hintText: profile['DoctorName'], + hintText: profile != null + ? profile['DoctorName'] + : "", borderColor: Colors.white, onSaved: (value) {}, inputFormatter: ONLY_NUMBERS)) @@ -190,8 +194,7 @@ class _RescheduleLeaveScreen extends State { ), Container( - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), + margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), @@ -212,65 +215,319 @@ class _RescheduleLeaveScreen extends State { Row( mainAxisSize: MainAxisSize.max, children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: - Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allOffTime[0] + ['code'], + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model2.allOffTime .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + item[ + 'description'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], ); - }).toList(), - ))), - ), + }).toList(); + }, + onChanged: (newValue) => {}, + items: model2.allOffTime + .map((item) { + return DropdownMenuItem< + String>( + value: item['code'] + .toString(), + child: Text( + item['description'], + textAlign: + TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of(context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + addSickLeave.startDate = value; + }), + ], + )), + + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + new AppTextFormField( + readOnly: true, + hintText: "", + borderColor: Colors.white, + onSaved: (value) {}, + inputFormatter: ONLY_NUMBERS), + ], + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + new AppTextFormField( + readOnly: true, + hintText: "", + borderColor: Colors.white, + onSaved: (value) {}, + inputFormatter: ONLY_NUMBERS), + ], + ), + ), + ) + ], + ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2.allReasons[0] + ['id'] + .toString(), + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model2.allReasons + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + projectsProvider + .isArabic + ? item[ + 'nameAr'] + : item[ + 'nameEn'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model2.allReasons + .map((item) { + return DropdownMenuItem< + String>( + value: item['id'] + .toString(), + child: Text( + projectsProvider + .isArabic + ? item['nameAr'] + : item['nameEn'], + textAlign: + TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), ], ) ], ), )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: model2 + .coveringDoctors[0] + ['doctorID'] + .toString(), + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model2 + .coveringDoctors + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + projectsProvider + .isArabic + ? item[ + 'doctorNameN'] + : item[ + 'doctorName'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => {}, + items: model2 + .coveringDoctors + .map((item) { + return DropdownMenuItem< + String>( + value: item['doctorID'] + .toString(), + child: Text( + projectsProvider + .isArabic + ? item[ + 'doctorNameN'] + : item[ + 'doctorName'], + textAlign: + TextAlign.start, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), + )), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), @@ -307,9 +564,9 @@ class _RescheduleLeaveScreen extends State { } getClinicName(model) { - var clinicInfo = model.clinicsList - .where((i) => i['ClinicID'] == this.profile['ClinicID']) - .toList(); + var clinicID = this.profile != null ? this.profile['ClinicID'] : 1; + var clinicInfo = + model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index ed6b49e8..6126912e 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -424,6 +424,12 @@ class TranslationBase { String get sao2 => localizedValues['sao2'][locale.languageCode]; String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get holiday => localizedValues['holiday'][locale.languageCode]; + String get to => localizedValues['to'][locale.languageCode]; + String get coveringDoctor => + localizedValues['coveringDoctor'][locale.languageCode]; + String get requestLeave => + localizedValues['requestLeave'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 4ff72904..808e09dc 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -35,9 +35,6 @@ class _AppDrawerState extends State { // _isInit = false; // } - - - @override Widget build(BuildContext context) { AuthViewModel authProvider = Provider.of(context); @@ -68,20 +65,24 @@ class _AppDrawerState extends State { ), ), SizedBox(height: 15), - CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: - NetworkImage(authProvider.doctorProfile.doctorImageURL), - backgroundColor: Colors.white, - ), - Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - authProvider.doctorProfile?.doctorName, - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )), + authProvider.doctorProfile != null + ? CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + backgroundImage: NetworkImage( + authProvider.doctorProfile.doctorImageURL), + backgroundColor: Colors.white, + ) + : SizedBox(), + authProvider.doctorProfile != null + ? Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + authProvider.doctorProfile?.doctorName, + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: SizeConfig.textMultiplier * 2, + )) + : SizedBox(), AppText( "Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue. fontWeight: FontWeight.normal, @@ -121,7 +122,9 @@ class _AppDrawerState extends State { ), InkWell( child: DrawerItem( - TranslationBase.of(context).qr+ TranslationBase.of(context).reader, DoctorApp.qr_code), + TranslationBase.of(context).qr + + TranslationBase.of(context).reader, + DoctorApp.qr_code), onTap: () { Navigator.pop(context); Navigator.of(context).pushNamed(QR_READER); From 93c0bdf32a7e4525742c9fdd89ba288868e76648 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Fri, 1 Jan 2021 14:26:56 +0200 Subject: [PATCH 103/421] return login --- lib/client/base_app_client.dart | 37 +++--- lib/root_page.dart | 2 +- lib/screens/dashboard_screen.dart | 125 +++++++++--------- .../profile/profile-welcome-widget.dart | 7 +- 4 files changed, 82 insertions(+), 89 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index c68f9522..ff9d957d 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -36,21 +36,20 @@ class BaseAppClient { }) async { String url = BASE_URL + endPoint; try { - //TODO change it edit By Jammal - // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - // String token = await sharedPref.getString(TOKEN); - // if (profile != null) { - // DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - // if (body['DoctorID'] == null) - body['DoctorID'] = 4709;//doctorProfile?.doctorID; - body['EditedBy'] = 4709;//doctorProfile?.doctorID; - //if (body['ProjectID'] == null) { - body['ProjectID'] = 15;//doctorProfile?.projectID; - // } - // if (body['ClinicID'] == null) - body['ClinicID'] = 1;//doctorProfile?.clinicID; - // } - body['TokenID'] = "@dm!n";//token ?? ''; + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + String token = await sharedPref.getString(TOKEN); + if (profile != null) { + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + if (body['DoctorID'] == null) + body['DoctorID'] = doctorProfile?.doctorID; + body['EditedBy'] = doctorProfile?.doctorID; + if (body['ProjectID'] == null) { + body['ProjectID'] = doctorProfile?.projectID; + } + if (body['ClinicID'] == null) + body['ClinicID'] = doctorProfile?.clinicID; + } + body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') body['LanguageID'] = 1; @@ -64,11 +63,9 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1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UlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU"; - //await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/root_page.dart b/lib/root_page.dart index 0f44dc4d..fe35a246 100644 --- a/lib/root_page.dart +++ b/lib/root_page.dart @@ -22,7 +22,7 @@ class RootPage extends StatelessWidget { ); break; case APP_STATUS.UNAUTHENTICATED: - return LandingPage(); + return Loginsreen(); break; case APP_STATUS.AUTHENTICATED: return LandingPage(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c55b5afa..b6bbc6cf 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -115,69 +115,68 @@ class _DashboardScreenState extends State { SizedBox( height: 4, ), - //TODO change it edit By Jammal - // InkWell( - // onTap: () async { - // showCupertinoPicker( - // decKey: '', - // context: context, - // actionList: projectsProvider - // .doctorClinicsList); - // }, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Container( - // child: AppText( - // authProvider.selectedClinicName != - // null - // ? authProvider - // .selectedClinicName - // : authProvider.doctorProfile - // .clinicDescription, - // fontSize: - // SizeConfig.textMultiplier * - // 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // alignment: projectsProvider.isArabic - // ? Alignment.topRight - // : Alignment.topLeft, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.max, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // InkWell( - // child: Container( - // margin: EdgeInsets.only( - // left: 5, - // top: projectsProvider - // .isArabic - // ? 0 - // : 5, - // right: 10, - // bottom: projectsProvider - // .isArabic - // ? 15 - // : 7), - // child: Icon( - // DoctorApp.sync_icon, - // color: Colors.white, - // size: SizeConfig - // .textMultiplier * - // 1.8, - // )), - // ), - // ], - // ), - // ]), - // ), + InkWell( + onTap: () async { + showCupertinoPicker( + decKey: '', + context: context, + actionList: projectsProvider + .doctorClinicsList); + }, + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + child: AppText( + authProvider.selectedClinicName != + null + ? authProvider + .selectedClinicName + : authProvider.doctorProfile + .clinicDescription, + fontSize: + SizeConfig.textMultiplier * + 1.7, + color: Colors.white, + textAlign: TextAlign.center, + ), + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + InkWell( + child: Container( + margin: EdgeInsets.only( + left: 5, + top: projectsProvider + .isArabic + ? 0 + : 5, + right: 10, + bottom: projectsProvider + .isArabic + ? 15 + : 7), + child: Icon( + DoctorApp.sync_icon, + color: Colors.white, + size: SizeConfig + .textMultiplier * + 1.8, + )), + ), + ], + ), + ]), + ), ], ), ]), diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 90141080..fae705f4 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -43,8 +43,7 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - //TODO change it edit By Jammal - 'Dr. ',//${authProvider.doctorProfile.doctorName}', + 'Dr. ${authProvider.doctorProfile.doctorName}', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.white, @@ -72,9 +71,7 @@ final double height; height: 50, width: 60, child: Image.network( - //TODO change it edit By Jammal - 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__340.jpg' - // authProvider.doctorProfile.doctorImageURL, + authProvider.doctorProfile.doctorImageURL, // fit: BoxFit.fill, ), ), From 3cadd532d8cd61f21126fd9c813ac05634360e3f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 1 Jan 2021 16:38:59 +0200 Subject: [PATCH 104/421] finish Updating --- lib/core/service/SOAP_service.dart | 12 +- lib/core/viewModel/SOAP_view_model.dart | 37 +-- lib/models/SOAP/GetAssessmentReqModel.dart | 40 +++ lib/models/SOAP/GetAssessmentResModel.dart | 72 +++++ .../subjective/update_subjective_page.dart | 73 ++--- .../soap_update/update_assessment_page.dart | 296 +++++++++++------- .../soap_update/update_objective_page.dart | 9 +- 7 files changed, 341 insertions(+), 198 deletions(-) create mode 100644 lib/models/SOAP/GetAssessmentReqModel.dart create mode 100644 lib/models/SOAP/GetAssessmentResModel.dart diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 09530d50..426e0811 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; @@ -27,6 +29,7 @@ class SOAPService extends LookupService { List patientHistoryList = []; List patientPhysicalExamList = []; List patientProgressNoteList = []; + List patientAssessmentList = []; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( @@ -266,6 +269,7 @@ class SOAPService extends LookupService { response['ProgressNoteList']['entityList'].forEach((v) { patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v)); }); + }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; @@ -273,14 +277,18 @@ class SOAPService extends LookupService { } Future getPatientAssessment( - PostAssessmentRequestModel getPatientAssessmentRequestModel) async { + GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; await baseAppClient.post (GET_ASSESSMENT, onSuccess: (dynamic response, int statusCode) { print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: getPatientAssessmentRequestModel.toJson()); + }, body: getAssessmentReqModel.toJson()); } } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 8d03a04e..697e9934 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintR import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; @@ -64,14 +66,19 @@ class SOAPViewModel extends BaseViewModel { List get patientAllergiesList => _SOAPService.patientAllergiesList; + List get patientHistoryList => _SOAPService.patientHistoryList; - List get patientPhysicalExamList => + + List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; + List get patientAssessmentList => + _SOAPService.patientAssessmentList; + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); @@ -266,9 +273,9 @@ class SOAPViewModel extends BaseViewModel { } Future getPatientAssessment( - PostAssessmentRequestModel getPatientAssessmentRequestModel) async { + GetAssessmentReqModel getAssessmentReqModel) async { setState(ViewState.Busy); - await _SOAPService.getPatientAssessment(getPatientAssessmentRequestModel); + await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; setState(ViewState.Busy); @@ -276,14 +283,12 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - // ignore: missing_return MasterKeyModel getOneMasterKey( - {@required MasterKeysService masterKeys, int id, int typeId}) { + {@required MasterKeysService masterKeys, dynamic id, int typeId}) { switch (masterKeys) { case MasterKeysService.Allergies: List result = allergiesList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -294,7 +299,6 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.HistoryFamily: List result = historyFamilyList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -304,7 +308,6 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistoryMedical: List result = historyMedicalList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -314,7 +317,6 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySocial: List result = historySocialList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -324,7 +326,6 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySports: List result = historySocialList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -334,17 +335,13 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.HistorySurgical: List result = historySurgicalList.where((element) { - print(element.id == id); - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); - }).toList(); + return element.id == id;}).toList(); if (result.isNotEmpty) { return result.first; } break; case MasterKeysService.PhysicalExamination: List result = physicalExaminationList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -354,7 +351,6 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.AllergySeverity: List result = allergySeverityList.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -371,7 +367,6 @@ class SOAPViewModel extends BaseViewModel { case MasterKeysService.DiagnosisType: List result = listOfDiagnosisType.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -381,7 +376,6 @@ class SOAPViewModel extends BaseViewModel { break; case MasterKeysService.DiagnosisCondition: List result = listOfDiagnosisCondition.where((element) { - print(element.id == id); return element.id == id && element.typeId == masterKeys.getMasterKeyService(); }).toList(); @@ -390,11 +384,8 @@ class SOAPViewModel extends BaseViewModel { } break; case MasterKeysService.ICD10: - listOfICD10.clear(); List result = listOfICD10.where((element) { - print(element.id == id); - return element.id == id && - element.typeId == masterKeys.getMasterKeyService(); + return element.code == id ; }).toList(); if (result.isNotEmpty) { return result.first; diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart new file mode 100644 index 00000000..1085bf8c --- /dev/null +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -0,0 +1,40 @@ +class GetAssessmentReqModel { + int patientMRN; + int appointmentNo; + String episodeID; + String from; + String to; + int clinicID; + int doctorID; + + GetAssessmentReqModel( + {this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.doctorID}); + + GetAssessmentReqModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + from = json['From']; + to = json['To']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['From'] = this.from; + data['To'] = this.to; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + return data; + } +} diff --git a/lib/models/SOAP/GetAssessmentResModel.dart b/lib/models/SOAP/GetAssessmentResModel.dart new file mode 100644 index 00000000..4d1b1b68 --- /dev/null +++ b/lib/models/SOAP/GetAssessmentResModel.dart @@ -0,0 +1,72 @@ +class GetAssessmentResModel { + int appointmentNo; + String asciiDesc; + String clinicDescription; + int clinicID; + bool complexDiagnosis; + int conditionID; + int createdBy; + String createdOn; + int diagnosisTypeID; + int doctorID; + String doctorName; + int episodeId; + String icdCode10ID; + int patientMRN; + String remarks; + + GetAssessmentResModel( + {this.appointmentNo, + this.asciiDesc, + this.clinicDescription, + this.clinicID, + this.complexDiagnosis, + this.conditionID, + this.createdBy, + this.createdOn, + this.diagnosisTypeID, + this.doctorID, + this.doctorName, + this.episodeId, + this.icdCode10ID, + this.patientMRN, + this.remarks}); + + GetAssessmentResModel.fromJson(Map json) { + appointmentNo = json['appointmentNo']; + asciiDesc = json['ascii_Desc']; + clinicDescription = json['clinicDescription']; + clinicID = json['clinicID']; + complexDiagnosis = json['complexDiagnosis']; + conditionID = json['conditionID']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + diagnosisTypeID = json['diagnosisTypeID']; + doctorID = json['doctorID']; + doctorName = json['doctorName']; + episodeId = json['episodeId']; + icdCode10ID = json['icdCode10ID']; + patientMRN = json['patientMRN']; + remarks = json['remarks']; + } + + Map toJson() { + final Map data = new Map(); + data['appointmentNo'] = this.appointmentNo; + data['ascii_Desc'] = this.asciiDesc; + data['clinicDescription'] = this.clinicDescription; + data['clinicID'] = this.clinicID; + data['complexDiagnosis'] = this.complexDiagnosis; + data['conditionID'] = this.conditionID; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['diagnosisTypeID'] = this.diagnosisTypeID; + data['doctorID'] = this.doctorID; + data['doctorName'] = this.doctorName; + data['episodeId'] = this.episodeId; + data['icdCode10ID'] = this.icdCode10ID; + data['patientMRN'] = this.patientMRN; + data['remarks'] = this.remarks; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 1339c2f2..2236098a 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -50,28 +50,12 @@ class _UpdateSubjectivePageState extends State { TextEditingController complaintsController = TextEditingController(); final formKey = GlobalKey(); getHistory(SOAPViewModel model) async{ - GetHistoryReqModel getHistoryMedicalReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - historyType: - MasterKeysService.HistoryMedical.getMasterKeyService()); - GetHistoryReqModel getHistorySportsReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - historyType: - MasterKeysService.HistorySports.getMasterKeyService()); - GetHistoryReqModel getHistorySurgicalReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - historyType: - MasterKeysService.HistorySurgical.getMasterKeyService()); - GetHistoryReqModel getHistoryFamilyReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - historyType: - MasterKeysService.HistoryFamily.getMasterKeyService()); - await model.getPatientHistories(getHistoryMedicalReqModel); - await model.getPatientHistories(getHistorySportsReqModel); - await model.getPatientHistories(getHistorySurgicalReqModel); - await model.getPatientHistories(getHistoryFamilyReqModel); + GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( + patientMRN: widget.patientInfo.patientMRN, + ); + await model.getPatientHistories(getHistoryReqModel); - if(model.patientHistoryList.isNotEmpty) { + if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { await model.getMasterLookup(MasterKeysService.HistoryFamily); } @@ -390,41 +374,27 @@ class _UpdateSubjectivePageState extends State { await postChiefComplaint(model: model); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); - } else { - if (myHistoryList.length != 0) { - await postHistories(model: model, myHistoryList: myHistoryList); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } else { - widget.changePageViewIndex(1); - } - } - } else { - if (myAllergiesList.length != 0) { - await postAllergy(myAllergiesList: myAllergiesList, model: model); - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(1); - } - } else { - widget.changePageViewIndex(1); - } + } + + if (myHistoryList.length != 0) { + await postHistories(model: model, myHistoryList: myHistoryList); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } + } + if (myAllergiesList.length != 0) { + await postAllergy(myAllergiesList: myAllergiesList, model: model); + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); } } + + widget.changePageViewIndex(1); + } else { helpers.showErrorToast('Please add required field correctly'); } - widget.changePageViewIndex(1); } @@ -487,13 +457,12 @@ class _UpdateSubjectivePageState extends State { }); - if (model.patientAllergiesList.isEmpty) { + if (model.patientHistoryList.isEmpty) { await model.postHistories(postHistoriesRequestModel); } else { await model.patchHistories(postHistoriesRequestModel); } - await model.patchHistories(postHistoriesRequestModel); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 61c7f20b..c25b0d5b 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; @@ -36,19 +37,53 @@ class UpdateAssessmentPage extends StatefulWidget { class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; - - List assessmentList; - dynamic _referTo; - - TextEditingController remarksController = TextEditingController(); - @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) async{ + + widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo; + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); + await model.getPatientAssessment(getAssessmentReqModel); + if(model.patientAssessmentList.isNotEmpty){ + if (model.listOfDiagnosisCondition.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (model.listOfDiagnosisType.length == 0) { + await model.getMasterLookup(MasterKeysService.DiagnosisType); + } + if (model.listOfICD10.length == 0) { + await model.getMasterLookup(MasterKeysService.ICD10); + } + + MasterKeyModel selectedICD = model.getOneMasterKey( + masterKeys: MasterKeysService.ICD10, + id: model.patientAssessmentList[0].icdCode10ID, + ); + widget.mySelectedAssessment.selectedICD= selectedICD; + MasterKeyModel diagnosisCondition = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisCondition, + id: model.patientAssessmentList[0].conditionID, + ); + + widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition; + MasterKeyModel diagnosisType = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisType, + id: model.patientAssessmentList[0].diagnosisTypeID, + ); + + widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType; + widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks; + } + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, + baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -58,66 +93,67 @@ class _UpdateAssessmentPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts('ASSESSMENT', - variant: + Row( + children: [ + Texts('ASSESSMENT', + variant: isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) + bold: isAssessmentExpand ? true : false, + color: Colors.black), + Icon( + FontAwesomeIcons.asterisk, + color: AppGlobal.appPrimaryColor, + size: 12, + ) + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: + bodyWidget: Column(children: [ + SizedBox( + height: 20, + ), + Column( + children: [ + Container( + margin: EdgeInsets.only(left: 5, right: 5, top: 15), - child: TextFields( - hintText: "Add ASSESSMENT", - fontSize: 13.5, - onTapTextFields: () { - openAssessmentDialog(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), + child: TextFields( + hintText: "Add ASSESSMENT", + fontSize: 13.5, + onTapTextFields: () { + openAssessmentDialog(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal + .appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), ), SizedBox( height: 20, @@ -242,7 +278,7 @@ class _UpdateAssessmentPageState extends State { height: 6, ), AppText( - widget.mySelectedAssessment.remark, + widget.mySelectedAssessment.remark??"", fontSize: 10, color: Colors.grey, ), @@ -263,7 +299,7 @@ class _UpdateAssessmentPageState extends State { fontSize: 16, ), AppText( - "R07.1".toUpperCase(), + widget.mySelectedAssessment.selectedICD.code.toUpperCase()??"", fontSize: 10, color: Colors.grey, ), @@ -291,44 +327,68 @@ class _UpdateAssessmentPageState extends State { isExpand: isAssessmentExpand, ), DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitAssessment(model); - }, - ), - SizedBox( - height: 30, + height: 30, + ), + AppButton( + title: TranslationBase + .of(context) + .next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + await submitAssessment(model); + }, + ), + SizedBox( + height: 30, + ), + ], ), - ], + ), ), - ), - ), - ))); + ))); } submitAssessment(SOAPViewModel model) async { if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null) { - PatchAssessmentReqModel patchAssessmentReqModel = - new PatchAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: "1", - prevIcdCode10ID: "1" - ); + widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) { + + if(model.patientAssessmentList.isEmpty){ + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: widget.mySelectedAssessment.selectedICD.code) + ]); + + await model.postAssessment(postAssessmentRequestModel); + } else { + PatchAssessmentReqModel patchAssessmentReqModel = + PatchAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: widget.mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + widget.mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + widget.mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: widget.mySelectedAssessment.selectedICD.code, + prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID + ); + + await model.patchAssessment(patchAssessmentReqModel); + } - await model.patchAssessment(patchAssessmentReqModel); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); @@ -363,9 +423,9 @@ class _UpdateAssessmentPageState extends State { class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; final Function() addSelectedAssessment; - + final PatiantInformtion patientInfo; const AddAssessmentDetails( - {Key key, this.mySelectedAssessment, this.addSelectedAssessment}) + {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo}) : super(key: key); @override @@ -376,13 +436,13 @@ class _AddAssessmentDetailsState extends State { // MasterKeyModel _selectedDiagnosisCondition; // MasterKeyModel _selectedDiagnosisType; TextEditingController remarkController = TextEditingController(); - TextEditingController appointmentIdController = TextEditingController( - text: "234567"); + TextEditingController appointmentIdController = TextEditingController(); GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { remarkController.text = widget.mySelectedAssessment.remark??""; + appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); final screenSize = MediaQuery .of(context) .size; @@ -644,7 +704,7 @@ class _AddAssessmentDetailsState extends State { class PatchAssessmentReqModel { int patientMRN; int appointmentNo; - int episodeId; + int episodeID; String icdcode10Id; String prevIcdCode10ID; int conditionId; @@ -655,7 +715,7 @@ class PatchAssessmentReqModel { PatchAssessmentReqModel( {this.patientMRN, this.appointmentNo, - this.episodeId, + this.episodeID, this.icdcode10Id, this.prevIcdCode10ID, this.conditionId, @@ -664,28 +724,28 @@ class PatchAssessmentReqModel { this.remarks}); PatchAssessmentReqModel.fromJson(Map json) { - patientMRN = json['patientMRN']; - appointmentNo = json['appointmentNo']; - episodeId = json['episodeId']; - icdcode10Id = json['icdcode10Id']; - prevIcdCode10ID = json['prevIcdCode10ID']; - conditionId = json['conditionId']; - diagnosisTypeId = json['diagnosisTypeId']; - complexDiagnosis = json['complexDiagnosis']; - remarks = json['remarks']; + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + icdcode10Id = json['Icdcode10Id']; + prevIcdCode10ID = json['PrevIcdCode10ID']; + conditionId = json['ConditionId']; + diagnosisTypeId = json['DiagnosisTypeId']; + complexDiagnosis = json['ComplexDiagnosis']; + remarks = json['Remarks']; } Map toJson() { final Map data = new Map(); - data['patientMRN'] = this.patientMRN; - data['appointmentNo'] = this.appointmentNo; - data['episodeId'] = this.episodeId; - data['icdcode10Id'] = this.icdcode10Id; - data['prevIcdCode10ID'] = this.prevIcdCode10ID; - data['conditionId'] = this.conditionId; - data['diagnosisTypeId'] = this.diagnosisTypeId; - data['complexDiagnosis'] = this.complexDiagnosis; - data['remarks'] = this.remarks; + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['Icdcode10Id'] = this.icdcode10Id; + data['PrevIcdCode10ID'] = this.prevIcdCode10ID; + data['ConditionId'] = this.conditionId; + data['DiagnosisTypeId'] = this.diagnosisTypeId; + data['ComplexDiagnosis'] = this.complexDiagnosis; + data['Remarks'] = this.remarks; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 55be0be6..2a342542 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -84,8 +84,7 @@ class _UpdateObjectivePageState extends State { }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - //TODO: retrun it back - // baseViewModel: model, + baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -379,7 +378,11 @@ class _UpdateObjectivePageState extends State { )); }); - await model.patchPhysicalExam(postPhysicalExamRequestModel); + if(model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); + } else { + await model.patchPhysicalExam(postPhysicalExamRequestModel); + } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From f8b195e368e787a4db77d835439a11d1e49cc38e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 1 Jan 2021 17:03:59 +0200 Subject: [PATCH 105/421] parseHtmlString now working :) --- lib/util/helpers.dart | 8 ++++++++ .../subjective/update_subjective_page.dart | 8 +++++--- .../profile/soap_update/update_plan_page.dart | 4 ++-- pubspec.lock | 14 ++++++++++++++ pubspec.yaml | 3 +++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index c1d70cef..4725ca9f 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:html/parser.dart'; import '../config/size_config.dart'; import '../util/dr_app_toast_msg.dart'; @@ -352,4 +353,11 @@ class Helpers { // TODO Fix it // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } + + String parseHtmlString(String htmlString) { + final document = parse(htmlString); + final String parsedString = parse(document.body.text).documentElement.text; + + return parsedString; + } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 2236098a..84c0734a 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -24,6 +24,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:html/parser.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -96,7 +97,8 @@ class _UpdateSubjectivePageState extends State { } @override Widget build(BuildContext context) { - return BaseView( + + return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: widget.patientInfo.patientMRN, @@ -110,8 +112,8 @@ class _UpdateSubjectivePageState extends State { episodeID: widget.patientInfo.episodeNo); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { - complaintsController.text = - model.patientChiefComplaintList[0].chiefComplaint; + complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint) + ; illnessController.text = model.patientChiefComplaintList[0].hopi; } await model.getPatientAllergy(generalGetReqForSOAP); diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 506ff103..d5ad12e9 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -63,8 +63,8 @@ class _UpdatePlanPageState extends State { await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { - progressNoteController.text = - model.patientProgressNoteList[0].planNote; + progressNoteController.text = helpers + .parseHtmlString(model.patientProgressNoteList[0].planNote); } }, builder: (_, model, w) => AppScaffold( diff --git a/pubspec.lock b/pubspec.lock index c6829dad..61cc667f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -239,6 +239,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.5" + csslib: + dependency: transitive + description: + name: csslib + url: "https://pub.dartlang.org" + source: hosted + version: "0.16.2" cupertino_icons: dependency: "direct main" description: @@ -385,6 +392,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.6" + html: + dependency: "direct main" + description: + name: html + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.0+4" http: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index e15a7182..91283a89 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -63,6 +63,9 @@ dependencies: #Autocomplete TextField autocomplete_textfield: ^1.7.3 + # Html + html: ^0.14.0+4 + #speech to text From b60bac6d6e49af0c04d5f9c0b5781a1de99df4fc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Fri, 1 Jan 2021 19:31:16 +0200 Subject: [PATCH 106/421] working on UCAF design --- lib/config/localized_values.dart | 13 + .../profile/UCAF/UCAF-input-screen.dart | 407 +++++++++++++++++- lib/util/translations_delegate_base.dart | 13 + .../profile/profile_medical_info_widget.dart | 40 +- 4 files changed, 454 insertions(+), 19 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 453cef8f..c27e8b70 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -402,4 +402,17 @@ const Map> localizedValues = { 'save': {'en': "SAVE", 'ar': 'حفظ'}, 'postPlansEstimatedCost': {'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, + 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, + 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, + 'chiefComplaintsAndSymptoms': {'en': "CHIEF COMPLAINTS & OTHER SYMPTOMS", 'ar': 'شكاوى الرئيس وأعراض أخرى'}, + 'patientFeelsPainInHisBackAndCough': {'en': "Patient Feels pain in his back and cough", 'ar': 'يشعر المريض بألم في ظهره ويسعل'}, + 'additionalTextComplaints': {'en': "Additional text to add about Complaints", 'ar': 'نص إضافي لإضافته حول الشكاوى'}, + 'otherConditions': {'en': "OTHER CONDITIONS", 'ar': 'شروط أخرى'}, + 'other': {'en': "Other", 'ar': 'أخرى'}, + 'how': {'en': "How", 'ar': 'كيف'}, + 'when': {'en': "When", 'ar': 'متى'}, + 'where': {'en': "Where", 'ar': 'أين'}, + 'specifyPossibleLineManagement': {'en': "Specify possible line of management", 'ar': 'حدد خط الإدارة المحتمل'}, + 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, + 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, }; diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index f48fadb0..82b01144 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -1,9 +1,16 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; class UCAFInputScreen extends StatefulWidget { @override @@ -11,6 +18,33 @@ class UCAFInputScreen extends StatefulWidget { } class _UCAFInputScreenState extends State { + bool _inPatient = false; + bool _emergencyCase = false; + final _durationOfIllnessController = TextEditingController(); + final _additionalComplaintsController = TextEditingController(); + final _otherController = TextEditingController(); + final _howController = TextEditingController(); + final _whenController = TextEditingController(); + final _whereController = TextEditingController(); + final _managementsLineController = TextEditingController(); + final _signsController = TextEditingController(); + List conditionsData = [ + {"name": "CHRONIC", "isChecked": false}, + {"name": "RTA", "isChecked": false}, + {"name": "PSYCHIATRIC", "isChecked": false}, + {"name": "WORK RELATED", "isChecked": false}, + {"name": "VACCINATION", "isChecked": false}, + {"name": "CONGENITAL", "isChecked": false}, + {"name": "INFERTILITY", "isChecked": false}, + {"name": "CHECK-UP", "isChecked": false}, + {"name": "PREGNANCY/INDICATE MP", "isChecked": false}, + {"name": "CLEANING", "isChecked": false}, + {"name": "ORTHO DONTICS", "isChecked": false}, + {"name": "SPORTS RELATED", "isChecked": false}, + {"name": "REGULAR DENTAL TREATMENT", "isChecked": false}, + {"name": "IS TRAUMA TREATMENT SPECIFY ETA", "isChecked": false}, + ]; + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -21,8 +55,379 @@ class _UCAFInputScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, - body: Container(), + body: SingleChildScrollView( + child: Column( + children: [ + PatientHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CheckboxListTile( + title: AppText( + TranslationBase.of(context).inPatient, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _inPatient, + onChanged: (newValue) { + setState(() { + _inPatient = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context).emergencyCase, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _emergencyCase, + onChanged: (newValue) { + setState(() { + _emergencyCase = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).durationOfIllness, + null, + false), + enabled: true, + controller: _durationOfIllnessController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "BP (H/L)", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "120/80", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "37.5(C), 98.6(F)", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).pulseBeats} :", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "80", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).chiefComplaintsAndSymptoms, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 8, + ), + AppText( + TranslationBase.of(context) + .patientFeelsPainInHisBackAndCough, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).additionalTextComplaints, + null, + false), + enabled: true, + controller: _additionalComplaintsController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).otherConditions, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ...List.generate( + conditionsData.length, + (index) => CheckboxListTile( + title: AppText( + conditionsData[index]['name'], + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: conditionsData[index]['isChecked'], + onChanged: (newValue) { + setState(() { + conditionsData[index]['isChecked'] = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + )), + SizedBox( + height: 8, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).other, + null, + false), + enabled: true, + controller: _otherController, + keyboardType: TextInputType.text, + )), + SizedBox( + height: 8, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).how, + null, + false), + enabled: true, + controller: _howController, + keyboardType: TextInputType.text, + )), + SizedBox( + height: 8, + ), + Row( + children: [ + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).when, + null, + false), + enabled: true, + controller: _whenController, + keyboardType: TextInputType.text, + )), + ), + SizedBox( + width: 4, + ), + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).where, + null, + false), + enabled: true, + controller: _whereController, + keyboardType: TextInputType.text, + )), + ), + ], + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).specifyPossibleLineManagement, + null, + false), + enabled: true, + controller: _managementsLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context) + .significantSigns, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).backAbdomen, + null, + false), + enabled: true, + controller: _signsController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: (){ + // Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient}); + }, + ), + ], + ), + ), + ], + ), + ), ), ); } } + +class PatientHeaderWidget extends StatelessWidget { + final PatiantInformtion patient; + + PatientHeaderWidget(this.patient); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + Row( + children: [ + AppText( + "VIP", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + SizedBox( + width: 8, + ), + AppText( + " ${patient.age}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + AppText( + "NEW VISIT", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "${patient.companyName}", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + ), + Icon( + Icons.info_outline, + color: Colors.black, + ), + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index a67463a0..213ad371 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -439,6 +439,19 @@ class TranslationBase { String get save => localizedValues['save'][locale.languageCode]; String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; + String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; + String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; + String get other => localizedValues['other'][locale.languageCode]; + String get how => localizedValues['how'][locale.languageCode]; + String get when => localizedValues['when'][locale.languageCode]; + String get where => localizedValues['where'][locale.languageCode]; + String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; + String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 3f7baf51..35f1e586 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -43,13 +43,16 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: "Episode", route: UPDATE_EPISODE, icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: PATIENT_VITAL_SIGN, - icon: 'heartbeat.png'), + Visibility( + visible: selectedPatientType == 6 || selectedPatientType == 7, + child: PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: PATIENT_VITAL_SIGN, + icon: 'heartbeat.png'), + ), PatientProfileButton( key: key, patient: patient, @@ -80,13 +83,16 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png')), - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ADMISSION_REQUEST, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'heartbeat.png'), + Visibility( + visible: selectedPatientType == 6 || selectedPatientType == 7, + child: PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), + ), // PatientProfileButton( // key: key, // patient: patient, @@ -109,9 +115,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: 'Or Procedures', icon: 'lab.png'), Visibility( - visible: selectedPatientType != 0 && - selectedPatientType != 5 && - selectedPatientType != 2, + visible: selectedPatientType == 6 || selectedPatientType == 7, child: PatientProfileButton( key: key, patient: patient, @@ -138,7 +142,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png')), Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, + visible: selectedPatientType == 6 || selectedPatientType == 7, child: PatientProfileButton( key: key, patient: patient, From 856777c648ccd9acff30c1bbfcff6c9887dba5c6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Fri, 1 Jan 2021 22:04:30 +0200 Subject: [PATCH 107/421] finish updating functions --- lib/models/SOAP/GetHistoryReqModel.dart | 29 ++++++++++++++++++- lib/routes.dart | 2 +- .../patients/profile/SOAP/add_SOAP_index.dart | 2 +- .../profile/patient-page-header-widget.dart | 2 +- .../{SOAP => soap_update}/steps_widget.dart | 0 .../subjective/update_subjective_page.dart | 2 ++ .../soap_update/update_soap_index.dart | 2 +- 7 files changed, 34 insertions(+), 5 deletions(-) rename lib/widgets/patients/profile/{SOAP => soap_update}/steps_widget.dart (100%) diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 9b852e9b..1df26690 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -1,18 +1,45 @@ class GetHistoryReqModel { int patientMRN; int historyType; + String episodeID; + String from; + String to; + int clinicID; + int doctorID; + int appointmentNo; - GetHistoryReqModel({this.patientMRN, this.historyType}); + GetHistoryReqModel( + {this.patientMRN, + this.historyType, + this.episodeID, + this.from, + this.to, + this.clinicID, + this.doctorID, + this.appointmentNo}); GetHistoryReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; historyType = json['HistoryType']; + episodeID = json['EpisodeID']; + from = json['From']; + to = json['To']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + appointmentNo = json['AppointmentNo']; + } Map toJson() { final Map data = new Map(); data['PatientMRN'] = this.patientMRN; data['HistoryType'] = this.historyType; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['From'] = this.from; + data['To'] = this.to; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/routes.dart b/lib/routes.dart index 1915a89d..b0dd4a7b 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -127,7 +127,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), - CREATE_EPISODE: (_) => AddSOAPIndex(), + CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), UPDATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart index 5a698af9..9b4d092d 100644 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'steps_widget.dart'; +import '../soap_update/steps_widget.dart'; class AddSOAPIndex extends StatefulWidget { final bool isUpdate; diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 1567487d..3e870be5 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -44,7 +44,7 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.firstName + ' ' + patient.lastName, + patient.firstName + ' ' + patient.lastName, color: Colors.black, fontWeight: FontWeight.bold, ), diff --git a/lib/widgets/patients/profile/SOAP/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart similarity index 100% rename from lib/widgets/patients/profile/SOAP/steps_widget.dart rename to lib/widgets/patients/profile/soap_update/steps_widget.dart diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 84c0734a..d9828795 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -53,6 +53,8 @@ class _UpdateSubjectivePageState extends State { getHistory(SOAPViewModel model) async{ GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo ); await model.getPatientHistories(getHistoryReqModel); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 744f5244..9e5dd82b 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/steps_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; From d1a261c847709ac66c7c149bede5233a5ddcac5a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 1 Jan 2021 22:09:53 +0200 Subject: [PATCH 108/421] procedure update --- lib/config/config.dart | 2 + lib/core/model/medical_file_model.dart | 2 +- .../model/medical_file_request_model.dart | 18 + lib/core/service/medical_file_service.dart | 29 ++ lib/core/service/procedure_service.dart | 19 +- .../viewModel/medical_file_view_model.dart | 26 ++ lib/core/viewModel/procedure_View_model.dart | 4 +- lib/locator.dart | 4 + lib/routes.dart | 9 +- .../medical-file/medical_file_details.dart | 428 ++++++++++++++++++ .../medical-file/medical_file_page.dart | 173 +++++++ .../prescription/prescription_screen.dart | 9 +- .../entity_list_checkbox_search_widget.dart | 133 +++--- lib/screens/procedures/procedure_screen.dart | 187 +++++--- .../profile/profile_medical_info_widget.dart | 17 +- 15 files changed, 902 insertions(+), 158 deletions(-) create mode 100644 lib/core/model/medical_file_request_model.dart create mode 100644 lib/core/service/medical_file_service.dart create mode 100644 lib/core/viewModel/medical_file_view_model.dart create mode 100644 lib/screens/medical-file/medical_file_details.dart create mode 100644 lib/screens/medical-file/medical_file_page.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 3e7d9ea7..fc7edf42 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -157,6 +157,8 @@ const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index 201c88f3..eb88f0d4 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -1,7 +1,7 @@ class MedicalFileModel { List entityList; int rowcount; - Null statusMessage; + dynamic statusMessage; MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); diff --git a/lib/core/model/medical_file_request_model.dart b/lib/core/model/medical_file_request_model.dart new file mode 100644 index 00000000..c5a40bb7 --- /dev/null +++ b/lib/core/model/medical_file_request_model.dart @@ -0,0 +1,18 @@ +class MedicalFileRequestModel { + int patientMRN; + String vidaAuthTokenID; + + MedicalFileRequestModel({this.patientMRN, this.vidaAuthTokenID}); + + MedicalFileRequestModel.fromJson(Map json) { + patientMRN = json['PatientMRN']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['PatientMRN'] = this.patientMRN; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/core/service/medical_file_service.dart b/lib/core/service/medical_file_service.dart new file mode 100644 index 00000000..0f6af46a --- /dev/null +++ b/lib/core/service/medical_file_service.dart @@ -0,0 +1,29 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_request_model.dart'; +import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + +class MedicalFileService extends BaseService { + List _medicalFileList = List(); + List get medicalFileList => _medicalFileList; + + MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( + patientMRN: 1231755, + vidaAuthTokenID: + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", + ); + + Future getMedicalFile() async { + hasError = false; + _medicalFileList.clear(); + await baseAppClient.post(GET_MEDICAL_FILE, + onSuccess: (dynamic response, int statusCode) { + _medicalFileList + .add(MedicalFileModel.fromJson(response['PatientFileList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _fileRequestModel.toJson()); + } +} diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index c7319eed..0152de24 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -73,18 +73,15 @@ class ProcedureService extends BaseService { }, body: postProcedureReqModel.toJson()); } - Future updateProcedure() async { + Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; _procedureList.clear(); - await baseAppClient.post( - GET_CATEGORISE_PROCEDURE, - onSuccess: (dynamic response, int statusCode) { - print("ACCEPTED"); - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - ); + await baseAppClient.post(UPDATE_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + print("ACCEPTED"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postProcedureReqModel.toJson()); } } diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart new file mode 100644 index 00000000..0ef21095 --- /dev/null +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -0,0 +1,26 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; +import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; + +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; + +class MedicalFileViewModel extends BaseViewModel { + bool hasError = false; + MedicalFileService _medicalFileService = locator(); + + List get medicalFileList => + _medicalFileService.medicalFileList; + + Future getMedicalFile() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _medicalFileService.getMedicalFile(); + if (_medicalFileService.hasError) { + error = _medicalFileService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index ab4deee1..da258e23 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -51,11 +51,11 @@ class ProcedureViewModel extends BaseViewModel { } } - Future updateProcedure() async { + Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(); + await _procedureService.updateProcedure(postProcedureReqModel); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); diff --git a/lib/locator.dart b/lib/locator.dart index 8bbf00b0..e6882ab3 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; +import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; @@ -45,6 +47,7 @@ void setupLocator() { locator.registerLazySingleton(() => PrescriptionService()); locator.registerLazySingleton(() => ProcedureService()); locator.registerLazySingleton(() => VitalSignsService()); + locator.registerLazySingleton(() => MedicalFileService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -60,4 +63,5 @@ void setupLocator() { locator.registerFactory(() => PrescriptionViewModel()); locator.registerFactory(() => ProcedureViewModel()); locator.registerFactory(() => VitalSignsViewModel()); + locator.registerFactory(() => MedicalFileViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index 1915a89d..c2264b66 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,5 +1,6 @@ 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/profile/insurance_approvals_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; @@ -71,7 +72,7 @@ const String SETTINGS = 'settings'; const String VITAL_SIGN = 'patients/vital-sign'; const String LAB_ORDERS = 'patients/lab_orders'; const String PRESCRIPTIONS = 'patients/prescription'; -const String RADIOLOGY = 'patients/radiology'; +const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; const String REFER_PATIENT = 'patients/refer-patient'; const String MY_REFERRAL_DETAIL = 'my_referral_detail'; @@ -119,7 +120,7 @@ var routes = { SERVICES: (_) => ServicesScreen(), LAB_ORDERS: (_) => LabOrdersScreen(), PRESCRIPTIONS: (_) => PrescriptionScreen(), - RADIOLOGY: (_) => RadiologyScreen(), + MEDICAL_FILE: (_) => MedicalFilePage(), PROGRESS_NOTE: (_) => ProgressNoteScreen(), REFER_PATIENT: (_) => ReferPatientScreen(), REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), @@ -128,7 +129,9 @@ var routes = { VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), CREATE_EPISODE: (_) => AddSOAPIndex(), - UPDATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), + UPDATE_EPISODE: (_) => UpdateSoapIndex( + isUpdate: true, + ), BODY_MEASUREMENTS: (_) => VitalSignItemDetailsScreen(), IN_PATIENT_PRESCRIPTIONS_DETAILS: (_) => InpatientPrescriptionDetailsScreen(), // VIDEO_CALL: (_) => VideoCallPage(patientData: null), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart new file mode 100644 index 00000000..4f966781 --- /dev/null +++ b/lib/screens/medical-file/medical_file_details.dart @@ -0,0 +1,428 @@ +import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.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/expandable-widget-header-body.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; + +class MedicalFileDetails extends StatefulWidget { + String age; + String firstName; + String lastName; + String gender; + MedicalFileDetails({this.age, this.firstName, this.lastName, this.gender}); + + @override + _MedicalFileDetailsState createState() => _MedicalFileDetailsState( + firstName: firstName, age: age, lastName: lastName, gender: gender); +} + +class _MedicalFileDetailsState extends State { + String age; + String firstName; + String lastName; + String gender; + + _MedicalFileDetailsState( + {this.age, this.firstName, this.lastName, this.gender}); + bool isPhysicalExam = false; + bool isProcedureExpand = false; + bool isHistoryExpand = false; + bool isAssessmentExpand = false; + + @override + Widget build(BuildContext context) { + return BaseView( + //onModelReady: (model) => model.getMedicalFile(), + builder: + (BuildContext context, MedicalFileViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'medical file'.toUpperCase(), + body: 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, + ), + ], + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Visit Date : ', + fontWeight: FontWeight.w700, + ), + AppText( + '23/12/2020', + ), + SizedBox(width: 35.0), + AppText( + 'Appt Date : ', + fontWeight: FontWeight.w700, + ), + AppText( + '23/12/2020', + ), + ], + ), + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, + ), + AppText( + 'Muhammad assad'.toUpperCase(), + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + 'Clinic : ', + fontWeight: FontWeight.w700, + ), + AppText( + 'Gastroenterology', + ), + ], + ), + Row( + children: [ + AppText( + 'Episode Number : ', + fontWeight: FontWeight.w700, + ), + AppText( + '200012334', + ), + ], + ), + SizedBox(height: 15.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ), + SizedBox(height: 25.0), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + 'History of present illness' + .toUpperCase(), + variant: + isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + Texts( + 'Ms J. K. is an 83 year old retired nurse with a long history of hypertension that was previously well controlled on diuretic therapy. She was first admitted to CPMC in 1995 when she presented with a complaint of intermittent midsternal chest pain.') + ], + ), + isExpand: isHistoryExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('assessment'.toUpperCase(), + variant: + isAssessmentExpand ? "bodyText" : '', + bold: isAssessmentExpand ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + Texts('ssss'), + ], + ), + isExpand: isAssessmentExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('Test / procedures'.toUpperCase(), + variant: + isProcedureExpand ? "bodyText" : '', + bold: isProcedureExpand ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + 'Exam Type : ', + fontWeight: FontWeight.w700, + ), + AppText( + '59', + ), + ], + ), + Row( + children: [ + AppText( + 'ABDOMEN', + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: FontWeight.w700, + ), + AppText( + 'no', + ), + ], + ), + SizedBox(height: 15.0), + Row( + children: [ + AppText( + 'Some short remark about the allergy', + fontWeight: FontWeight.w300, + ), + ], + ), + ], + ), + isExpand: isProcedureExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts('physical exam'.toUpperCase(), + variant: isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: Column( + children: [ + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + 'Exam Type : ', + fontWeight: FontWeight.w700, + ), + AppText( + '59', + ), + ], + ), + Row( + children: [ + AppText( + 'ABDOMEN', + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: FontWeight.w700, + ), + AppText( + 'no', + ), + ], + ), + SizedBox(height: 15.0), + Row( + children: [ + AppText( + 'Some short remark about the allergy', + fontWeight: FontWeight.w300, + ), + ], + ), + ], + ), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ), + ), + ), + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart new file mode 100644 index 00000000..44fee1be --- /dev/null +++ b/lib/screens/medical-file/medical_file_page.dart @@ -0,0 +1,173 @@ +import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_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/network_base_view.dart'; +import 'package:flutter/material.dart'; + +class MedicalFilePage extends StatefulWidget { + @override + _MedicalFilePageState createState() => _MedicalFilePageState(); +} + +class _MedicalFilePageState extends State { + PatiantInformtion patient; + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getMedicalFile(), + builder: + (BuildContext context, MedicalFileViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: 'medical Report'.toUpperCase(), + body: NetworkBaseView( + baseViewModel: model, + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 5.0, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: 2, + 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( + 'Branch : ', + fontWeight: FontWeight.w700, + ), + AppText( + model.medicalFileList[0].entityList[0] + .admissions[index].projectName, + ), + ], + ), + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, + ), + AppText( + model.medicalFileList[0].entityList[0] + .admissions[index].doctor + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ], + ), + Row( + children: [ + AppText( + 'Clinic : ', + fontWeight: FontWeight.w700, + ), + AppText( + model.medicalFileList[0].entityList[0] + .admissions[index].clinic, + ), + ], + ), + 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, + )), + ); + }, + ), + ); + }) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 2b1e5454..06a6a218 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -76,7 +76,7 @@ class _NewPrescriptionScreenState extends State { Row( children: [ AppText( - TranslationBase.of(context).fileNo, + TranslationBase.of(context).age2, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -84,12 +84,17 @@ class _NewPrescriptionScreenState extends State { width: 5.0, ), AppText( - patient.patientId.toString(), + patient.age.toString(), color: Colors.black, fontWeight: FontWeight.normal, ), ], ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), ], ) ], diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index b9962d27..78f584f6 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -20,19 +20,21 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { EntityListCheckboxSearchWidget( {Key key, - this.model, - this.addSelectedHistories, - this.removeHistory, - this.masterList, - this.addHistory, - this.isEntityListSelected}) + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isEntityListSelected}) : super(key: key); @override - _EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState(); + _EntityListCheckboxSearchWidgetState createState() => + _EntityListCheckboxSearchWidgetState(); } -class _EntityListCheckboxSearchWidgetState extends State { +class _EntityListCheckboxSearchWidgetState + extends State { List items = List(); @override @@ -49,75 +51,70 @@ class _EntityListCheckboxSearchWidgetState extends State dummyListData = List(); dummySearchList.forEach((item) { - if (item.procedureName.toLowerCase().contains(query.toLowerCase()) ) { + if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { dummyListData.add(item); } }); @@ -145,4 +142,4 @@ class _EntityListCheckboxSearchWidgetState extends State { Row( children: [ AppText( - TranslationBase.of(context).fileNo, + TranslationBase.of(context).age2, color: Colors.black, fontWeight: FontWeight.bold, ), @@ -86,12 +86,17 @@ class _ProcedureScreenState extends State { width: 5.0, ), AppText( - patient.patientId.toString(), + patient.age.toString(), color: Colors.black, fontWeight: FontWeight.normal, ), ], ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), ], ) ], @@ -268,7 +273,8 @@ class _ProcedureScreenState extends State { fontWeight: FontWeight .w700, - fontSize: 15.0, + fontSize: + 15.0, ), AppText( model @@ -278,7 +284,8 @@ class _ProcedureScreenState extends State { index] .procedureId .toString(), - fontSize: 13.0, + fontSize: + 13.0, ), SizedBox( width: 12.0, @@ -288,20 +295,23 @@ class _ProcedureScreenState extends State { fontWeight: FontWeight .w700, - fontSize: 15.0, + fontSize: + 15.0, ), AppText( 'Urgent', - fontSize: 13.0, - color: - Colors.red, + fontSize: + 13.0, + color: Colors + .red, ), ], ), Row( children: [ Container( - child: Expanded( + child: + Expanded( child: AppText( model @@ -349,7 +359,8 @@ class _ProcedureScreenState extends State { children: [ AppText( 'Some short remark about the procedure', - fontSize: 13.5, + fontSize: + 13.5, ), ], ), @@ -360,7 +371,8 @@ class _ProcedureScreenState extends State { Divider( height: 5.0, thickness: 1.0, - color: Colors.grey, + color: + Colors.grey, ) // SizedBox( // height: 40, @@ -372,7 +384,20 @@ class _ProcedureScreenState extends State { Container( child: Column( children: [ - Icon(Icons.edit) + InkWell( + child: Icon( + Icons.edit), + onTap: () { + updateProcedureForm( + context, + procedureName: model + .procedureList[ + 0] + .entityList[ + index] + .procedureName); + }, + ) ], ), ) @@ -423,6 +448,37 @@ postProcedure({ProcedureViewModel model}) async { } } +updateProcedure({ProcedureViewModel model, String remarks}) async { + PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); + List controls = List(); + List controlsProcedure = List(); + + updateProcedureReqModel.appointmentNo = 2016054575; + + updateProcedureReqModel.episodeID = 200012166; + updateProcedureReqModel.patientMRN = 3120725; + updateProcedureReqModel.vidaAuthTokenID = + 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; + + controls.add( + Controls( + code: remarks.isEmpty ? '' : remarks, + controlValue: 'Testing', + ), + ); + controlsProcedure.add( + Procedures(category: "02", procedure: "02011002", controls: controls)); + updateProcedureReqModel.procedures = controlsProcedure; + + await model.updateProcedure(updateProcedureReqModel); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been updated'); + } +} + void addSelectedProcedure(context, ProcedureViewModel model) { showModalBottomSheet( context: context, @@ -444,14 +500,14 @@ class AddSelectedProcedure extends StatefulWidget { class _AddSelectedProcedureState extends State { TextEditingController procedureController = TextEditingController(); - List entityList= List(); + List entityList = List(); @override Widget build(BuildContext context) { return NetworkBaseView( baseViewModel: widget.model, child: SingleChildScrollView( child: Container( - //height: 490, + height: 790, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -462,28 +518,28 @@ class _AddSelectedProcedureState extends State { fontWeight: FontWeight.w900, ), if (widget.model.categoriesList.length != 0) - EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model.categoriesList[0].entityList, - removeHistory: (item){ - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history){ - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: (){ - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => isEntityListSelected(master), - ), - + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ), SizedBox( - height: 0.0, + height: 15.0, ), Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, @@ -493,14 +549,19 @@ class _AddSelectedProcedureState extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Add Delected Procedures'.toUpperCase(), - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, + child: TextFields( + hintText: 'Order Type'.toUpperCase(), controller: procedureController, ), ), + SizedBox( + height: 15.0, + ), + TextFields( + hintText: 'Remarks', + minLines: 3, + maxLines: 5, + ), SizedBox( height: 80.0, ), @@ -510,7 +571,7 @@ class _AddSelectedProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).addMedication, + title: 'add Selected Procedures'.toUpperCase(), onPressed: () { Navigator.pop(context); postProcedure(model: widget.model); @@ -528,9 +589,10 @@ class _AddSelectedProcedureState extends State { ), ); } + bool isEntityListSelected(EntityList masterKey) { - Iterable history = - entityList.where((element) => masterKey.procedureId == element.procedureId); + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); if (history.length > 0) { return true; } @@ -538,15 +600,16 @@ class _AddSelectedProcedureState extends State { } } - - -void updateProcedureForm(context) { +void updateProcedureForm(context, {String procedureName}) { + ProcedureViewModel procedureViewModel = ProcedureViewModel(); + TextEditingController remarksController = TextEditingController(); + TextEditingController orderController = TextEditingController(); showModalBottomSheet( context: context, isScrollControlled: true, builder: (BuildContext bc) { return Container( - height: 500, + height: 400, child: Form( child: Padding( padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), @@ -554,8 +617,8 @@ void updateProcedureForm(context) { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Procedure Name'.toUpperCase(), - fontWeight: FontWeight.w900, + procedureName.toUpperCase(), + fontWeight: FontWeight.w700, ), SizedBox( height: 30.0, @@ -565,11 +628,9 @@ void updateProcedureForm(context) { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Order ', - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, + child: TextFields( + hintText: 'Order ', + controller: orderController, ), ), SizedBox( @@ -580,16 +641,15 @@ void updateProcedureForm(context) { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), - child: AppTextFormField( - labelText: 'Password', - borderColor: Colors.white, - textInputType: TextInputType.text, - inputFormatter: ONLY_LETTERS, - obscureText: true, + child: TextFields( + hintText: 'Remarks', + controller: remarksController, + maxLines: 5, + minLines: 3, ), ), SizedBox( - height: 190.0, + height: 100.0, ), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), @@ -597,9 +657,12 @@ void updateProcedureForm(context) { alignment: WrapAlignment.center, children: [ AppButton( - title: 'CONTINUE', + title: 'Update procedure'.toUpperCase(), onPressed: () { Navigator.pop(context); + updateProcedure( + model: procedureViewModel, + remarks: remarksController.text); // authorizationForm(context); }, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 96d7fa35..468a1b9d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -18,7 +18,6 @@ import 'PatientProfileButton.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { - ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); PatiantInformtion patient; @override @@ -57,17 +56,17 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), + // PatientProfileButton( + // key: key, + // patient: patient, + // route: PRESCRIPTIONS, + // nameLine1: TranslationBase.of(context).medicines, + // nameLine2: TranslationBase.of(context).prescription, + // icon: 'note.png'), PatientProfileButton( key: key, patient: patient, - route: PRESCRIPTIONS, - nameLine1: TranslationBase.of(context).medicines, - nameLine2: TranslationBase.of(context).prescription, - icon: 'note.png'), - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, + route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), From e23bb7ce94e7f05941d9894250cde97c56b2b85b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sat, 2 Jan 2021 14:59:43 +0300 Subject: [PATCH 109/421] reschedule leave --- lib/config/config.dart | 1 + lib/core/service/sickleave_service.dart | 16 + lib/core/viewModel/sick_leave_view_model.dart | 10 + .../reschedule-leaves/reschedule_leave.dart | 400 +++++++++++++----- pubspec.yaml | 2 +- 5 files changed, 330 insertions(+), 99 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 14ac4a0a..6b717ace 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -111,6 +111,7 @@ const EXTEND_SICK_LEAVE = 'Services/DoctorApplication.svc/REST/ExtendSickLeave'; const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; +const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; const GET_PRESCRIPTION_LIST = diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index cd0dbf50..1b9e12ac 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -170,4 +170,20 @@ class SickLeaveService extends BaseService { body: {"ClinicID": 1}, ); } + + addReschedule(request) async { + hasError = false; + + await baseAppClient.post( + ADD_RESCHDEULE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: request, + ); + } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 7c162ad1..bbcd55a6 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -95,4 +95,14 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future addReschedule(request) async { + setState(ViewState.Busy); + await _sickLeaveService.addReschedule(request); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 9ed6dae7..9ac2cf77 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -1,3 +1,4 @@ +import 'package:date_time_picker/date_time_picker.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; @@ -34,16 +35,24 @@ class RescheduleLeaveScreen extends StatefulWidget { class _RescheduleLeaveScreen extends State { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); TextEditingController _toDateController = new TextEditingController(); + TextEditingController _toDateController2 = new TextEditingController(); ProjectViewModel projectsProvider; String _selectedClinic; Map profile = {}; - AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); + var offTime = '2'; + var date; + var doctorID; + var reason; + var fromDate; + var toDate; + TextEditingController _controller4; + // AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { showDatePicker( context: context, initialDate: DateTime.now(), - firstDate: DateTime(2019), - lastDate: DateTime.now(), + firstDate: DateTime.now(), + lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { return; @@ -51,9 +60,16 @@ class _RescheduleLeaveScreen extends State { setState(() { // var selectedDate = DateFormat.yMd().format(pickedDate); final df = new DateFormat('yyyy-MM-dd'); - addSickLeave.startDate = df.format(pickedDate); - _toDateController.text = addSickLeave.startDate; + //addSickLeave.startDate; + + if (id == 'fromDate') { + fromDate = pickedDate; //df.format(); + _toDateController.text = df.format(pickedDate); + } else { + toDate = pickedDate; // + _toDateController2.text = df.format(pickedDate); + } //addSickLeave.startDate = selectedDate; }); }); @@ -223,8 +239,10 @@ class _RescheduleLeaveScreen extends State { child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2.allOffTime[0] - ['code'], + value: offTime == null + ? model2.allOffTime[0] + ['code'] + : offTime, iconSize: 40, elevation: 16, selectedItemBuilder: @@ -248,7 +266,18 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => {}, + onChanged: (newValue) => { + setState(() { + offTime = newValue; + }), + if (offTime == '1') + {model2.getReasons(18)} + else if (offTime == '2') + {model2.getReasons(19)} + else if (offTime == '3' || + offTime == '5') + {model2.getReasons(102)} + }, items: model2.allOffTime .map((item) { return DropdownMenuItem< @@ -270,88 +299,215 @@ class _RescheduleLeaveScreen extends State { ], ), )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of(context) - .fromDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - addSickLeave.startDate = value; - }), - ], - )), + offTime == '1' + ? Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of( + context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker( + 'fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + fromDate = value; + }), + ], + )), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // new AppTextFormField( + // readOnly: true, + // hintText: "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - new AppTextFormField( - readOnly: true, - hintText: "", - borderColor: Colors.white, - onSaved: (value) {}, - inputFormatter: ONLY_NUMBERS), - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - new AppTextFormField( - readOnly: true, - hintText: "", - borderColor: Colors.white, - onSaved: (value) {}, - inputFormatter: ONLY_NUMBERS), - ], - ), + DateTimePicker( + type: + DateTimePickerType.time, + controller: _controller4, + //initialValue: _initialValue, + // icon: Icon(Icons.access_time), + + //use24HourFormat: false, + //locale: Locale('en', 'US'), + onChanged: (val) => () { + print(val); + }, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => {}, + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + DateTimePicker( + type: + DateTimePickerType.time, + controller: _controller4, + //initialValue: _initialValue, + // icon: Icon(Icons.access_time), + + //use24HourFormat: false, + //locale: Locale('en', 'US'), + onChanged: (val) => () { + print(val); + }, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => + {print(val)}, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of( + context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker( + 'fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase + .of(context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: + _toDateController2, + onTap: () { + _presentDatePicker( + 'toDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], ), - ) - ], - ), Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( @@ -382,9 +538,11 @@ class _RescheduleLeaveScreen extends State { child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2.allReasons[0] - ['id'] - .toString(), + value: reason == null + ? model2.allReasons[0] + ['id'] + .toString() + : reason, iconSize: 40, elevation: 16, selectedItemBuilder: @@ -412,7 +570,11 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => {}, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, items: model2.allReasons .map((item) { return DropdownMenuItem< @@ -468,10 +630,12 @@ class _RescheduleLeaveScreen extends State { child: DropdownButton( focusColor: Colors.grey, isExpanded: true, - value: model2 - .coveringDoctors[0] - ['doctorID'] - .toString(), + value: doctorID == null + ? model2 + .coveringDoctors[0] + ['doctorID'] + .toString() + : doctorID, iconSize: 40, elevation: 16, selectedItemBuilder: @@ -500,7 +664,11 @@ class _RescheduleLeaveScreen extends State { ); }).toList(); }, - onChanged: (newValue) => {}, + onChanged: (newValue) => { + setState(() { + doctorID = newValue; + }) + }, items: model2 .coveringDoctors .map((item) { @@ -536,7 +704,9 @@ class _RescheduleLeaveScreen extends State { children: [ AppButton( title: TranslationBase.of(context).add, - onPressed: () {}, + onPressed: () { + addRecheduleLeave(model2); + }, ), ], ), @@ -569,4 +739,38 @@ class _RescheduleLeaveScreen extends State { model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } + + addRecheduleLeave(model) { + final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); + Map request = { + "Requisition": { + "requisitionNo": 0, + "requisitionType": offTime, + "clinicId": this.profile['ClinicID'], + "doctorId": this.profile['ClinicID'], + "dateTimeFrom": df.format(fromDate), + "dateTimeTo": df.format(toDate), + "date": df.format(DateTime.now()), + "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, + "coveringDoctorId": + doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "status": 2, + "schedule": [ + { + "weekDayId": 1, + "shiftId": 1, + "isOpen": true, + "timeFrom": null, + "timeTo": null, + "timeFromstr": "", + "timeTostr": "" + } + ] + } + }; + + model.addReschedule(request).then((response) { + print(response); + }); + } } diff --git a/pubspec.yaml b/pubspec.yaml index e15a7182..3f66989b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,7 +62,7 @@ dependencies: #Autocomplete TextField autocomplete_textfield: ^1.7.3 - + date_time_picker: ^1.1.1 #speech to text From 4ffeb31181194ca6c17f44f7d51f7a7864e87ed8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 2 Jan 2021 19:15:37 +0200 Subject: [PATCH 110/421] update procedure fixes --- lib/config/config.dart | 1 + .../model/procedure/get_procedure_model.dart | 2 +- lib/core/model/search_drug_model.dart | 65 ++ lib/core/model/search_drug_request_model.dart | 18 + lib/core/service/prescription_service.dart | 21 + lib/core/service/procedure_service.dart | 4 +- .../viewModel/prescription_view_model.dart | 14 + .../prescription/add_prescription_form.dart | 605 ++++++++++-------- lib/screens/procedures/procedure_screen.dart | 15 +- .../subjective/update_allergies_widget.dart | 327 +++++----- 10 files changed, 621 insertions(+), 451 deletions(-) create mode 100644 lib/core/model/search_drug_model.dart create mode 100644 lib/core/model/search_drug_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index fc7edf42..8d7ce357 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -156,6 +156,7 @@ const GET_CATEGORISE_PROCEDURE = const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; +const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; diff --git a/lib/core/model/procedure/get_procedure_model.dart b/lib/core/model/procedure/get_procedure_model.dart index bdb69b1c..5c83b49b 100644 --- a/lib/core/model/procedure/get_procedure_model.dart +++ b/lib/core/model/procedure/get_procedure_model.dart @@ -34,7 +34,7 @@ class EntityList { String genderValidation; String group; String orderedValidation; - int price; + dynamic price; String procedureId; String procedureName; String specialPermission; diff --git a/lib/core/model/search_drug_model.dart b/lib/core/model/search_drug_model.dart new file mode 100644 index 00000000..396526c1 --- /dev/null +++ b/lib/core/model/search_drug_model.dart @@ -0,0 +1,65 @@ +class SearchDrugModel { + List entityList; + int rowcount; + dynamic statusMessage; + + SearchDrugModel({this.entityList, this.rowcount, this.statusMessage}); + + SearchDrugModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + dynamic description; + dynamic genericName; + dynamic itemId; + dynamic keywords; + dynamic price; + dynamic quantity; + + EntityList( + {this.description, + this.genericName, + this.itemId, + this.keywords, + this.price, + this.quantity}); + + EntityList.fromJson(Map json) { + description = json['Description']; + genericName = json['GenericName']; + itemId = json['ItemId']; + keywords = json['Keywords']; + price = json['Price']; + quantity = json['Quantity']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['GenericName'] = this.genericName; + data['ItemId'] = this.itemId; + data['Keywords'] = this.keywords; + data['Price'] = this.price; + data['Quantity'] = this.quantity; + return data; + } +} diff --git a/lib/core/model/search_drug_request_model.dart b/lib/core/model/search_drug_request_model.dart new file mode 100644 index 00000000..e1cccc43 --- /dev/null +++ b/lib/core/model/search_drug_request_model.dart @@ -0,0 +1,18 @@ +class SearchDrugRequestModel { + List search; + String vidaAuthTokenID; + + SearchDrugRequestModel({this.search, this.vidaAuthTokenID}); + + SearchDrugRequestModel.fromJson(Map json) { + search = json['Search'].cast(); + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['Search'] = this.search; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index ced17cd4..3ccdc23c 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -2,17 +2,26 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class PrescriptionService extends BaseService { List _prescriptionList = List(); List get prescriptionList => _prescriptionList; + List _drugsList = List(); + List get drugsList => _drugsList; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( patientMRN: 3120877, vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMjgwNCIsIk5hbWUiOiJNVUhBTU1BRCBBWkFNIiwiRW1wbG95ZWVJZCI6IjE0ODUiLCJGYWNpbGl0eUdyb3VwSWQiOiIwMTAyNjYiLCJGYWNpbGl0eUlkIjoiMTUiLCJQaGFyYW1jeUZhY2lsaXR5SWQiOiI1NSIsIklTX1BIQVJNQUNZX0NPTk5FQ1RFRCI6IlRydWUiLCJEb2N0b3JJZCI6IjE0ODUiLCJTRVNTSU9OSUQiOiIyMTU3NjIwOSIsIkNsaW5pY0lkIjoiMyIsInJvbGUiOlsiU0VDVVJJVFkgQURNSU5JU1RSQVRPUlMiLCJTRVRVUCBBRE1JTklTVFJBVE9SUyIsIkNFTydTIiwiRVhFQ1VUSVZFIERJUkVDVE9SUyIsIk1BTkFHRVJTIiwiU1VQRVJWSVNPUlMiLCJDTElFTlQgU0VSVklDRVMgQ09PUkRJTkFUT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIFNVUEVSVklTT1JTIiwiQ0xJRU5UIFNFUlZJQ0VTIE1BTkdFUlMiLCJIRUFEIE5VUlNFUyIsIkRPQ1RPUlMiLCJDSElFRiBPRiBNR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UGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", + ); PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); @@ -30,6 +39,18 @@ class PrescriptionService extends BaseService { }, body: _prescriptionReqModel.toJson()); } + Future getDrugs() async { + hasError = false; + _drugsList.clear(); + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { + _drugsList.add(SearchDrugModel.fromJson(response['MedicationList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _drugRequestModel.toJson()); + } + Future postPrescription( PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 0152de24..8122f0a7 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -14,10 +14,10 @@ class ProcedureService extends BaseService { List procedureslist = List(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( - clinicId: 0, + clinicId: 17, pageSize: 10, pageIndex: 1, - patientMRN: 0, + patientMRN: 3120725, //categoryId: null, vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 14684aeb..e5fa9a0f 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; @@ -11,6 +12,7 @@ class PrescriptionViewModel extends BaseViewModel { List get prescriptionList => _prescriptionService.prescriptionList; + List get drugsList => _prescriptionService.drugsList; Future getPrescription() async { hasError = false; @@ -53,4 +55,16 @@ class PrescriptionViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getDrugs() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _prescriptionService.getDrugs(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index ce58776d..e3ed71a9 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -29,303 +30,341 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { TextEditingController doseController = TextEditingController(); final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; + showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext bc) { - return DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .searchMedicine, - controller: drugIdController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).orderType, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).strength, - keyboardType: TextInputType.number, - controller: strengthController, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context).route, - controller: routeController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).frequency, - controller: frequencyController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).doseTime, - controller: doseController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).indication, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).fromDate, - keyboardType: TextInputType.datetime, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).duration, - // borderColor: Colors.white, - keyboardType: TextInputType.number, - controller: durationController, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).instruction, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + return BaseView( + onModelReady: (model) => model.getDrugs(), + builder: (BuildContext context, PrescriptionViewModel model, + Widget child) => + DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: (BuildContext context, + ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context) + .medicines + .toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context) + .searchMedicine, + controller: drugIdController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .orderType, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .strength, + keyboardType: TextInputType.number, + controller: strengthController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).route, + controller: routeController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .frequency, + controller: frequencyController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .doseTime, + controller: doseController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .indication, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .fromDate, + keyboardType: TextInputType.datetime, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context) + .duration, + // borderColor: Colors.white, + keyboardType: TextInputType.number, + controller: durationController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of( + context) + .emptyMessage; + else + return null; + }), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .instruction, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState.validate()) { - postProcedure( - model: model, - duration: durationController.text, - dose: doseController.text, - frequency: - frequencyController.text, - route: routeController.text, - drugId: drugIdController.text, - strength: strengthController.text, - indication: - indicationController.text, - instruction: - indicationController.text, - ); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, + if (formKey.currentState + .validate()) { + postProcedure( + model: model, + duration: + durationController.text, + dose: doseController.text, + frequency: + frequencyController + .text, + route: routeController.text, + drugId: + drugIdController.text, + strength: + strengthController.text, + indication: + indicationController + .text, + instruction: + indicationController + .text, + ); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], + ), ), ], ), ), - ], - ), + ), + ], ), ), - ], - ), - ), - ), - ); - }); + ), + ); + }), + ); }); } +// openAllergiesList(BuildContext context) { +// showModalBottomSheet( +// backgroundColor: Colors.white, +// isScrollControlled: true, +// context: context, +// builder: (context) { +// return AddAllergies( +// addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { +// setState(() { +// widget.myAllergiesList.add(mySelectedAllergy); +// Navigator.of(context).pop(); +// }); +// }, +// ); +// }); +// } + postProcedure( {String duration, String dose, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 8116f005..c0afe663 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -420,7 +420,7 @@ class _ProcedureScreenState extends State { } } -postProcedure({ProcedureViewModel model}) async { +postProcedure({ProcedureViewModel model, String remarks}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); List controls = List(); List controlsProcedure = List(); @@ -433,10 +433,10 @@ postProcedure({ProcedureViewModel model}) async { 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; controls.add( - Controls(code: 'Remarks', controlValue: 'Testing'), + Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'sssssssss'), ); controlsProcedure.add( - Procedures(category: "02", procedure: "02011002", controls: controls)); + Procedures(category: "02", procedure: "02011009", controls: controls)); postProcedureReqModel.procedures = controlsProcedure; await model.postProcedure(postProcedureReqModel); @@ -448,7 +448,8 @@ postProcedure({ProcedureViewModel model}) async { } } -updateProcedure({ProcedureViewModel model, String remarks}) async { +updateProcedure( + {ProcedureViewModel model, String remarks, String procedureId}) async { PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); List controls = List(); List controlsProcedure = List(); @@ -500,6 +501,7 @@ class AddSelectedProcedure extends StatefulWidget { class _AddSelectedProcedureState extends State { TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); List entityList = List(); @override Widget build(BuildContext context) { @@ -559,6 +561,7 @@ class _AddSelectedProcedureState extends State { ), TextFields( hintText: 'Remarks', + controller: remarksController, minLines: 3, maxLines: 5, ), @@ -574,7 +577,9 @@ class _AddSelectedProcedureState extends State { title: 'add Selected Procedures'.toUpperCase(), onPressed: () { Navigator.pop(context); - postProcedure(model: widget.model); + postProcedure( + model: widget.model, + remarks: remarksController.text); }, ), ], diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index fa6b8acb..77173034 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -28,7 +28,6 @@ class UpdateAllergiesWidget extends StatefulWidget { } class _UpdateAllergiesWidgetState extends State { - TextEditingController remarkController = TextEditingController(); @override @@ -53,9 +52,7 @@ class _UpdateAllergiesWidgetState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase - .of(context) - .emptyMessage; + return TranslationBase.of(context).emptyMessage; else return null; }), @@ -64,17 +61,15 @@ class _UpdateAllergiesWidgetState extends State { height: 20, ), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), + margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), variant: "bodyText", bold: true, color: Colors.black), Texts( @@ -126,10 +121,10 @@ class _UpdateAllergiesWidgetState extends State { widget.myAllergiesList.add(mySelectedAllergy); Navigator.of(context).pop(); }); - },); + }, + ); }); } - } class AddAllergies extends StatefulWidget { @@ -149,9 +144,9 @@ class _AddAllergiesState extends State { TextEditingController remarkController = TextEditingController(); GlobalKey key = new GlobalKey>(); - - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -177,9 +172,7 @@ class _AddAllergiesState extends State { @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery - .of(context) - .size; + final screenSize = MediaQuery.of(context).size; return FractionallySizedBox( heightFactor: 0.7, child: BaseView( @@ -191,150 +184,164 @@ class _AddAllergiesState extends State { await model.getMasterLookup(MasterKeysService.AllergySeverity); } }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 16, - ), - AppText( - "Add Allergy", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - }); - } - : null, - child: _selectedAllergy==null? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), - itemSubmitted: (item) => setState(() => _selectedAllergy = item), - key: key, - suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => new Padding( - child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()), - ):TextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergySeverityList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.allergySeverityList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedAllergySeverity = - selectedValue; - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Severity", - _selectedAllergySeverity != null - ? _selectedAllergySeverity.nameEn - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), SizedBox( - height: 10, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + "Add Allergy", + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergiesList != null + ? () { + setState(() { + _selectedAllergy = null; + }); + } + : null, + child: _selectedAllergy == null + ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( + "Select Allergy", + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, + true, + icon: EvaIcons.search), + itemSubmitted: (item) => + setState(() => _selectedAllergy = item), + key: key, + suggestions: model.allergiesList, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + projectViewModel.isArabic + ? suggestion.nameAr + : suggestion.nameEn), + padding: EdgeInsets.all(8.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.nameAr + .toLowerCase() + .startsWith(input.toLowerCase()) || + suggestion.nameEn + .toLowerCase() + .startsWith(input.toLowerCase()), + ) + : TextField( + decoration: textFieldSelectorDecoration( + "Select Allergy", + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, + true, + icon: EvaIcons.search), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergySeverityList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.allergySeverityList, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedAllergySeverity = + selectedValue; + // model.getDoctorBranch().then((value) { + // _selectedBranch = value; + // if (_referTo['id'] == 1) { + // model.getClinics( + // _selectedBranch['ID']); + // } + // }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Select Severity", + _selectedAllergySeverity != null + ? _selectedAllergySeverity.nameEn + : null, + true), + enabled: false, ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + ), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( + hintText: "Remarks", + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 25, + minLines: 13, + controller: remarkController, + validator: (value) { + if (value == null) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + AppButton( + title: "Add".toUpperCase(), + onPressed: () { + MySelectedAllergy mySelectedAllergy = + new MySelectedAllergy( remark: remarkController.text, selectedAllergy: _selectedAllergy, - selectedAllergySeverity: _selectedAllergySeverity); - widget.addAllergiesFun(mySelectedAllergy); - }, - ), - ] - - ), - ), - ), - )), + selectedAllergySeverity: + _selectedAllergySeverity); + widget.addAllergiesFun(mySelectedAllergy); + }, + ), + ]), + ), + ), + )), ), ); } } - - - - - From 9bf07d71175af6d5df9151494ece331411c00793 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sat, 2 Jan 2021 20:22:02 +0300 Subject: [PATCH 111/421] reschedule leave --- lib/config/config.dart | 2 + lib/config/localized_values.dart | 15 +- lib/core/service/sickleave_service.dart | 20 +- lib/core/viewModel/sick_leave_view_model.dart | 14 +- .../add-rescheduleleave.dart | 15 +- .../reschedule-leaves/reschedule_leave.dart | 59 +++- lib/screens/sick-leave/add-sickleave.dart | 309 +++++++++--------- lib/screens/sick-leave/sick_leave.dart | 30 +- lib/util/translations_delegate_base.dart | 7 + 9 files changed, 293 insertions(+), 178 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 7f5e878e..359d458d 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -112,6 +112,8 @@ const GET_OFFTIME = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; const GET_COVERING_DOCTORS = 'Services/DoctorApplication.svc/REST/GetCoveringDoctor'; const ADD_RESCHDEULE = 'Services/DoctorApplication.svc/REST/PostRequisition'; +const UPDATE_RESCHDEULE = + 'Services/DoctorApplication.svc/REST/PatchRequisition'; const GET_RESCHEDULE_LEAVE = 'Services/DoctorApplication.svc/REST/GetRequisition'; const GET_PRESCRIPTION_LIST = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 127ee975..a78f77fa 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -389,5 +389,18 @@ const Map> localizedValues = { 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, 'to': {'en': "To", 'ar': 'إلى'}, 'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, - 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'} + 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, + 'pleaseEnterDate': { + 'en': 'Please enter leave start date', + 'ar': 'الرجاء إدخال تاريخ بدء الإجازة' + }, + 'pleaseEnterNoOfDays': { + 'en': 'Please enter sick leave days', + 'ar': 'الرجاء إدخال أيام الإجازة المرضية' + }, + 'pleaseEnterRemarks': { + 'en': 'Please enter remarks', + 'ar': 'الرجاء إدخال الملاحظات' + }, + 'update': {'en': 'Update', 'ar': 'تحديث'} }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 1b9e12ac..13e36d3b 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -82,7 +82,7 @@ class SickLeaveService extends BaseService { ); } - Future getSickLeave() async { + Future getSickLeave(patientMRN) async { hasError = false; await baseAppClient.post( GET_SICK_LEAVE, @@ -97,7 +97,7 @@ class SickLeaveService extends BaseService { hasError = true; super.error = error; }, - body: {'PatientMRN': 3120772}, + body: {'PatientMRN': patientMRN}, ); } @@ -186,4 +186,20 @@ class SickLeaveService extends BaseService { body: request, ); } + + updateReschedule(request) async { + hasError = false; + + await baseAppClient.post( + UPDATE_RESCHDEULE, + onSuccess: (dynamic response, int statusCode) { + Future.value(response); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: request, + ); + } } diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index bbcd55a6..d5aba154 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -46,9 +46,9 @@ class SickLeaveViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getSickLeave() async { + Future getSickLeave(patientMRN) async { setState(ViewState.Busy); - await _sickLeaveService.getSickLeave(); + await _sickLeaveService.getSickLeave(patientMRN); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); @@ -105,4 +105,14 @@ class SickLeaveViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future updateReschedule(request) async { + setState(ViewState.Busy); + await _sickLeaveService.updateReschedule(request); + if (_sickLeaveService.hasError) { + error = _sickLeaveService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } } diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 79b47523..c48eee79 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -175,8 +175,8 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), // color: Colors.green, //Colors.black, onPressed: () => { - // openSickLeave(context, true, - // extendedData: item) + openLeave(context, true, + extendedData: item) }, )) : SizedBox(), @@ -239,18 +239,15 @@ class AddRescheduleLeavScreen extends StatelessWidget { )); } - openLeave(BuildContext context, isExtend, - {GetAllSickLeaveResponse extendedData}) { + openLeave(BuildContext context, isExtend, {extendedData}) { showModalBottomSheet( context: context, builder: (context) { return new Container( child: RescheduleLeaveScreen( - // appointmentNo: extendedData.appointmentNo, - // patientMRN: extendedData.patientMRN, - // isExtended: isExtend, - // extendedData: extendedData, - )); + isExtend, + extendedData, + )); }); } diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 9ac2cf77..1a807392 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -27,7 +27,9 @@ import 'package:provider/provider.dart'; Helpers helpers = Helpers(); class RescheduleLeaveScreen extends StatefulWidget { - RescheduleLeaveScreen(); + final isUpdate; + final updateData; + RescheduleLeaveScreen(this.isUpdate, this.updateData); @override _RescheduleLeaveScreen createState() => _RescheduleLeaveScreen(); } @@ -45,8 +47,8 @@ class _RescheduleLeaveScreen extends State { var reason; var fromDate; var toDate; + var clinicID; TextEditingController _controller4; - // AddSickLeaveRequest addSickLeave = AddSickLeaveRequest(); void _presentDatePicker(id) { showDatePicker( context: context, @@ -58,11 +60,7 @@ class _RescheduleLeaveScreen extends State { return; } setState(() { - // var selectedDate = DateFormat.yMd().format(pickedDate); final df = new DateFormat('yyyy-MM-dd'); - - //addSickLeave.startDate; - if (id == 'fromDate') { fromDate = pickedDate; //df.format(); _toDateController.text = df.format(pickedDate); @@ -70,7 +68,6 @@ class _RescheduleLeaveScreen extends State { toDate = pickedDate; // _toDateController2.text = df.format(pickedDate); } - //addSickLeave.startDate = selectedDate; }); }); } @@ -703,9 +700,15 @@ class _RescheduleLeaveScreen extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: TranslationBase.of(context).add, + title: widget.isUpdate == true + ? TranslationBase.of(context).update + : TranslationBase.of(context).add, onPressed: () { - addRecheduleLeave(model2); + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } }, ), ], @@ -730,6 +733,10 @@ class _RescheduleLeaveScreen extends State { Map p = await sharedPref.getObj(DOCTOR_PROFILE); setState(() { this.profile = p; + this.clinicID = widget.updateData.clinicId; + + _toDateController.text = widget.updateData.dateTimeFrom; + _toDateController2.text = widget.updateData.dateTimeTo; }); } @@ -773,4 +780,38 @@ class _RescheduleLeaveScreen extends State { print(response); }); } + + updateRecheduleLeave(model) { + final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); + Map request = { + "Requisition": { + "requisitionNo": 0, + "requisitionType": offTime, + "clinicId": this.profile['ClinicID'], + "doctorId": this.profile['ClinicID'], + "dateTimeFrom": df.format(fromDate), + "dateTimeTo": df.format(toDate), + "date": df.format(DateTime.now()), + "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, + "coveringDoctorId": + doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, + "status": 2, + "schedule": [ + { + "weekDayId": 1, + "shiftId": 1, + "isOpen": true, + "timeFrom": null, + "timeTo": null, + "timeFromstr": "", + "timeTostr": "" + } + ] + } + }; + + model.updateReschedule(request).then((response) { + print(response); + }); + } } diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 37bf9454..d456f2a6 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -2,10 +2,12 @@ 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/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'; @@ -13,166 +15,167 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class AddSickLeavScreen 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(), + onModelReady: (model) => model.getSickLeave(patient.patientMRN), builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).sickleave, - body: model.getAllSIckLeave.length > 0 - ? SingleChildScrollView( - child: 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) - .approved - : item.status == 2 - ? TranslationBase - .of(context) - .extended - : TranslationBase - .of(context) - .pending, - fontWeight: FontWeight.bold, - color: Colors.white, - ), - color: item.status == 1 - ? Colors.green - : Colors.yellow[800], - ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .leaveStartDate + - ' ', - fontWeight: - FontWeight.bold, - ), - Flexible( - child: Text( - item.startDate, - overflow: - TextOverflow.ellipsis, - )) - ], - ), - AppText( - item.noOfDays.toString() + - ' ' + - TranslationBase.of( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).sickleave, + body: SingleChildScrollView( + child: Column(children: [ + PatientPageHeaderWidget(patient), + model.getAllSIckLeave.length > 0 + ? 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) - .daysSickleave, + .approved + : item.status == 2 + ? TranslationBase.of( + context) + .extended + : TranslationBase.of( + context) + .pending, fontWeight: FontWeight.bold, + color: Colors.white, ), - Row(children: [ + color: item.status == 1 + ? Colors.green + : Colors.yellow[800], + ), + Row( + children: [ AppText( - item.remarks, - ) - ]), - ], - ), - SizedBox( - width: 20, - ), - ], - ), + 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, + ), + ], ), - (item.status == 1 || item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.open_in_full, - size: 40, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - openSickLeave(context, true, - extendedData: item) - }, - )) - : SizedBox(), - ], - )), - SizedBox( - height: 20, + ), + (item.status == 1 || item.status == 2) + ? Expanded( + flex: 1, + child: IconButton( + icon: Icon( + Icons.open_in_full, + size: 25, + ), + // color: Colors.green, //Colors.black, + onPressed: () => { + openSickLeave(context, true, + extendedData: item) + }, + )) + : SizedBox(), + ], + )), + SizedBox( + height: 20, + ), + Divider( + height: 1, + ), + ], + )); + }).toList(), + ) + : new Builder(builder: (context) { + return Container( + height: MediaQuery.of(context).size.height * .7, + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + padding: EdgeInsets.all(40), + decoration: BoxDecoration( + border: Border.all( + color: HexColor('#B8382C'), width: 4), + borderRadius: + BorderRadius.all(Radius.circular(100))), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), ), - Divider( - height: 1, + Padding( + child: AppText( + TranslationBase.of(context) + .noSickLeaveApplied, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10), ), + AppText( + TranslationBase.of(context).applyNow, + fontWeight: FontWeight.bold, + color: HexColor('#B8382C'), + ) ], )); - }).toList(), - ), - ) - : new Builder(builder: (context) { - return Center( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context).noSickLeaveApplied, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - ), - )); }), - )); + ])))); } openSickLeave(BuildContext context, isExtend, @@ -182,11 +185,15 @@ class AddSickLeavScreen extends StatelessWidget { builder: (context) { return new Container( child: SickLeaveScreen( - appointmentNo: extendedData.appointmentNo, - patientMRN: extendedData.patientMRN, - isExtended: isExtend, - extendedData: extendedData, - )); + appointmentNo: isExtend == true + ? extendedData.appointmentNo + : patient.appointmentNo, //extendedData.appointmentNo, + patientMRN: isExtend == true + ? extendedData.patientMRN + : patient.patientMRN, + isExtended: isExtend, + extendedData: extendedData, + patient: patient)); }); } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 026b7c19..caef49ee 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -6,9 +6,11 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/text_validator.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/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -28,11 +30,13 @@ class SickLeaveScreen extends StatefulWidget { final GetAllSickLeaveResponse extendedData; final appointmentNo; final patientMRN; + final patient; SickLeaveScreen( {this.appointmentNo, this.patientMRN, this.isExtended = false, - this.extendedData}); + this.extendedData, + this.patient}); @override _SickLeaveScreenState createState() => _SickLeaveScreenState(); } @@ -252,6 +256,7 @@ class _SickLeaveScreenState extends State { model2.sickLeaveStatistics[ 'recommendedSickLeaveDays'], fontWeight: FontWeight.bold, + textAlign: TextAlign.start, ), padding: EdgeInsets.all(10), ) @@ -339,9 +344,7 @@ class _SickLeaveScreenState extends State { print(value); }); } else { - model2 - .addSickLeave(addSickLeave) - .then((value) => print(value)); + _validateInputs(model2); } }, ), @@ -363,6 +366,25 @@ class _SickLeaveScreenState extends State { ))); } + void _validateInputs(model2) async { + try { + if (addSickLeave.noOfDays == null) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseEnterNoOfDays); + } else if (addSickLeave.remarks == null) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseEnterRemarks); + } else if (addSickLeave.startDate == null) { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseEnterDate); + } else { + model2.addSickLeave(addSickLeave).then((value) => print(value)); + } + } catch (err) { + print(err); + } + } + getProfile() async { Map p = await sharedPref.getObj(DOCTOR_PROFILE); setState(() { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 6126912e..4e94b746 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -430,6 +430,13 @@ class TranslationBase { localizedValues['coveringDoctor'][locale.languageCode]; String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; + String get pleaseEnterDate => + localizedValues['pleaseEnterDate'][locale.languageCode]; + String get pleaseEnterNoOfDays => + localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterRemarks => + localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From e65740761ae71dd50ff9032f4980777eed7b615e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sat, 2 Jan 2021 19:45:48 +0200 Subject: [PATCH 112/421] add improvement on create episode --- assets/images/create-episod.png | Bin 0 -> 651 bytes assets/images/modilfy-episode.png | Bin 0 -> 987 bytes lib/client/base_app_client.dart | 11 ++-- lib/screens/patients/patients_screen.dart | 52 +++++++++--------- .../profile/patient_profile_widget.dart | 3 +- .../profile/profile_medical_info_widget.dart | 9 ++- .../subjective/update_allergies_widget.dart | 12 +++- .../subjective/update_history_widget.dart | 9 ++- .../subjective/update_subjective_page.dart | 2 +- .../soap_update/update_assessment_page.dart | 21 ++++--- .../soap_update/update_objective_page.dart | 4 +- 11 files changed, 73 insertions(+), 50 deletions(-) create mode 100644 assets/images/create-episod.png create mode 100644 assets/images/modilfy-episode.png diff --git a/assets/images/create-episod.png b/assets/images/create-episod.png new file mode 100644 index 0000000000000000000000000000000000000000..02386fd1503c7628aa933022bf219d2fe5c4e6e4 GIT binary patch literal 651 zcmeAS@N?(olHy`uVBq!ia0vp^sz7YO!3HF!wQkl1QjEnx?oJHr&dIz4ax79KJkxxA z8MJ_G4hF{dOa>N^5+IfWVg?4L1x#=e)dkFOwgE^|n!)-wPzj@_i(^Ox=i7+afrlIf z+>ZZW!t6bP&x2D_QS}C6$pYC1*$a&6>=BG*32PYkw??O#?>s9jA!nbLKCRaN)6+>a z4WweHX>Iw>_?~IcjyD;*e`{^%i7|-yDe{HyxsJC>~f+<#Fb%3bi#TEJ=R_2i^JmL$)T z#^je7FLS?`cL>X`Y*SlbP}w6R!hZ1Mrw3jCtWpYi)!S=iZhPAWo9Z}qycB8Kk!Ikz zeLd6ZR;e4&A9!?LMoOi>$d3O!DM*|DD<7+-jb~=hoX{onZ>pto&fIKhUCJyP!y9qU zdv7%3`DXnE55#{=ox*W3$mB&#k;a@~Nwe-N{`6YlxNdSGGrN7QxkPUN8Sk4nUU;~9 zJx+|4)RdN%J?W8YlcTMin!H$9QnR-`H+4x)PKk>0(vKU~_Dt#R?Mqo=BDZbo#7!G7 zPTcL{Ro8RrzsH}atHR~4z52aB%ignY8^5*H+UO6P=jPqdkNW!{@>$HTTGbs=H7R=* cZVvj#u<`f>>$%*!Zh;bor>mdKI;Vst09o1y#sB~S literal 0 HcmV?d00001 diff --git a/assets/images/modilfy-episode.png b/assets/images/modilfy-episode.png new file mode 100644 index 0000000000000000000000000000000000000000..6fdd224f02e9bdca5090677c626d31f99b80e428 GIT binary patch literal 987 zcmV<110?*3P)Px#IAvH#W=%~1DgXcg2mk?xX#fNO00031000^Q000000-yo_1ONa40RR91D4+uX z1ONa40RR91D*ylh03MD$MgRZ@l!i!j`v?s z^G(8Ui0!L<@MoL54dNZR1pj~zUV~iv0Dc2$LNFv(Iv}nyL#dqV6Qy#yST$62k0xk} zXhGHEleAD*-%+cAE~F~;>oQkEI3eU3{s~{sOs|``L zsm*bP=lP6PkeLLvfjZA&4&y&=kpJq>ZSE+8r!aT4!MR>5jR}r~4})=3*cUBmYkq;=T?WP?h37Ds#*F<}{l9I~Db)!?Co%v4002ov JPDHLkV1grMxn=+W literal 0 HcmV?d00001 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ff9d957d..75894465 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -82,12 +82,11 @@ class BaseAppClient { onFailure('Error While Fetching data', statusCode); } else { var parsed = json.decode(response.body.toString()); - // if (!parsed['IsAuthenticated']) { - // // TODO: return it back when IsAuthenticated work fine in all service - // // await helpers.logout(); - // - // helpers.showErrorToast('Your session expired Please login agian'); - // } else + if (!parsed['IsAuthenticated']) { + // TODO: return it back when IsAuthenticated work fine in all service + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login agian'); + } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 74c9234c..33b2606c 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -274,34 +274,35 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - // if (res['MessageStatus'] == 1) { - if (val2 == 7) { - print("Assad"); - if (res[SERVICES_PATIANT2[val2]] == null) { - _isError = true; - _isLoading = false; - this.error = error.toString(); + if (res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + print(localList.toString()); + lItems = localList; + } } else { - - var localList=[]; - res["patientArrivalList"]["entityList"].forEach((v) { - Map mergedPatient= {...v,...v["patientDetails"]}; - localList.add(mergedPatient); - }); - print(localList.toString()); - lItems = localList;//res[SERVICES_PATIANT2[val2]]["entityList"]; + lItems = res[SERVICES_PATIANT2[val2]]; } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; } else { - lItems = res[SERVICES_PATIANT2[val2]]; + _isError = true; + error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } - parsed = lItems; - responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2 = responseModelList; - _isError = false; - // } else { - // _isError = true; - // error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; - // } }); }).catchError((error) { setState(() { @@ -679,7 +680,8 @@ class _PatientsScreenState extends State { .pushNamed( PATIENTS_PROFILE, arguments: { - "patient": item + "patient": item, + "patientType":patientType }); }, ), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 792eb49e..f50c7669 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -22,6 +22,7 @@ class PatientProfileWidget extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; return Container( color: Color(0XFFF2F2F2), @@ -437,7 +438,7 @@ class PatientProfileWidget extends StatelessWidget { SliverPadding( padding: const EdgeInsets.all(16.0), sliver: ProfileMedicalInfoWidget( - patient: patient, + patient: patient, patientType:patientType )) ]), ); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 468a1b9d..886b2c9d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -18,8 +18,9 @@ import 'PatientProfileButton.dart'; *@desc: Profile Medical Info Widget */ class ProfileMedicalInfoWidget extends StatelessWidget { - ProfileMedicalInfoWidget({Key key, this.patient}) : super(key: key); + ProfileMedicalInfoWidget({Key key, this.patient, this.patientType}); PatiantInformtion patient; + String patientType; @override Widget build(BuildContext context) { return SliverGrid.count( @@ -28,20 +29,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ + if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, nameLine1: "Create New", nameLine2: "Episode", route: CREATE_EPISODE, - icon: 'heartbeat.png'), + icon: 'create-episod.png'), + if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, nameLine1: "Update", nameLine2: "Episode", route: UPDATE_EPISODE, - icon: 'heartbeat.png'), + icon: 'modilfy-episode.png'), PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index fa6b8acb..f03025ae 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -70,13 +70,21 @@ class _UpdateAllergiesWidgetState extends State { children: widget.myAllergiesList.map((selectedAllergy) { return Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), - variant: "bodyText", bold: true, color: Colors.black), + Container( + + child: Expanded( + child: Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), + variant: "bodyText", bold: true, color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.5, + ), Texts( selectedAllergy.selectedAllergySeverity.nameEn .toUpperCase(), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 5e033127..f720fdfd 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -81,8 +81,13 @@ class _UpdateHistoryWidgetState extends State Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Texts(myHistory.nameEn, - variant: "bodyText", bold: true, color: Colors.black), + Container( + child: Expanded( + child: Texts(myHistory.nameEn, + variant: "bodyText", bold: true, color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.7, + ), InkWell( child: Icon( FontAwesomeIcons.trash, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index d9828795..53007123 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -414,7 +414,7 @@ class _UpdateSubjectivePageState extends State { postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM .add(ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index c25b0d5b..86e98e4b 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -277,10 +277,13 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 6, ), - AppText( - widget.mySelectedAssessment.remark??"", - fontSize: 10, - color: Colors.grey, + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: AppText( + widget.mySelectedAssessment.remark??"", + fontSize: 10, + color: Colors.grey, + ), ), ], ), @@ -298,10 +301,12 @@ class _UpdateAssessmentPageState extends State { fontWeight: FontWeight.bold, fontSize: 16, ), - AppText( - widget.mySelectedAssessment.selectedICD.code.toUpperCase()??"", - fontSize: 10, - color: Colors.grey, + Container( + child: AppText( + widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"", + fontSize: 10, + color: Colors.grey, + ), ), ], ) diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 2a342542..2abdfbae 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -304,14 +304,14 @@ class _UpdateObjectivePageState extends State { ), Container( margin: EdgeInsets.only( - left: 10, right: 10, top: 15), + left: 0, right: 0, top: 15), child: TextFields( hintText: "Remarks", fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 25, - minLines: 13, + minLines: 4, controller: remarksController, validator: (value) { if (value == null) From 6c894c3d3ba9e670c0a768c6e418a7ed5db582a4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sat, 2 Jan 2021 20:51:07 +0300 Subject: [PATCH 113/421] sick leave --- lib/core/service/sickleave_service.dart | 4 ++-- lib/screens/sick-leave/sick_leave.dart | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 13e36d3b..c4aa8abf 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -39,8 +39,8 @@ class SickLeaveService extends BaseService { } Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { - addSickLeaveRequest.appointmentNo = '2016054661'; - addSickLeaveRequest.patientMRN = '3120746'; + // addSickLeaveRequest.appointmentNo = '2016054661'; + // addSickLeaveRequest.patientMRN = '3120746'; hasError = false; await baseAppClient.post( ADD_SICK_LEAVE, diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index caef49ee..2aea6f43 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -52,7 +52,7 @@ class _SickLeaveScreenState extends State { context: context, initialDate: DateTime.now(), firstDate: DateTime(2019), - lastDate: DateTime.now(), + lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { return; @@ -378,6 +378,8 @@ class _SickLeaveScreenState extends State { DrAppToastMsg.showErrorToast( TranslationBase.of(context).pleaseEnterDate); } else { + addSickLeave.patientMRN = widget.patient.patientMRN.toString(); + addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); model2.addSickLeave(addSickLeave).then((value) => print(value)); } } catch (err) { From 71b50c84040a63756fdfbba38286a0959b6390db Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 00:09:58 +0200 Subject: [PATCH 114/421] First step translations --- lib/config/localized_values.dart | 16 + lib/core/service/SOAP_service.dart | 19 +- lib/core/viewModel/SOAP_view_model.dart | 12 +- lib/routes.dart | 1 - lib/util/translations_delegate_base.dart | 18 + .../patients/profile/SOAP/add_SOAP_index.dart | 133 ---- .../profile/SOAP/assessment_page.dart | 647 ------------------ .../patients/profile/SOAP/objective_page.dart | 518 -------------- .../patients/profile/SOAP/plan_page.dart | 349 ---------- .../SOAP/subjective/add_allergies_widget.dart | 339 --------- .../SOAP/subjective/add_history_widget.dart | 360 ---------- .../subjective/add_medication_widget.dart | 107 --- .../SOAP/subjective/subjective_page.dart | 402 ----------- .../profile/profile_medical_info_widget.dart | 8 +- .../profile/soap_update/steps_widget.dart | 8 +- .../subjective/update_allergies_widget.dart | 78 ++- .../subjective/update_history_widget.dart | 20 +- .../subjective/update_subjective_page.dart | 91 ++- .../soap_update/update_assessment_page.dart | 4 +- .../soap_update/update_objective_page.dart | 4 +- .../soap_update/update_soap_index.dart | 4 - .../shared/dialogs/master_key_dailog.dart | 13 +- .../master_key_checkbox_search_widget.dart | 108 +-- 23 files changed, 263 insertions(+), 2996 deletions(-) delete mode 100644 lib/widgets/patients/profile/SOAP/add_SOAP_index.dart delete mode 100644 lib/widgets/patients/profile/SOAP/assessment_page.dart delete mode 100644 lib/widgets/patients/profile/SOAP/objective_page.dart delete mode 100644 lib/widgets/patients/profile/SOAP/plan_page.dart delete mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart delete mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart delete mode 100644 lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart delete mode 100644 lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c27e8b70..85954bb0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -415,4 +415,20 @@ const Map> localizedValues = { 'specifyPossibleLineManagement': {'en': "Specify possible line of management", 'ar': 'حدد خط الإدارة المحتمل'}, 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, + 'createNew': {'en': "Create New", 'ar': 'انشاء '}, + 'episode': {'en': "Episode", 'ar': 'Episode'}, + 'update': {'en': "Update", 'ar': 'تعديل'}, + 'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'}, + 'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'}, + 'histories': {'en': "Histories", 'ar': 'التاريخ المرضي'}, + 'allergiesSoap': {'en': "Allergies", 'ar': 'الحساسية'}, + 'historyOfPresentIllness': {'en': "History of Present Illness", 'ar': 'تاريخ المرض الحالي'}, + 'requiredMsg': {'en': "Please add required field correctly", 'ar':"الرجاء إضافة الحقل المطلوب بشكل صحيح" }, + 'addHistory': {'en': "Add History", 'ar':"اضافه تاريخ مرضي" }, + 'searchHistory': {'en': "Search History", 'ar':" البحث" }, + 'addSelectedHistories': {'en': "add selected histories", 'ar':" اضافه تاريخ مرضي" }, + 'addAllergies': {'en': "Add Allergies", 'ar':"أضف الحساسية" }, + 'itemExist': {'en': "This item already exist", 'ar':"هذا العنصر موجود" }, + 'selectAllergy': {'en': "Select Allergy", 'ar':"أختر الحساسية" }, + 'selectSeverity': {'en': "Select Severity", 'ar':"أختر الدرجه" }, }; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 426e0811..d1fff03b 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -212,17 +212,18 @@ class SOAPService extends LookupService { } Future getPatientHistories( - GetHistoryReqModel getHistoryReqModel) async { + GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { hasError = false; - await baseAppClient.post (GET_HISTORY, + await baseAppClient.post(GET_HISTORY, onSuccess: (dynamic response, int statusCode) { - print("Success"); - patientHistoryList.clear(); - response['List_History']['entityList'].forEach((v) { - patientHistoryList.add(GetHistoryResModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; + print("Success"); + if (isFirst) + patientHistoryList.clear(); + response['List_History']['entityList'].forEach((v) { + patientHistoryList.add(GetHistoryResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; super.error = error; }, body: getHistoryReqModel.toJson()); } diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 697e9934..fff7a239 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -226,17 +226,17 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } - Future getPatientHistories(GetHistoryReqModel getHistoryReqModel) async { + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); - await _SOAPService.getPatientHistories(getHistoryReqModel); + await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } @@ -247,7 +247,7 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } @@ -278,7 +278,7 @@ class SOAPViewModel extends BaseViewModel { await _SOAPService.getPatientAssessment(getAssessmentReqModel); if (_SOAPService.hasError) { error = _SOAPService.error; - setState(ViewState.Busy); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/routes.dart b/lib/routes.dart index 728b5f06..962df032 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -11,7 +11,6 @@ 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/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/add_SOAP_index.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'; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 213ad371..e928f521 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -452,6 +452,24 @@ class TranslationBase { String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String get createNew => localizedValues['createNew'][locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; + String get episode => localizedValues['episode'][locale.languageCode]; + + + String get chiefComplaints=> localizedValues['chiefComplaints'][locale.languageCode]; + String get histories => localizedValues['histories'][locale.languageCode]; + String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; + String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; + String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; + String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; + String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; + String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; + String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart b/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart deleted file mode 100644 index 9b4d092d..00000000 --- a/lib/widgets/patients/profile/SOAP/add_SOAP_index.dart +++ /dev/null @@ -1,133 +0,0 @@ -import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.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:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; - -import '../soap_update/steps_widget.dart'; - -class AddSOAPIndex extends StatefulWidget { - final bool isUpdate; - - const AddSOAPIndex({Key key, this.isUpdate}) : super(key: key); - @override - _AddSOAPIndexState createState() => _AddSOAPIndexState(); -} - -class _AddSOAPIndexState extends State - with TickerProviderStateMixin { - PageController _controller; - int _currentIndex = 0; - List myAllergiesList= List(); - List myHistoryList = List(); - List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); - changePageViewIndex(pageIndex) { - _controller.jumpToPage(pageIndex); - } - - @override - void initState() { - // TODO: implement initState - _controller = new PageController(); - - super.initState(); - } - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - return BaseView( - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).healthRecordInformation, - body: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: - BoxDecoration(boxShadow: [], color: Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - FractionallySizedBox( - child: SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 0.75, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: - MediaQuery.of(context).size.width * 0.05, - right: - MediaQuery.of(context).size.width * 0.05), - child: StepsWidget( - index: _currentIndex, - changeCurrentTab: changePageViewIndex, - ), - ), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: _controller, - onPageChanged: (index) { - setState(() { - _currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - SubjectivePage( - changePageViewIndex: changePageViewIndex, - myAllergiesList: myAllergiesList, - myHistoryList: myHistoryList, - patientInfo: patient, - ), - ObjectivePage( - changePageViewIndex: changePageViewIndex, - mySelectedExamination: - mySelectedExamination, - patientInfo: patient, - ), - AssessmentPage( - changePageViewIndex: changePageViewIndex, - mySelectedAssessment: - mySelectedAssessment, - patientInfo: patient, - ), - PlanPage( - changePageViewIndex: changePageViewIndex, - patientInfo: patient, - ) - ], - ), - ), - ], - ), - ), - ), - ) - ], - ), - ), - ], - ), - ), - ), - ); - } -} diff --git a/lib/widgets/patients/profile/SOAP/assessment_page.dart b/lib/widgets/patients/profile/SOAP/assessment_page.dart deleted file mode 100644 index 0f7a8e31..00000000 --- a/lib/widgets/patients/profile/SOAP/assessment_page.dart +++ /dev/null @@ -1,647 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.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/helpers.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:provider/provider.dart'; - -class AssessmentPage extends StatefulWidget { - final Function changePageViewIndex; - final MySelectedAssessment mySelectedAssessment; - final PatiantInformtion patientInfo; - - AssessmentPage( - {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); - - @override - _AssessmentPageState createState() => _AssessmentPageState(); -} - -class _AssessmentPageState extends State { - bool isAssessmentExpand = false; - - List assessmentList; - dynamic _referTo; - - TextEditingController remarksController = TextEditingController(); - Helpers helpers = Helpers(); - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return BaseView( - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('ASSESSMENT', - variant: - isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: TextFields( - hintText: "Add ASSESSMENT", - fontSize: 13.5, - onTapTextFields: () { - openAssessmentDialog(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - if(widget.mySelectedAssessment != null && - widget.mySelectedAssessment - .appointmentId != - null && widget.mySelectedAssessment - .selectedDiagnosisType != null && - widget.mySelectedAssessment - .selectedDiagnosisCondition != null) - Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Appointment #: ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .appointmentId - .toString(), - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Type : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .selectedDiagnosisType - .nameEn, - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Doc : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - AppText( - widget.mySelectedAssessment.remark, - fontSize: 10, - color: Colors.grey, - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - - children: [ - AppText( - "ICD: ".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "R07.1".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openAssessmentDialog(context); - }, - child: Icon(EvaIcons - .edit2Outline), - ) - ], - ), - ], - ), - ) - ], - ) - ]), - isExpand: isAssessmentExpand, - ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitAssessment(model); - }, - ), - SizedBox( - height: 30, - ), - ], - ), - ), - ), - ))); - } - - submitAssessment(SOAPViewModel model) async { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null) { - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: "1") - ]); - - await model.postAssessment(postAssessmentRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(3); - } - } else { - helpers.showErrorToast('Please add required field correctly'); - } - - widget.changePageViewIndex(3); - } - - openAssessmentDialog(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddAssessmentDetails( - mySelectedAssessment: widget.mySelectedAssessment, - addSelectedAssessment: () { - setState(() { - Navigator.of(context).pop(); - }); - }); - }); - } - -} - -class AddAssessmentDetails extends StatefulWidget { - final MySelectedAssessment mySelectedAssessment; - final Function() addSelectedAssessment; - - const AddAssessmentDetails( - {Key key, this.mySelectedAssessment, this.addSelectedAssessment}) - : super(key: key); - - @override - _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); -} - -class _AddAssessmentDetailsState extends State { - // MasterKeyModel _selectedDiagnosisCondition; - // MasterKeyModel _selectedDiagnosisType; - TextEditingController remarkController = TextEditingController(); - TextEditingController appointmentIdController = TextEditingController( - text: "234567"); - GlobalKey key = new GlobalKey>(); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - remarkController.text = widget.mySelectedAssessment.remark??""; - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { - //TODO: make one Input InputDecoration for all - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - return FractionallySizedBox( - heightFactor: 0.75, - child: BaseView( - onModelReady: (model) async { - if (model.listOfDiagnosisCondition.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisCondition); - } - if (model.listOfDiagnosisType.length == 0) { - await model.getMasterLookup(MasterKeysService.DiagnosisType); - } - // if (model.listOfICD10.length == 0) { - // await model.getMasterLookup(MasterKeysService.ICD10); - // } - }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Add Assessment Details".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Appointment Number", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - readOnly: true, - controller: appointmentIdController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfICD10 != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - }); - } - : null, - child:widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), - itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), - key: key, - suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => new Padding( - child:Texts( suggestion.description +" / "+ suggestion.code.toString()), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase()) - ||suggestion.code.toLowerCase().startsWith(input.toLowerCase()) - , - ): TextField( - decoration: textFieldSelectorDecoration( - widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", - widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfDiagnosisCondition != - null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisCondition, - okText: TranslationBase - .of(context) - .ok, - okFunction: ( - MasterKeyModel selectedValue) { - setState(() { - widget.mySelectedAssessment - .selectedDiagnosisCondition = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Condition", - widget.mySelectedAssessment - .selectedDiagnosisCondition != null - ? widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfDiagnosisType != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.listOfDiagnosisType, - okText: TranslationBase - .of(context) - .ok, - okFunction: ( - MasterKeyModel selectedValue) { - setState(() { - // _selectedDiagnosisType = - // selectedValue; - widget.mySelectedAssessment - .selectedDiagnosisType = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Type", - widget.mySelectedAssessment - .selectedDiagnosisType != null - ? widget.mySelectedAssessment - .selectedDiagnosisType.nameEn - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 18, - minLines: 5, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 10, - ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () { - setState(() { - widget.mySelectedAssessment.remark = - remarkController.text; - widget.mySelectedAssessment - .appointmentId = int.parse( - appointmentIdController.text); - - widget.addSelectedAssessment(); - }); - }, - ), - ])), - ), - ), - ))), - ); - } -} - diff --git a/lib/widgets/patients/profile/SOAP/objective_page.dart b/lib/widgets/patients/profile/SOAP/objective_page.dart deleted file mode 100644 index e5ce583b..00000000 --- a/lib/widgets/patients/profile/SOAP/objective_page.dart +++ /dev/null @@ -1,518 +0,0 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -class ObjectivePage extends StatefulWidget { - final Function changePageViewIndex; - final List mySelectedExamination; - final PatiantInformtion patientInfo; - ObjectivePage( - {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); - - @override - _ObjectivePageState createState() => _ObjectivePageState(); -} - -class _ObjectivePageState extends State { - bool isSysExaminationExpand = false; - TextEditingController remarksController = TextEditingController(); - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 0.5, - )), - ); - } - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('Physical/System Examination', - variant: - isSysExaminationExpand ? "bodyText" : '', - bold: isSysExaminationExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isSysExaminationExpand = - !isSysExaminationExpand; - }); - }, - child: Icon(isSysExaminationExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Examination", - fontSize: 13.5, - onTapTextFields: () { - openExaminationList(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Column( - children: - widget.mySelectedExamination.map((examination) { - return Container( - margin: EdgeInsets.only( - left: 15, right: 15, top: 15), - child: Column(children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts( - examination - .selectedExamination.nameEn - .toUpperCase(), - variant: "bodyText", - bold: true, - color: Colors.black) - ], - ), - SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - InkWell( - child: Center( - child: Container( - height: - screenSize.height * - 0.070, - decoration: - containerBorderDecoration( - examination - .isNormal - ? Color( - 0xFF515A5D) - : Colors - .white, - Colors.grey), - child: Center( - child: Padding( - padding: - const EdgeInsets - .all(8.0), - child: Text( - "Normal", - style: TextStyle( - fontSize: 12, - color: - examination - .isNormal - ? Colors.white - : Colors - .black, - //Colors.black, - fontWeight: - FontWeight - .bold, - ), - ), - ), - )), - ), - onTap: () { - setState(() { - examination.isAbnormal = - !examination.isAbnormal; - examination.isNormal = - !examination.isNormal; - }); - }), - SizedBox( - width: 12, - ), - InkWell( - child: Center( - child: Container( - height: - screenSize.height * - 0.070, - decoration: - containerBorderDecoration( - examination - .isAbnormal - ? Color( - 0xFF515A5D) - : Colors - .white, - Colors.black), - child: Center( - child: Padding( - padding: - const EdgeInsets - .all(8.0), - child: Text( - "Abnormal", - style: TextStyle( - fontSize: 12, - color: - examination - .isAbnormal - ? Colors.white - : Colors - .black, - //Colors.black, - fontWeight: - FontWeight - .bold, - ), - ), - ), - )), - ), - onTap: () { - setState(() { - examination.isAbnormal = - !examination.isAbnormal; - examination.isNormal = - !examination.isNormal; - }); - }), - ], - ), - InkWell( - - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeExamination( - examination.selectedExamination), - ) - ], - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only( - left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarksController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - ])); - }).toList(), - ) - ], - ) - ]), - isExpand: isSysExaminationExpand, - ), - DividerWithSpacesAround(height: 30,), - AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitObjectivePage(model); - }, - ), - SizedBox( - height: 30, - ), - ], - ), - ), - ), - ))); - } - - submitObjectivePage(SOAPViewModel model) async { - // if(widget.mySelectedExamination.isNotEmpty){ - // PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); - // widget.mySelectedExamination.forEach((exam) { - // if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == - // null) - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM = []; - // // TODO : change createdBy editedBy - // postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM.add( - // ListHisProgNotePhysicalExaminationVM( - // patientMRN: widget.patientInfo.patientMRN, - // episodeId: widget.patientInfo.episodeNo, - // appointmentNo: widget.patientInfo.appointmentNo, - // remarks: exam.remark ?? '', - // createdBy: 4709, - // createdOn: DateTime.now().toIso8601String(), - // editedBy: 4709, - // editedOn: DateTime.now().toIso8601String(), - // examId: exam.selectedExamination.id, - // examType: exam.selectedExamination.typeId, - // isAbnormal: exam.isAbnormal, - // isNormal: exam.isNormal, - // masterDescription: exam.selectedExamination, - // notExamined: false - // - // )); - // }); - // - // await model.postPhysicalExam(postPhysicalExamRequestModel); - // - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(2); - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } - - widget.changePageViewIndex(2); - } - - removeExamination(MasterKeyModel masterKey) { - Iterable history = widget.mySelectedExamination - .where( - (element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); - - if (history.length > 0) - setState(() { - widget.mySelectedExamination.remove(history.first); - }); - } - - openExaminationList(BuildContext context) { - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddExaminationDailog( - mySelectedExamination: widget.mySelectedExamination, - addSelectedExamination: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - removeExamination: (masterKey) => removeExamination(masterKey),); - }); - } -} - -class AddExaminationDailog extends StatefulWidget { - final List mySelectedExamination; - final Function addSelectedExamination; - final Function (MasterKeyModel) removeExamination; - - const AddExaminationDailog( - {Key key, this.mySelectedExamination, this.addSelectedExamination, this.removeExamination}) - : super(key: key); - - @override - _AddExaminationDailogState createState() => _AddExaminationDailogState(); -} - -class _AddExaminationDailogState extends State { - @override - Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.physicalExaminationList.length == 0) { - await model.getMasterLookup( - MasterKeysService.PhysicalExamination); - } - }, - builder: (_, model, w) => - AppScaffold( - // baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Examinations", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.physicalExaminationList, - removeHistory: (history){ - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (history){ - setState(() { - MySelectedExamination mySelectedExamination = new MySelectedExamination( - selectedExamination: history - ); - widget - .mySelectedExamination - .add( - mySelectedExamination); - }); - }, - addSelectedHistories: (){ - widget.addSelectedExamination(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ), - - ]), - ))), - )), - ); - } - - isServiceSelected(MasterKeyModel masterKey) { - Iterable exam = - widget - .mySelectedExamination - .where((element) => - masterKey.id == element.selectedExamination.id && - masterKey.typeId == element.selectedExamination.typeId); - if (exam.length > 0) { - return true; - } - return false; - } -} diff --git a/lib/widgets/patients/profile/SOAP/plan_page.dart b/lib/widgets/patients/profile/SOAP/plan_page.dart deleted file mode 100644 index 1bde4b6c..00000000 --- a/lib/widgets/patients/profile/SOAP/plan_page.dart +++ /dev/null @@ -1,349 +0,0 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -class PlanPage extends StatefulWidget { - final Function changePageViewIndex; - final PatiantInformtion patientInfo; - - PlanPage({Key key, this.changePageViewIndex, this.patientInfo}); - - @override - _PlanPageState createState() => _PlanPageState(); -} - -class _PlanPageState extends State { - bool isProgressNoteExpand = false; - - List progressNoteList; - - TextEditingController progressNoteController = - TextEditingController(text: null); - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 0.5, - )), - ); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('Progress Note', - variant: - isProgressNoteExpand ? "bodyText" : '', - bold: isProgressNoteExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isProgressNoteExpand = - !isProgressNoteExpand; - }); - }, - child: Icon(isProgressNoteExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column(children: [ - SizedBox( - height: 20, - ), - Column( - children: [ - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Progress Note", - fontSize: 13.5, - onTapTextFields: () { - openProgressNote(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - if (progressNoteController.text.isNotEmpty) - Container( - margin: - EdgeInsets.only(left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Padding( - padding: const EdgeInsets.all(0.0), - child: Container( - width: MediaQuery - .of(context) - .size - .width * 0.6, - child: AppText( - progressNoteController.text, - fontSize: 10, - - color: Colors.grey, - ), - ), - ), - ], - ), SizedBox( - height: 8, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Created By : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah on 12 De", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Edited By : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Rahim on 13 Dec", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openProgressNote(context); - }, - child: Icon(EvaIcons.edit2Outline), - ) - ], - ), - ], - ), - ) - ], - ) - ]), - isExpand: isProgressNoteExpand, - ), - DividerWithSpacesAround(height: 30,), - AppButton( - title: TranslationBase - .of(context) - .next, - loading: model.state == ViewState.BusyLocal, - onPressed: () { - - submitPlan(model); - // widget.changePageViewIndex(2); - }, - ), - SizedBox( - height: 30, - ), - ], - ), - ), - ), - ),),); - } - - submitPlan(SOAPViewModel model) async { - if (progressNoteController.text.isNotEmpty) { - PostProgressNoteRequestModel postProgressNoteRequestModel = new PostProgressNoteRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text); - - - await model.postProgressNote(postProgressNoteRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - Navigator.of(context).pop(); - } - } - - // Navigator.of(context).pop(); - } - - openProgressNote(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return FractionallySizedBox( - heightFactor: 0.5, - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - "Add Progress Note", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Add progress note here", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 16, - minLines: 8, - controller: progressNoteController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ),SizedBox( - height: 10, - ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () { - Navigator.of(context).pop(); - }, - ), - ]), - )), - ); - }); - } -} diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart deleted file mode 100644 index 43748f3d..00000000 --- a/lib/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart +++ /dev/null @@ -1,339 +0,0 @@ -import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:provider/provider.dart'; - -class AddAllergiesWidget extends StatefulWidget { - final List myAllergiesList; - - AddAllergiesWidget({Key key, this.myAllergiesList}); - - @override - _AddAllergiesWidgetState createState() => _AddAllergiesWidgetState(); -} - -class _AddAllergiesWidgetState extends State { - - TextEditingController remarkController = TextEditingController(); - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return Column( - children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Allergies", - fontSize: 13.5, - onTapTextFields: () { - openAllergiesList(context); - }, - readOnly: true, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), - variant: "bodyText", bold: true, color: Colors.black), - Texts( - selectedAllergy.selectedAllergySeverity.nameEn - .toUpperCase(), - variant: "bodyText", - bold: true, - color: AppGlobal.appPrimaryColor), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeAllergy(selectedAllergy), - ) - ], - ), - SizedBox( - height: 10, - ), - ], - ); - }).toList()), - ) - ], - ); - } - - removeAllergy(MySelectedAllergy mySelectedAllergy) { - Iterable allergy = - widget.myAllergiesList.where((element) => mySelectedAllergy == element); - - if (allergy.length > 0) - setState(() { - widget.myAllergiesList.remove(allergy.first); - }); - } - - openAllergiesList(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddAllergies( - addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - setState(() { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - }); - },); - }); - } - -} - -class AddAllergies extends StatefulWidget { - final Function addAllergiesFun; - - const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); - - @override - _AddAllergiesState createState() => _AddAllergiesState(); -} - -class _AddAllergiesState extends State { - List allergiesList; - List allergySeverityList; - MasterKeyModel _selectedAllergySeverity; - MasterKeyModel _selectedAllergy; - TextEditingController remarkController = TextEditingController(); - - - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon?? Icons.arrow_drop_down) : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - bool _isShowSearch = false; - GlobalKey key = new GlobalKey>(); - - @override - Widget build(BuildContext context) { - ProjectViewModel projectViewModel = Provider.of(context); - final screenSize = MediaQuery - .of(context) - .size; - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.allergiesList.length == 0) { - await model.getMasterLookup(MasterKeysService.Allergies); - } - if (model.allergySeverityList.length == 0) { - await model.getMasterLookup(MasterKeysService.AllergySeverity); - } - }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - isShowAppBar: false, - body: SingleChildScrollView( - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - - SizedBox( - height: 16, - ), - AppText( - "Add Allergy", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - }); - } - : null, - child: _selectedAllergy==null? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), - itemSubmitted: (item) => setState(() => _selectedAllergy = item), - key: key, - suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => new Padding( - child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), - padding: EdgeInsets.all(8.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()), - ):TextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergySeverityList != null - ? () { - MasterKeyDailog dialog = MasterKeyDailog( - list: model.allergySeverityList, - okText: TranslationBase - .of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - _selectedAllergySeverity = - selectedValue; - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - "Select Severity", - _selectedAllergySeverity != null - ? _selectedAllergySeverity.nameEn - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only( - left: 0, right: 0, top: 15), - child: TextFields( - hintText: "Remarks", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: remarkController, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), SizedBox( - height: 10, - ), - AppButton( - title: "Add".toUpperCase(), - onPressed: () { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - selectedAllergySeverity: _selectedAllergySeverity); - widget.addAllergiesFun(mySelectedAllergy); - }, - ), - ] - - ), - ), - ), - )), - ), - ); - } -} - - - - - diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart deleted file mode 100644 index 6e7bbe00..00000000 --- a/lib/widgets/patients/profile/SOAP/subjective/add_history_widget.dart +++ /dev/null @@ -1,360 +0,0 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../../shared/master_key_checkbox_search_widget.dart'; - -class AddHistoryWidget extends StatefulWidget { - final List myHistoryList; - - const AddHistoryWidget({Key key, this.myHistoryList}) : super(key: key); - - @override - _AddHistoryWidgetState createState() => _AddHistoryWidgetState(); -} - -class _AddHistoryWidgetState extends State - with TickerProviderStateMixin { - PageController _controller; - int _currentIndex = 0; - - changePageViewIndex(pageIndex) { - _controller.jumpToPage(pageIndex); - } - - @override - void initState() { - _controller = new PageController(); - - super.initState(); - } - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add History", - fontSize: 13.5, - onTapTextFields: () { - openHistoryList(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: widget.myHistoryList.map((myHistory) { - return Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Texts(myHistory.nameEn, - variant: "bodyText", bold: true, color: Colors.black), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeHistory(myHistory), - ) - ], - ), - SizedBox( - height: 20, - ), - ], - ); - }).toList(), - ), - ) - ], - ); - } - - removeHistory(MasterKeyModel masterKey) { - Iterable history = widget.myHistoryList.where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); - - if (history.length > 0) - setState(() { - widget.myHistoryList.remove(history.first); - }); - } - - openHistoryList(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return AddHistoryDialog( - changePageViewIndex: changePageViewIndex, - controller: _controller, - myHistoryList: widget.myHistoryList, - addSelectedHistories: () { - setState(() { - Navigator.of(context).pop(); - }); - }, - removeHistory: (masterKey) => removeHistory(masterKey), - ); - }); - } -} - -class PriorityBar extends StatefulWidget { - final Function onTap; - - const PriorityBar({Key key, this.onTap}) : super(key: key); - - @override - _PriorityBarState createState() => _PriorityBarState(); -} - -class _PriorityBarState extends State { - int _activePriority = 0; - - List _priorities = [ - "Family", - "Surgical/Sports", - "Medical", - ]; - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 2.0, - )), - ); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - - return Container( - height: screenSize.height * 0.070, - decoration: - containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { - bool _isActive = _priorities[_activePriority] == item ? true : false; - return Expanded( - child: InkWell( - child: Center( - child: Container( - height: screenSize.height * 0.070, - decoration: containerBorderDecoration( - _isActive ? HexColor("#B8382B") : Colors.white, - _isActive ? HexColor("#B8382B") : Colors.white), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - fontWeight: FontWeight.bold, - ), - ), - )), - ), - onTap: () { - widget.onTap(_priorities.indexOf(item)); - - setState(() { - _activePriority = _priorities.indexOf(item); - }); - }), - ); - }).toList(), - ), - ); - } -} - -class AddHistoryDialog extends StatefulWidget { - final Function changePageViewIndex; - final PageController controller; - final List myHistoryList; - final Function addSelectedHistories; - final Function (MasterKeyModel) removeHistory; - - const AddHistoryDialog( - {Key key, this.changePageViewIndex, this.controller, this.myHistoryList, this.addSelectedHistories, this.removeHistory}) - : super(key: key); - - @override - _AddHistoryDialogState createState() => _AddHistoryDialogState(); -} - -class _AddHistoryDialogState extends State { - @override - Widget build(BuildContext context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: BaseView( - onModelReady: (model) async { - if (model.historyFamilyList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistoryFamily); - } - }, - builder: (_, model, w) => AppScaffold( - // baseViewModel: model, - isShowAppBar: false, - body: Center( - child: Container( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 10, - ), - PriorityBar(onTap: (activePriority) async { - widget.changePageViewIndex(activePriority); - if(activePriority ==1) { - if (model.historySurgicalList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistorySurgical); - await model.getMasterLookup(MasterKeysService.HistorySports); - } - } - if(activePriority ==2) { - if (model.historyMedicalList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistoryMedical); - } - } - }), - SizedBox( - height: 20, - ), - Expanded( - child: PageView( - physics: NeverScrollableScrollPhysics(), - controller: widget.controller, - onPageChanged: (index) { - setState(() { - // currentIndex = index; - }); - }, - scrollDirection: Axis.horizontal, - children: [ - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - widget.myHistoryList.add(history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - widget.myHistoryList.add(history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - widget.myHistoryList.add(history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), - ], - ), - ), - ], - ), - )), - ), - ), - )); - } - - bool isServiceSelected(MasterKeyModel masterKey) { - Iterable history = - widget.myHistoryList.where((element) => masterKey.id == element.id && masterKey.typeId == element.typeId); - - if (history.length > 0) { - return true; - } - return false; - } - -} diff --git a/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart b/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart deleted file mode 100644 index 1db7c2e0..00000000 --- a/lib/widgets/patients/profile/SOAP/subjective/add_medication_widget.dart +++ /dev/null @@ -1,107 +0,0 @@ - -import 'package:doctor_app_flutter/config/config.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/TextFields.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -class AddMedication extends StatefulWidget { - @override - _AddMedicationState createState() => _AddMedicationState(); -} - -class _AddMedicationState extends State { - @override - Widget build(BuildContext context) { - return Column( - children: [ - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Current Medications", - fontSize: 13.5, - onTapTextFields: () { - openMedicationsList(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, - validator: (value) { - if (value == null) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Abdomen Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Back Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - ], - ), - ) - ], - ); - } - openMedicationsList(BuildContext context) { - showModalBottomSheet( - backgroundColor: Colors.white, - isScrollControlled: true, - context: context, - builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: Center( - child: Texts("dfdfd"), - )), - ); - }); - } - -} - diff --git a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart b/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart deleted file mode 100644 index 2514c463..00000000 --- a/lib/widgets/patients/profile/SOAP/subjective/subjective_page.dart +++ /dev/null @@ -1,402 +0,0 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_allergies_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/add_history_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; - -class SubjectivePage extends StatefulWidget { - final Function changePageViewIndex; - final List myAllergiesList; - final List myHistoryList; - final PatiantInformtion patientInfo; - - SubjectivePage( - {Key key, - this.changePageViewIndex, - this.myAllergiesList, - this.myHistoryList, - this.patientInfo}); - - @override - _SubjectivePageState createState() => _SubjectivePageState(); -} - -class _SubjectivePageState extends State { - bool isChiefExpand = false; - bool isHistoryExpand = false; - bool isAllergiesExpand = false; - TextEditingController illnessController = TextEditingController(); - TextEditingController complaintsController = TextEditingController(); - final formKey = GlobalKey(); - - @override - Widget build(BuildContext context) { - return BaseView( - // onModelReady: (model) => model.getMasterLookup(MasterKeysService.Allergies), - builder: (_, model, w) => AppScaffold( - isShowAppBar: false, - baseViewModel: model, - body: SingleChildScrollView( - physics: ScrollPhysics(), - child: Center( - child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('CHIEF COMPLAINTS', - variant: isChiefExpand ? "bodyText" : '', - bold: isChiefExpand ? true : false, - color: Colors.black), - Icon( - FontAwesomeIcons.asterisk, - color: AppGlobal.appPrimaryColor, - size: 12, - ) - ], - ), - InkWell( - onTap: () { - setState(() { - isChiefExpand = !isChiefExpand; - }); - }, - child: Icon( - isChiefExpand ? EvaIcons.minus : EvaIcons.plus)) - ], - ), - bodyWidget: Form( - key: formKey, - child: Column(children: [ - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Chief Complaints", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: complaintsController, - validator: (value) { - if (value == null || value == "") - return TranslationBase.of(context) - .emptyMessage; - else if (value.length < 25) - return TranslationBase.of(context) - .chiefComplaintLength; - //""; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "History of Present Illness", - fontSize: 13.5, - // hintColor: Colors.black, - fontWeight: FontWeight.w600, - maxLines: 25, - minLines: 13, - controller: illnessController, - validator: (value) { - if (value == null || value =="") - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: 20, - ), - // TODO return it back when we need it. - // AddMedication(), - ]), - ), - isExpand: isChiefExpand, - ), - - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('History'.toUpperCase(), - variant: isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( - children: [ - AddHistoryWidget(myHistoryList: widget.myHistoryList) - ], - ), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts('Allergies'.toUpperCase(), - variant: isAllergiesExpand ? "bodyText" : '', - bold: isAllergiesExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isAllergiesExpand = !isAllergiesExpand; - }); - }, - child: Icon(isAllergiesExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( - children: [ - AddAllergiesWidget( - myAllergiesList: widget.myAllergiesList, - ), - SizedBox( - height: 30, - ), - ], - ), - isExpand: isAllergiesExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - AppButton( - title: TranslationBase.of(context).next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - addSubjectiveInfo( - model: model, - myAllergiesList: widget.myAllergiesList, - myHistoryList: widget.myHistoryList); - }, - ), - ], - ), - ), - ), - ), - ), - ); - } - - addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { - formKey.currentState.save(); - formKey.currentState.validate(); - - - // if(complaintsController.text.isNotEmpty && illnessController.text.isNotEmpty && complaintsController.text.length>25) { - // await postChiefComplaint(model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myHistoryList.length != 0) { - // await postHistories(model: model, myHistoryList: myHistoryList); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // - // } - // - // } - // } else { - // if (myAllergiesList.length != 0) { - // await postAllergy(myAllergiesList: myAllergiesList, model: model); - // if (model.state == ViewState.ErrorLocal) { - // helpers.showErrorToast(model.error); - // } else { - // widget.changePageViewIndex(1); - // } - // } else { - // widget.changePageViewIndex(1); - // } - // } - // } - // } else { - // helpers.showErrorToast('Please add required field correctly'); - // } - - widget.changePageViewIndex(1); - - } - - postAllergy( - {List myAllergiesList, SOAPViewModel model}) async { - PostAllergyRequestModel postAllergyRequestModel = - new PostAllergyRequestModel(); - widget.myAllergiesList.forEach((allergy) { - if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == - null) - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - //TODO: make static value dynamic - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM - .add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 4709, - // - createdOn: DateTime.now() - .toIso8601String(), //"2020-08-14T20:37:22.780Z", - editedBy: 4709, - editedOn: DateTime.now() - .toIso8601String(), //"2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false)); - }); - await model.postAllergy(postAllergyRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } - } - - postHistories( - {List myHistoryList, SOAPViewModel model}) async { - PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); - widget.myHistoryList.forEach((history) { - if (postHistoriesRequestModel.listMedicalHistoryVM == null) - postHistoriesRequestModel.listMedicalHistoryVM = []; - //TODO: make static value dynamic - postHistoriesRequestModel.listMedicalHistoryVM.add(ListMedicalHistoryVM( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: "", - historyId: history.id, - historyType: history.typeId, - isChecked: false, - )); - }); - await model.postHistories(postHistoriesRequestModel); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } - } - - postChiefComplaint({SOAPViewModel model}) async { - formKey.currentState.save(); - if (formKey.currentState.validate()) { - PostChiefComplaintRequestModel postChiefComplaintRequestModel = - //TODO: make static value dynamic - new PostChiefComplaintRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - chiefComplaint: complaintsController.text, - currentMedication: " currentMedication ", - hopi: illnessController.text, - isLactation: false, - ispregnant: false, - numberOfWeeks: 22); - - await model.postChiefComplaint(postChiefComplaintRequestModel); - } - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 86789475..016b5972 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -33,16 +33,16 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - nameLine1: "Create New", - nameLine2: "Episode", + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, route: CREATE_EPISODE, icon: 'create-episod.png'), if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, - nameLine1: "Update", - nameLine2: "Episode", + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), Visibility( diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index d67d94e3..56f3435e 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -295,7 +295,7 @@ class StepsWidget extends StatelessWidget { height: index == 0 ? 5 : 10, ), AppText( - "SUBJECTIVE", + "شخصي", fontWeight: FontWeight.bold, fontSize: 16, ), @@ -345,7 +345,7 @@ class StepsWidget extends StatelessWidget { height: index == 1 ? 5 : 10, ), AppText( - "OBJECTIVE", + "هدف", fontWeight: FontWeight.bold, fontSize: 14, ), @@ -398,7 +398,7 @@ class StepsWidget extends StatelessWidget { padding: const EdgeInsets.only(right: 2), child: AppText( - "ASSESSMENT", + "تقدير", fontWeight: FontWeight.bold, fontSize: 14, ), @@ -451,7 +451,7 @@ class StepsWidget extends StatelessWidget { Container( margin: EdgeInsets.only(right:index == 3? 15:0), child: AppText( - "PLAN", + "خطة", fontWeight: FontWeight.bold, fontSize: 14, ), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index f03025ae..5d54dfa5 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -33,14 +33,14 @@ class _UpdateAllergiesWidgetState extends State { @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add Allergies", + hintText: TranslationBase.of(context).addAllergies, fontSize: 13.5, onTapTextFields: () { openAllergiesList(context); @@ -80,13 +80,19 @@ class _UpdateAllergiesWidgetState extends State { Container( child: Expanded( - child: Texts(selectedAllergy.selectedAllergy.nameEn.toUpperCase(), - variant: "bodyText", bold: true, color: Colors.black), + child: Texts(projectViewModel.isArabic ? selectedAllergy + .selectedAllergy.nameAr : selectedAllergy + .selectedAllergy.nameEn.toUpperCase(), + variant: "bodyText", + bold: true, + color: Colors.black), ), width: MediaQuery.of(context).size.width * 0.5, ), Texts( - selectedAllergy.selectedAllergySeverity.nameEn + projectViewModel.isArabic ? selectedAllergy + .selectedAllergySeverity.nameAr : selectedAllergy + .selectedAllergySeverity.nameEn .toUpperCase(), variant: "bodyText", bold: true, @@ -131,8 +137,14 @@ class _UpdateAllergiesWidgetState extends State { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { setState(() { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); + if (!widget.myAllergiesList.contains(mySelectedAllergy)) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + } else { + helpers.showErrorToast(TranslationBase + .of(context) + .itemExist); + } }); },); }); @@ -215,7 +227,9 @@ class _AddAllergiesState extends State { height: 16, ), AppText( - "Add Allergy", + TranslationBase + .of(context) + .addAllergies, fontWeight: FontWeight.bold, fontSize: 16, ), @@ -233,18 +247,37 @@ class _AddAllergiesState extends State { } : null, child: _selectedAllergy==null? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), - itemSubmitted: (item) => setState(() => _selectedAllergy = item), + decoration: textFieldSelectorDecoration( + TranslationBase + .of(context) + .selectAllergy, + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, true, icon: EvaIcons.search), + itemSubmitted: (item) => + setState(() => _selectedAllergy = item), key: key, suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => new Padding( - child:Texts( projectViewModel.isArabic? suggestion.nameAr: suggestion.nameEn), + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + projectViewModel.isArabic ? suggestion + .nameAr : suggestion.nameEn), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.nameEn.toLowerCase().startsWith(input.toLowerCase()), + suggestion.nameAr.toLowerCase().startsWith( + input.toLowerCase()) || + suggestion.nameEn.toLowerCase() + .startsWith(input.toLowerCase()), ):TextField( - decoration: textFieldSelectorDecoration("Select Allergy", _selectedAllergy != null ? _selectedAllergy.nameEn : null, true,icon: EvaIcons.search), + decoration: textFieldSelectorDecoration( + TranslationBase + .of(context) + .selectAllergy, + _selectedAllergy != null + ? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn + : null, true, icon: EvaIcons.search), enabled: false, ), ), @@ -266,13 +299,6 @@ class _AddAllergiesState extends State { setState(() { _selectedAllergySeverity = selectedValue; - // model.getDoctorBranch().then((value) { - // _selectedBranch = value; - // if (_referTo['id'] == 1) { - // model.getClinics( - // _selectedBranch['ID']); - // } - // }); }); }, ); @@ -287,9 +313,11 @@ class _AddAllergiesState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - "Select Severity", + TranslationBase + .of(context) + .selectSeverity, _selectedAllergySeverity != null - ? _selectedAllergySeverity.nameEn + ? projectViewModel.isArabic?_selectedAllergySeverity.nameAr:_selectedAllergySeverity.nameEn : null, true), enabled: false, @@ -303,12 +331,12 @@ class _AddAllergiesState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( - hintText: "Remarks", + hintText: TranslationBase.of(context).remarks, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 25, - minLines: 13, + minLines: 10, controller: remarkController, validator: (value) { if (value == null) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index f720fdfd..ebed11ca 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -16,6 +17,7 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; class UpdateHistoryWidget extends StatefulWidget { final List myHistoryList; @@ -44,12 +46,13 @@ class _UpdateHistoryWidgetState extends State @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return Column( children: [ Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add History", + hintText: TranslationBase.of(context).addHistory, fontSize: 13.5, onTapTextFields: () { openHistoryList(context); @@ -83,7 +86,7 @@ class _UpdateHistoryWidgetState extends State children: [ Container( child: Expanded( - child: Texts(myHistory.nameEn, + child: Texts(projectViewModel.isArabic?myHistory.nameAr:myHistory.nameEn, variant: "bodyText", bold: true, color: Colors.black), ), width: MediaQuery.of(context).size.width * 0.7, @@ -152,12 +155,17 @@ class PriorityBar extends StatefulWidget { class _PriorityBarState extends State { int _activePriority = 0; - + int index =-1; List _priorities = [ "Family", "Surgical/Sports", "Medical", ]; + List _prioritiesAr = [ + "أسرة", + "جراحي / رياضي" , + "طبي", + ]; BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { @@ -175,6 +183,7 @@ class _PriorityBarState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return Container( height: screenSize.height * 0.070, @@ -183,8 +192,9 @@ class _PriorityBarState extends State { child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, - children: _priorities.map((item) { + children: _priorities.map((item,) { bool _isActive = _priorities[_activePriority] == item ? true : false; + index++; return Expanded( child: InkWell( child: Center( @@ -195,7 +205,7 @@ class _PriorityBarState extends State { _isActive ? HexColor("#B8382B") : Colors.white), child: Center( child: Text( - item, + (projectViewModel.isArabic)?_prioritiesAr[index]: item, style: TextStyle( fontSize: 12, color: _isActive diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 53007123..b9315a28 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -24,7 +24,6 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -import 'package:html/parser.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -52,10 +51,21 @@ class _UpdateSubjectivePageState extends State { final formKey = GlobalKey(); getHistory(SOAPViewModel model) async{ GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo - ); + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo.toString(), + appointmentNo: widget.patientInfo.appointmentNo); + + getHistoryReqModel.historyType = + MasterKeysService.HistoryFamily.getMasterKeyService(); + await model.getPatientHistories(getHistoryReqModel, isFirst: true); + getHistoryReqModel.historyType = + MasterKeysService.HistoryMedical.getMasterKeyService(); + await model.getPatientHistories(getHistoryReqModel); + getHistoryReqModel.historyType = + MasterKeysService.HistorySurgical.getMasterKeyService(); + await model.getPatientHistories(getHistoryReqModel); + getHistoryReqModel.historyType = + MasterKeysService.HistorySports.getMasterKeyService(); await model.getPatientHistories(getHistoryReqModel); if (model.patientHistoryList.isNotEmpty) { @@ -67,32 +77,51 @@ class _UpdateSubjectivePageState extends State { } if (model.historySurgicalList.length == 0) { await model.getMasterLookup(MasterKeysService.HistorySurgical); + } + if (model.historySportList.length == 0) { await model.getMasterLookup(MasterKeysService.HistorySports); } model.patientHistoryList.forEach((element) { - if (element.historyType == MasterKeysService.HistoryFamily.getMasterKeyService()) { - widget.myHistoryList.add( model.getOneMasterKey( + if (element.historyType == + MasterKeysService.HistoryFamily.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryFamily, id: element.historyId, - )); - }if (element.historyType == MasterKeysService.HistoryMedical.getMasterKeyService()) { - widget.myHistoryList.add( model.getOneMasterKey( + ); + if (history != null) { + widget.myHistoryList.add(history); + } + } + if (element.historyType == + MasterKeysService.HistoryMedical.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistoryMedical, id: element.historyId, - )); - }if (element.historyType == MasterKeysService.HistorySports.getMasterKeyService()) { - widget.myHistoryList.add( model.getOneMasterKey( + ); + if (history != null) { + widget.myHistoryList.add(history); + } + } + if (element.historyType == + MasterKeysService.HistorySports.getMasterKeyService()) { + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySports, id: element.historyId, - )); + ); + if (history != null) { + widget.myHistoryList.add(history); + } } if (element.historyType == MasterKeysService.HistorySurgical.getMasterKeyService()) { - widget.myHistoryList.add(model.getOneMasterKey( + MasterKeyModel history = model.getOneMasterKey( masterKeys: MasterKeysService.HistorySurgical, id: element.historyId, - )); + ); + if (history != null) { + widget.myHistoryList.add(history); + } } }); } @@ -165,7 +194,7 @@ class _UpdateSubjectivePageState extends State { children: [ Row( children: [ - Texts('CHIEF COMPLAINTS', + Texts(TranslationBase.of(context).chiefComplaints.toUpperCase(), variant: isChiefExpand ? "bodyText" : '', bold: isChiefExpand ? true : false, color: Colors.black), @@ -195,7 +224,9 @@ class _UpdateSubjectivePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add Chief Complaints", + hintText: TranslationBase + .of(context) + .addChiefComplaints, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -203,7 +234,7 @@ class _UpdateSubjectivePageState extends State { minLines: 13, controller: complaintsController, validator: (value) { - if (value == null || value =="") + if (value == null || value == "") return TranslationBase .of(context) .emptyMessage; @@ -211,7 +242,7 @@ class _UpdateSubjectivePageState extends State { return TranslationBase .of(context) .chiefComplaintLength; - //""; + //""; else return null; }), @@ -222,7 +253,9 @@ class _UpdateSubjectivePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "History of Present Illness", + hintText: TranslationBase + .of(context) + .historyOfPresentIllness, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -230,7 +263,7 @@ class _UpdateSubjectivePageState extends State { minLines: 13, controller: illnessController, validator: (value) { - if (value == null || value =="") + if (value == null || value == "") return TranslationBase .of(context) .emptyMessage; @@ -265,7 +298,10 @@ class _UpdateSubjectivePageState extends State { children: [ Row( children: [ - Texts('History'.toUpperCase(), + Texts(TranslationBase + .of(context) + .histories + .toUpperCase(), variant: isHistoryExpand ? "bodyText" : '', bold: isHistoryExpand ? true : false, color: Colors.black), @@ -306,7 +342,10 @@ class _UpdateSubjectivePageState extends State { children: [ Row( children: [ - Texts('Allergies'.toUpperCase(), + Texts(TranslationBase + .of(context) + .allergiesSoap + .toUpperCase(), variant: isAllergiesExpand ? "bodyText" : '', bold: isAllergiesExpand ? true : false, color: Colors.black), @@ -396,7 +435,9 @@ class _UpdateSubjectivePageState extends State { widget.changePageViewIndex(1); } else { - helpers.showErrorToast('Please add required field correctly'); + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 86e98e4b..20684e19 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -401,7 +401,7 @@ class _UpdateAssessmentPageState extends State { widget.changePageViewIndex(3); } } else { - helpers.showErrorToast('Please add required field correctly'); + helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } widget.changePageViewIndex(3); @@ -664,7 +664,7 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( - hintText: "Remarks", + hintText: TranslationBase.of(context).remarks, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 2abdfbae..e3aef3f4 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -306,7 +306,7 @@ class _UpdateObjectivePageState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( - hintText: "Remarks", + hintText: TranslationBase.of(context).remarks, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -390,7 +390,7 @@ class _UpdateObjectivePageState extends State { widget.changePageViewIndex(2); } } else { - helpers.showErrorToast('Please add required field correctly'); + helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } widget.changePageViewIndex(2); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 9e5dd82b..fee067f4 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -6,11 +6,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/assessment_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/objective_page.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/plan_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/SOAP/subjective/subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; diff --git a/lib/widgets/shared/dialogs/master_key_dailog.dart b/lib/widgets/shared/dialogs/master_key_dailog.dart index a3be364b..55046c3c 100644 --- a/lib/widgets/shared/dialogs/master_key_dailog.dart +++ b/lib/widgets/shared/dialogs/master_key_dailog.dart @@ -1,6 +1,8 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; // ignore: must_be_immutable class MasterKeyDailog extends StatefulWidget { @@ -30,10 +32,11 @@ class _MasterKeyDailogState extends State { @override Widget build(BuildContext context) { - return showAlertDialog(context); + ProjectViewModel projectViewModel = Provider.of(context); + return showAlertDialog(context, projectViewModel); } - showAlertDialog(BuildContext context) { + showAlertDialog(BuildContext context, ProjectViewModel projectViewModel) { // set up the buttons Widget cancelButton = FlatButton( child: Text(TranslationBase.of(context).cancel), @@ -49,7 +52,7 @@ class _MasterKeyDailogState extends State { // set up the AlertDialog AlertDialog alert = AlertDialog( // title: Text(widget.title), - content: createDialogList(), + content: createDialogList(projectViewModel), actions: [ cancelButton, continueButton, @@ -58,7 +61,7 @@ class _MasterKeyDailogState extends State { return alert; } - Widget createDialogList() { + Widget createDialogList(ProjectViewModel projectViewModel) { return Container( height: MediaQuery.of(context).size.height * 0.5, child: SingleChildScrollView( @@ -67,7 +70,7 @@ class _MasterKeyDailogState extends State { ...widget.list .map((item) => RadioListTile( title: Text( - '${item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), + '${projectViewModel.isArabic?item.nameAr:item.nameEn}' + (widget.isICD ? '/${item.code}' : '')), groupValue: widget.isICD ? widget.selectedValue.code.toString() : widget.selectedValue.id.toString(), diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index f164be4b..7cc8eaad 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -9,6 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class MasterKeyCheckboxSearchWidget extends StatefulWidget { final SOAPViewModel model; @@ -45,6 +48,8 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Sun, 3 Jan 2021 00:14:09 +0200 Subject: [PATCH 115/421] small fix --- lib/widgets/shared/master_key_checkbox_search_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index 7cc8eaad..aafb8adc 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -100,7 +100,7 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Sun, 3 Jan 2021 00:17:01 +0200 Subject: [PATCH 116/421] small fix remove todo --- lib/client/base_app_client.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 75894465..83923ea7 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -83,7 +83,6 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - // TODO: return it back when IsAuthenticated work fine in all service await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian'); } else From 7d550ca15fd7c53b298ede6c6d7110d95627ac98 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 00:32:59 +0200 Subject: [PATCH 117/421] prevent null --- .../soap_update/subjective/update_subjective_page.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index b9315a28..98d1b7d0 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -166,8 +166,8 @@ class _UpdateSubjectivePageState extends State { MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: selectedAllergy, selectedAllergySeverity: selectedAllergySeverity); - - widget.myAllergiesList.add(mySelectedAllergy); + if (selectedAllergy != null && selectedAllergySeverity != null) + widget.myAllergiesList.add(mySelectedAllergy); }); } From 6a8c37e0d759d180caa32e48ded9db31a707f8e6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 3 Jan 2021 09:14:59 +0300 Subject: [PATCH 118/421] doctor leave --- lib/config/localized_values.dart | 1 + .../add-rescheduleleave.dart | 31 +++++++++++++++++++ .../reschedule-leaves/reschedule_leave.dart | 12 ++++--- lib/util/translations_delegate_base.dart | 1 + pubspec.lock | 13 ++++++-- 5 files changed, 50 insertions(+), 8 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 05d91477..1490c7bc 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -479,4 +479,5 @@ const Map> localizedValues = { }, 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, + 'reasons': {'en': "Reasons", 'ar': 'الأسباب'}, }; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index c48eee79..a4739247 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_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/sickleave/get_all_sickleave_response.dart'; @@ -15,10 +16,13 @@ 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'; +import 'package:provider/provider.dart'; class AddRescheduleLeavScreen extends StatelessWidget { + ProjectViewModel projectsProvider; @override Widget build(BuildContext context) { + projectsProvider = Provider.of(context); return BaseView( onModelReady: (model) => {model.getRescheduleLeave(), model.getCoveringDoctors()}, @@ -157,6 +161,21 @@ class AddRescheduleLeavScreen extends StatelessWidget { item.doctorId)) ]) : SizedBox(), + AppText( + TranslationBase.of( + context) + .reasons, + fontWeight: + FontWeight.bold, + ), + model.allReasons.length > 0 + ? Row(children: [ + AppText(getReasons( + model + .allReasons, + item.reasonId)) + ]) + : SizedBox(), ], ), SizedBox( @@ -258,4 +277,16 @@ class AddRescheduleLeavScreen extends StatelessWidget { return obj.length > 0 ? obj[0]['doctorName'] : ""; } + + getReasons(model, reasonID) { + var obj; + obj = model.where((i) => i['id'] == reasonID).toList(); + print(obj); + + return obj.length > 0 + ? projectsProvider.isArabic == true + ? obj[0]['nameAr'] + : obj[0]['nameEn'] + : ""; + } } diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 1a807392..c74395a3 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -732,16 +732,18 @@ class _RescheduleLeaveScreen extends State { getProfile() async { Map p = await sharedPref.getObj(DOCTOR_PROFILE); setState(() { - this.profile = p; - this.clinicID = widget.updateData.clinicId; + if (widget.updateData != null) { + this.profile = p; + this.clinicID = widget.updateData.clinicId; - _toDateController.text = widget.updateData.dateTimeFrom; - _toDateController2.text = widget.updateData.dateTimeTo; + _toDateController.text = widget.updateData.dateTimeFrom; + _toDateController2.text = widget.updateData.dateTimeTo; + } }); } getClinicName(model) { - var clinicID = this.profile != null ? this.profile['ClinicID'] : 1; + var clinicID = this.profile['ClinicID'] ?? 1; var clinicInfo = model.clinicsList.where((i) => i['ClinicID'] == clinicID).toList(); return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f54e641d..b9aac20a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -503,6 +503,7 @@ class TranslationBase { String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String get reasons => localizedValues['reasons'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index 9cbacb6d..7f1d8c1d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -260,6 +260,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.3.10" + date_time_picker: + dependency: "direct main" + description: + name: date_time_picker + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" device_info: dependency: "direct main" description: @@ -496,7 +503,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: @@ -753,7 +760,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: @@ -888,5 +895,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 4b5bec8c506f7c5bdaa91bac5e60288cb5a38437 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Jan 2021 10:39:53 +0200 Subject: [PATCH 119/421] working on UCAF design --- lib/config/localized_values.dart | 2 + lib/routes.dart | 3 + .../profile/UCAF/UCAF-detail-screen.dart | 107 ++++++++++++++++++ .../profile/UCAF/UCAF-input-screen.dart | 76 +------------ .../referral/refer-patient-screen.dart | 2 +- lib/util/translations_delegate_base.dart | 2 + .../profile/PatientHeaderWidgetNoAvatar.dart | 73 ++++++++++++ pubspec.lock | 8 +- 8 files changed, 197 insertions(+), 76 deletions(-) create mode 100644 lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart create mode 100644 lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 85954bb0..31c15e11 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -431,4 +431,6 @@ const Map> localizedValues = { 'itemExist': {'en': "This item already exist", 'ar':"هذا العنصر موجود" }, 'selectAllergy': {'en': "Select Allergy", 'ar':"أختر الحساسية" }, 'selectSeverity': {'en': "Select Severity", 'ar':"أختر الدرجه" }, + 'medications': {'en': "Medications", 'ar':"الأدوية" }, + 'procedures': {'en': "Procedures", 'ar':"الإجراءات" }, }; diff --git a/lib/routes.dart b/lib/routes.dart index 962df032..e57b56a7 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/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'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; @@ -91,6 +92,7 @@ const String PATIENT_ADMISSION_REQUEST = 'patients/admission-request'; 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 BODY_MEASUREMENTS = 'patients/body-measurements'; const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; @@ -155,4 +157,5 @@ var routes = { // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() MY_REFERRAL_DETAIL: (_) => MyReferralDetailScreen(), PATIENT_UCAF_REQUEST: (_) => UCAFInputScreen(), + PATIENT_UCAF_DETAIL: (_) => UcafDetailScreen(), }; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart new file mode 100644 index 00000000..7fc16bfb --- /dev/null +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -0,0 +1,107 @@ +import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.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/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class UcafDetailScreen extends StatefulWidget { + @override + _UcafDetailScreenState createState() => _UcafDetailScreenState(); +} + +class _UcafDetailScreenState extends State { + + int _activeTap = 1; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).ucaf, + body: Container( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientHeaderWidgetNoAvatar(patient), + SizedBox( + height: 10, + ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + children: [ + treatmentStepsBar(context, screenSize), + SizedBox( + height: 16, + ), + ], + ), + ), + ], + ), + ), + ), + )); + } + + Widget treatmentStepsBar(BuildContext _context, Size screenSize) { + List __treatmentSteps = [ + TranslationBase.of(context).diagnosis.toUpperCase(), + TranslationBase.of(context).medications.toUpperCase(), + TranslationBase.of(context).procedures.toUpperCase(), + ]; + return Container( + height: screenSize.height * 0.070, + decoration: + Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: __treatmentSteps.map((item) { + bool _isActive = __treatmentSteps[_activeTap] == item ? true : false; + return Expanded( + child: InkWell( + child: Center( + child: Container( + height: screenSize.height * 0.070, + decoration: Helpers.containerBorderDecoration( + _isActive ? HexColor("#B8382B") : Colors.white, + _isActive ? HexColor("#B8382B") : Colors.white), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + fontWeight: FontWeight.bold, + ), + ), + )), + ), + onTap: () { + print(__treatmentSteps.indexOf(item)); + setState(() { + _activeTap = __treatmentSteps.indexOf(item); + }); + }, + ), + ); + }).toList(), + ), + ); + } + +} diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 82b01144..e0c2f9a7 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -5,6 +5,7 @@ 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/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -12,6 +13,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../routes.dart'; + class UCAFInputScreen extends StatefulWidget { @override _UCAFInputScreenState createState() => _UCAFInputScreenState(); @@ -58,7 +61,7 @@ class _UCAFInputScreenState extends State { body: SingleChildScrollView( child: Column( children: [ - PatientHeaderWidget(patient), + PatientHeaderWidgetNoAvatar(patient), Container( margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( @@ -349,7 +352,7 @@ class _UCAFInputScreenState extends State { title: TranslationBase.of(context).next, color: HexColor("#B8382B"), onPressed: (){ - // Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient}); + Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {'patient': patient}); }, ), ], @@ -362,72 +365,3 @@ class _UCAFInputScreenState extends State { ); } } - -class PatientHeaderWidget extends StatelessWidget { - final PatiantInformtion patient; - - PatientHeaderWidget(this.patient); - - @override - Widget build(BuildContext context) { - return Column( - children: [ - Container( - margin: EdgeInsets.all(16), - child: Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.2, - ), - Row( - children: [ - AppText( - "VIP", - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.2, - ), - SizedBox( - width: 8, - ), - AppText( - " ${patient.age}", - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - ], - ), - AppText( - "NEW VISIT", - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - AppText( - "${patient.companyName}", - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - ], - ), - ), - Icon( - Icons.info_outline, - color: Colors.black, - ), - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ], - ); - } -} diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 7a210b98..3ca6c9b3 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -19,7 +19,7 @@ import 'package:hexcolor/hexcolor.dart'; import '../../../QR_reader_screen.dart'; class PatientMakeReferralScreen extends StatefulWidget { - // previous design page is: MyReferralPatient + // previous design page is: ReferPatientScreen @override _PatientMakeReferralScreenState createState() => _PatientMakeReferralScreenState(); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e928f521..e4243035 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -455,6 +455,8 @@ class TranslationBase { String get createNew => localizedValues['createNew'][locale.languageCode]; String get update => localizedValues['update'][locale.languageCode]; String get episode => localizedValues['episode'][locale.languageCode]; + String get medications => localizedValues['medications'][locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints=> localizedValues['chiefComplaints'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart new file mode 100644 index 00000000..25bc80e4 --- /dev/null +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -0,0 +1,73 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +class PatientHeaderWidgetNoAvatar extends StatelessWidget { + final PatiantInformtion patient; + + PatientHeaderWidgetNoAvatar(this.patient); + + @override + Widget build(BuildContext context) { + return Column( + children: [ + Container( + margin: EdgeInsets.all(16), + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + Row( + children: [ + AppText( + "VIP", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.2, + ), + SizedBox( + width: 8, + ), + AppText( + " ${patient.age}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + AppText( + "NEW VISIT", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "${patient.companyName}", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + ), + Icon( + Icons.info_outline, + color: Colors.black, + ), + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index 9cbacb6d..61cc667f 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -454,7 +454,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -496,7 +496,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: @@ -753,7 +753,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: @@ -888,5 +888,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 0c39dc66936f721700b83389b74de1b07ac50a41 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Jan 2021 10:58:14 +0200 Subject: [PATCH 120/421] change on vital signs for uncoment the service --- lib/config/localized_values.dart | 1 + .../service/patient-vital-signs-service.dart | 11 ++++--- .../patient-vital-sign-viewmodel.dart | 27 ++++++---------- .../vital_sign/vital-signs-screen.dart | 32 +++++++++---------- lib/util/translations_delegate_base.dart | 1 + 5 files changed, 32 insertions(+), 40 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 31c15e11..e9b01caf 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -433,4 +433,5 @@ const Map> localizedValues = { 'selectSeverity': {'en': "Select Severity", 'ar':"أختر الدرجه" }, 'medications': {'en': "Medications", 'ar':"الأدوية" }, 'procedures': {'en': "Procedures", 'ar':"الإجراءات" }, + 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, }; diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index d508fec6..31c8721d 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; @@ -46,18 +47,18 @@ class VitalSignsService extends BaseService{ ); } // Vit*/ - Future getPatientVitalSign(PatientArrivalEntity patientArrivalEntity) async { + Future getPatientVitalSign(PatiantInformtion patient) async { hasError = false; Map body = Map(); - body['PatientMRN'] = patientArrivalEntity.patientMRN; - body['AppointmentNo'] = patientArrivalEntity.appointmentNo; - body['EpisodeID'] = patientArrivalEntity.episodeNo; + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { if(response['VitalSignsList'] != null){ - if(response['VitalSignsList']['entityList'] = null && (response['VitalSignsList']['entityList'] as List).length > 0){ + if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']); } } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index e58ad089..f53def7b 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -16,17 +16,17 @@ class VitalSignsViewModel extends BaseViewModel { VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; - Future getPatientArrivalList(String date, PatiantInformtion patient, + /*Future getPatientArrivalList(String date, PatiantInformtion patient, {String fromDate}) async { // TODO when arrival list work un comment below lines - /* setState(ViewState.Busy); + *//* setState(ViewState.Busy); await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate); if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); } else { await getPatientVitalSign(patient); - }*/ + }*//* makeVitalSignDemoData(); } @@ -43,27 +43,18 @@ class VitalSignsViewModel extends BaseViewModel { // print("patient index: $index"); } return null; - } + }*/ Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); - PatientArrivalEntity patientArrivalEntity = - getPatientAppointmentEntity(patient); - if (patientArrivalEntity == null) { - _vitalSignService.hasError = true; - error = "There is no appointments for this patient"; - setState(ViewState.Error); - return; - } - await _vitalSignService.getPatientVitalSign(patientArrivalEntity); - // TODO remove (not) from below condition - if (!_vitalSignService.hasError) { + await _vitalSignService.getPatientVitalSign(patient); + if (_vitalSignService.hasError) { error = _vitalSignService.error; setState(ViewState.Error); } else { - if (patientVitalSigns == null) { - makeVitalSignDemoData(); - } + // if (patientVitalSigns == null) { + // makeVitalSignDemoData(); + // } setState(ViewState.Idle); } } diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index 107e2e6b..c66555c1 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -11,6 +11,7 @@ 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/expandable-widget-header-body.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class PatientVitalSignScreen extends StatelessWidget { @override @@ -19,10 +20,7 @@ class PatientVitalSignScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPatientArrivalList( - DateUtils.convertDateToFormat(DateTime.now(), "yyyy-MM-dd"), patient, - fromDate: DateUtils.convertDateToFormat( - DateTime.now().subtract(Duration(days: 500)), "yyyy-MM-dd")), + onModelReady: (model) => model.getPatientVitalSign(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).vitalSign, @@ -213,10 +211,12 @@ class PatientVitalSignScreen extends StatelessWidget { Container( color: Colors.green, child: Padding( - padding: EdgeInsets.symmetric(vertical: 2, horizontal: 8), + padding: EdgeInsets.symmetric( + vertical: 2, horizontal: 8), child: AppText( "${model.getBMI(model.patientVitalSigns.bodyMassIndex)}", - fontSize: SizeConfig.textMultiplier * 2, + fontSize: + SizeConfig.textMultiplier * 2, color: Colors.white, fontWeight: FontWeight.bold, ), @@ -357,7 +357,14 @@ class PatientVitalSignScreen extends StatelessWidget { ), ), ) - : Container(), + : Center( + child: AppText( + "${TranslationBase.of(context).vitalSignEmptyMsg}", + fontSize: SizeConfig.textMultiplier * 2.5, + color: HexColor("#B8382B"), + fontWeight: FontWeight.normal, + ), + ), ), ); } @@ -485,7 +492,6 @@ class _TemperatureWidgetState extends State { } class PulseWidget extends StatefulWidget { - final VitalSignData vitalSign; PulseWidget(this.vitalSign); @@ -496,6 +502,7 @@ class PulseWidget extends StatefulWidget { class _PulseWidgetState extends State { bool isExpand = false; + @override Widget build(BuildContext context) { return Container( @@ -578,7 +585,6 @@ class _PulseWidgetState extends State { } class RespirationWidget extends StatefulWidget { - final VitalSignData vitalSign; RespirationWidget(this.vitalSign); @@ -672,7 +678,6 @@ class _RespirationWidgetState extends State { } class BloodPressureWidget extends StatefulWidget { - final VitalSignData vitalSign; BloodPressureWidget(this.vitalSign); @@ -812,7 +817,6 @@ class _BloodPressureWidgetState extends State { } class OxygenationWidget extends StatefulWidget { - final VitalSignData vitalSign; OxygenationWidget(this.vitalSign); @@ -906,7 +910,6 @@ class _OxygenationWidgetState extends State { } class PainScaleWidget extends StatefulWidget { - final VitalSignData vitalSign; PainScaleWidget(this.vitalSign); @@ -998,8 +1001,3 @@ class _PainScaleWidgetState extends State { ); } } - - - - - diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e4243035..3b1950db 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -472,6 +472,7 @@ class TranslationBase { String get itemExist => localizedValues['itemExist'][locale.languageCode]; String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From e054c282342d8e5bf755ea7e97aea156721274d8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 11:27:03 +0200 Subject: [PATCH 121/421] hide text --- .../patients/profile/soap_update/update_assessment_page.dart | 1 + lib/widgets/patients/profile/soap_update/update_plan_page.dart | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 20684e19..3eec290c 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -130,6 +130,7 @@ class _UpdateAssessmentPageState extends State { ), Column( children: [ + if(model.patientAssessmentList.isEmpty) Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index d5ad12e9..9c851cd5 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -115,6 +115,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ + if(model.patientProgressNoteList.isEmpty) Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), From 16b949461d6cb5a2b1f050059b0ce5549c42e551 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 3 Jan 2021 11:35:36 +0200 Subject: [PATCH 122/421] prescription post --- lib/core/model/medical_file_model.dart | 412 ++++++++++--- .../prescription/add_prescription_form.dart | 552 +++++++++--------- 2 files changed, 607 insertions(+), 357 deletions(-) diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index eb88f0d4..0496d0eb 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -1,7 +1,7 @@ class MedicalFileModel { List entityList; int rowcount; - dynamic statusMessage; + Null statusMessage; MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); @@ -190,12 +190,12 @@ class LstDischargeDiag { projectName = json['ProjectName']; remarks = json['Remarks']; setupID = json['SetupID']; - // if (json['TimeLineEvents'] != null) { - // timeLineEvents = new List(); - // json['TimeLineEvents'].forEach((v) { - // timeLineEvents.add(new TimeLineEvents.fromJson(v)); - // }); - // } + if (json['TimeLineEvents'] != null) { + timeLineEvents = new List(); + json['TimeLineEvents'].forEach((v) { + timeLineEvents.add(new TimeLineEvents.fromJson(v)); + }); + } } Map toJson() { @@ -246,49 +246,49 @@ class TimeLineEvents { this.radReports, this.toolTip}); - // TimeLineEvents.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // colorClass = json['ColorClass']; - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // disPlayName = json['DisPlayName']; - // doctorName = json['DoctorName']; - // eRData = - // json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; - // eventId = json['EventId']; - // fullName = json['FullName']; - // iconClass = json['IconClass']; - // isDisabled = json['IsDisabled']; - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // toolTip = json['ToolTip']; - // } + TimeLineEvents.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // colorClass = json['ColorClass']; + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + disPlayName = json['DisPlayName']; + doctorName = json['DoctorName']; + eRData = + json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; + eventId = json['EventId']; + fullName = json['FullName']; + iconClass = json['IconClass']; + isDisabled = json['IsDisabled']; + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + toolTip = json['ToolTip']; + } Map toJson() { final Map data = new Map(); // if (this.admissions != null) { // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); // } - data['ColorClass'] = this.colorClass; + // data['ColorClass'] = this.colorClass; // if (this.consulations != null) { // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); // } @@ -326,38 +326,38 @@ class ERData { this.radReports, this.lstErDischargeSummary}); - // ERData.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstErDischargeSummary'] != null) { - // lstErDischargeSummary = new List(); - // json['lstErDischargeSummary'].forEach((v) { - // lstErDischargeSummary.add(new Null.fromJson(v)); - // }); - // } - // } + ERData.fromJson(Map json) { + // if (json['Admissions'] != null) { + // admissions = new List(); + // json['Admissions'].forEach((v) { + // admissions.add(new Null.fromJson(v)); + // }); + // } + // if (json['Consulations'] != null) { + // consulations = new List(); + // json['Consulations'].forEach((v) { + // consulations.add(new Null.fromJson(v)); + // }); + // } + // if (json['LabOrders'] != null) { + // labOrders = new List(); + // json['LabOrders'].forEach((v) { + // labOrders.add(new Null.fromJson(v)); + // }); + // } + // if (json['RadReports'] != null) { + // radReports = new List(); + // json['RadReports'].forEach((v) { + // radReports.add(new Null.fromJson(v)); + // }); + // } + // if (json['lstErDischargeSummary'] != null) { + // lstErDischargeSummary = new List(); + // json['lstErDischargeSummary'].forEach((v) { + // lstErDischargeSummary.add(new Null.fromJson(v)); + // }); + // } + } Map toJson() { final Map data = new Map(); @@ -827,6 +827,7 @@ class DoctorWisePatientEpisodes { String setupID; int doctorID; String doctorName; + List lstEpisodes; DoctorWisePatientEpisodes( {this.clinicName, @@ -835,7 +836,8 @@ class DoctorWisePatientEpisodes { this.projectName, this.setupID, this.doctorID, - this.doctorName}); + this.doctorName, + this.lstEpisodes}); DoctorWisePatientEpisodes.fromJson(Map json) { clinicName = json['ClinicName']; @@ -845,6 +847,12 @@ class DoctorWisePatientEpisodes { setupID = json['SetupID']; doctorID = json['doctorID']; doctorName = json['doctorName']; + if (json['lstEpisodes'] != null) { + lstEpisodes = new List(); + json['lstEpisodes'].forEach((v) { + lstEpisodes.add(new LstEpisodes.fromJson(v)); + }); + } } Map toJson() { @@ -856,6 +864,256 @@ class DoctorWisePatientEpisodes { data['SetupID'] = this.setupID; data['doctorID'] = this.doctorID; data['doctorName'] = this.doctorName; + if (this.lstEpisodes != null) { + data['lstEpisodes'] = this.lstEpisodes.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class LstEpisodes { + int admissionNo; + String appointmentDate; + int appointmentNo; + String appointmentType; + String clinicID; + String clinicName; + int doctorID; + String doctorName; + String endTime; + String episodeDate; + int episodeID; + int patientID; + int projectID; + String projectName; + String remarks; + String setupID; + String startTime; + String visitFor; + String visitType; + String dispalyName; + List lstAssessments; + List lstPhysicalExam; + + LstEpisodes( + {this.admissionNo, + this.appointmentDate, + this.appointmentNo, + this.appointmentType, + this.clinicID, + this.clinicName, + this.doctorID, + this.doctorName, + this.endTime, + this.episodeDate, + this.episodeID, + this.patientID, + this.projectID, + this.projectName, + this.remarks, + this.setupID, + this.startTime, + this.visitFor, + this.visitType, + this.dispalyName, + this.lstAssessments, + this.lstPhysicalExam}); + + LstEpisodes.fromJson(Map json) { + admissionNo = json['AdmissionNo']; + appointmentDate = json['AppointmentDate']; + appointmentNo = json['AppointmentNo']; + appointmentType = json['AppointmentType']; + clinicID = json['ClinicID']; + clinicName = json['ClinicName']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + endTime = json['EndTime']; + episodeDate = json['EpisodeDate']; + episodeID = json['EpisodeID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + startTime = json['StartTime']; + visitFor = json['VisitFor']; + visitType = json['VisitType']; + dispalyName = json['dispalyName']; + if (json['lstAssessments'] != null) { + lstAssessments = new List(); + json['lstAssessments'].forEach((v) { + lstAssessments.add(new LstAssessments.fromJson(v)); + }); + } + if (json['lstPhysicalExam'] != null) { + lstPhysicalExam = new List(); + json['lstPhysicalExam'].forEach((v) { + lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['AdmissionNo'] = this.admissionNo; + data['AppointmentDate'] = this.appointmentDate; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentType'] = this.appointmentType; + data['ClinicID'] = this.clinicID; + data['ClinicName'] = this.clinicName; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['EndTime'] = this.endTime; + data['EpisodeDate'] = this.episodeDate; + data['EpisodeID'] = this.episodeID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + data['StartTime'] = this.startTime; + data['VisitFor'] = this.visitFor; + data['VisitType'] = this.visitType; + data['dispalyName'] = this.dispalyName; + if (this.lstAssessments != null) { + data['lstAssessments'] = + this.lstAssessments.map((v) => v.toJson()).toList(); + } + if (this.lstPhysicalExam != null) { + data['lstPhysicalExam'] = + this.lstPhysicalExam.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class LstAssessments { + int appointmentNo; + String condition; + String description; + int episodeID; + String iCD10; + int patientID; + String patientType; + int projectID; + String projectName; + String remarks; + String setupID; + String type; + String dispalyName; + + LstAssessments( + {this.appointmentNo, + this.condition, + this.description, + this.episodeID, + this.iCD10, + this.patientID, + this.patientType, + this.projectID, + this.projectName, + this.remarks, + this.setupID, + this.type, + this.dispalyName}); + + LstAssessments.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + condition = json['Condition']; + description = json['Description']; + episodeID = json['EpisodeID']; + iCD10 = json['ICD10']; + patientID = json['PatientID']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + type = json['Type']; + dispalyName = json['dispalyName']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['Condition'] = this.condition; + data['Description'] = this.description; + data['EpisodeID'] = this.episodeID; + data['ICD10'] = this.iCD10; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + data['Type'] = this.type; + data['dispalyName'] = this.dispalyName; + return data; + } +} + +class LstPhysicalExam { + String abnormal; + int appointmentNo; + int episodeID; + String examDesc; + String examID; + String examType; + int patientID; + String patientType; + int projectID; + String projectName; + String remarks; + String setupID; + String dispalyName; + + LstPhysicalExam( + {this.abnormal, + this.appointmentNo, + this.episodeID, + this.examDesc, + this.examID, + this.examType, + this.patientID, + this.patientType, + this.projectID, + this.projectName, + this.remarks, + this.setupID, + this.dispalyName}); + + LstPhysicalExam.fromJson(Map json) { + abnormal = json['Abnormal']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + examDesc = json['ExamDesc']; + examID = json['ExamID']; + examType = json['ExamType']; + patientID = json['PatientID']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + setupID = json['SetupID']; + dispalyName = json['dispalyName']; + } + + Map toJson() { + final Map data = new Map(); + data['Abnormal'] = this.abnormal; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['ExamDesc'] = this.examDesc; + data['ExamID'] = this.examID; + data['ExamType'] = this.examType; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['SetupID'] = this.setupID; + data['dispalyName'] = this.dispalyName; return data; } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index e3ed71a9..6d1d7cf3 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -35,316 +35,308 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { isScrollControlled: true, context: context, builder: (BuildContext bc) { - return BaseView( - onModelReady: (model) => model.getDrugs(), - builder: (BuildContext context, PrescriptionViewModel model, - Widget child) => - DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: (BuildContext context, - ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context) - .medicines - .toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context) - .searchMedicine, - controller: drugIdController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of( - context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .orderType, - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( + return //BaseView( + //onModelReady: (model) => model.getDrugs(), + //builder: (BuildContext context, PrescriptionViewModel model, + //Widget child) => + DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context) + .medicines + .toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( hintText: TranslationBase.of(context) - .strength, + .searchMedicine, + controller: drugIdController, keyboardType: TextInputType.number, - controller: strengthController, validator: (value) { if (value.isEmpty) return TranslationBase.of(context) .emptyMessage; else return null; - }, - ), + }), + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .orderType, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context).route, - controller: routeController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .strength, + keyboardType: TextInputType.number, + controller: strengthController, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .frequency, - controller: frequencyController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: + TranslationBase.of(context).route, + controller: routeController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .doseTime, - controller: doseController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .frequency, + controller: frequencyController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .indication, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .doseTime, + controller: doseController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .fromDate, - keyboardType: TextInputType.datetime, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .indication, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: - TranslationBase.of(context) - .duration, - // borderColor: Colors.white, - keyboardType: TextInputType.number, - controller: durationController, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of( - context) - .emptyMessage; - else - return null; - }), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .fromDate, + keyboardType: TextInputType.datetime, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( hintText: TranslationBase.of(context) - .instruction, - controller: indicationController, + .duration, + // borderColor: Colors.white, keyboardType: TextInputType.number, + controller: durationController, validator: (value) { if (value.isEmpty) return TranslationBase.of(context) .emptyMessage; else return null; - }, - ), + }), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .instruction, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState - .validate()) { - postProcedure( - model: model, - duration: - durationController.text, - dose: doseController.text, - frequency: - frequencyController - .text, - route: routeController.text, - drugId: - drugIdController.text, - strength: - strengthController.text, - indication: - indicationController - .text, - instruction: - indicationController - .text, - ); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], - ), + if (formKey.currentState + .validate()) { + postProcedure( + model: model, + duration: + durationController.text, + dose: doseController.text, + frequency: + frequencyController.text, + route: routeController.text, + drugId: drugIdController.text, + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + indicationController.text, + ); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ), - ); - }), - ); + ), + ); + }); + //); }); } From ee9ca72057e852cf056a80ceec56af6e4fd1c705 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Jan 2021 11:45:46 +0200 Subject: [PATCH 123/421] change empty referral message --- lib/config/localized_values.dart | 2 ++ lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart | 7 ++++++- .../profile/referral/my-referral-patient-screen.dart | 2 +- .../patients/profile/referral/refer-patient-screen.dart | 5 ++++- .../patients/profile/referral/referred-patient-screen.dart | 6 +++--- lib/util/translations_delegate_base.dart | 2 ++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1dc0216e..ef5aaaa5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -507,4 +507,6 @@ const Map> localizedValues = { 'medications': {'en': "Medications", 'ar':"الأدوية" }, 'procedures': {'en': "Procedures", 'ar':"الإجراءات" }, 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, + 'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" }, + 'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" }, }; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 7fc16bfb..302b77a8 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -15,7 +15,7 @@ class UcafDetailScreen extends StatefulWidget { class _UcafDetailScreenState extends State { - int _activeTap = 1; + int _activeTap = 0; @override Widget build(BuildContext context) { @@ -45,6 +45,7 @@ class _UcafDetailScreenState extends State { SizedBox( height: 16, ), + getSelectedTreatmentStepItem(context), ], ), ), @@ -104,4 +105,8 @@ class _UcafDetailScreenState extends State { ); } + Widget getSelectedTreatmentStepItem(BuildContext _context) { + return Container(); + } + } diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 7f11f35f..311e2f12 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -27,7 +27,7 @@ class MyReferralPatientScreen extends StatelessWidget { model.pendingReferral.length == 0 ? Center( child: AppText( - TranslationBase.of(context).errorNoSchedule, + TranslationBase.of(context).referralEmptyMsg, color: Theme.of(context).errorColor, ), ) diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 1ffd7150..69540176 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -339,7 +339,10 @@ class _PatientMakeReferralScreenState extends State { _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) - .then((_) => Navigator.pop(context)); + .then((_) { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); + Navigator.pop(context); + }); }, ), ) diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 1ba1f572..c1880908 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -19,7 +19,7 @@ class ReferredPatientScreen extends StatelessWidget { model.listMyReferredPatientModel.length == 0 ? Center( child: AppText( - TranslationBase.of(context).errorNoSchedule, + TranslationBase.of(context).referralEmptyMsg, color: Theme.of(context).errorColor, ), ) @@ -27,14 +27,14 @@ class ReferredPatientScreen extends StatelessWidget { child: Container( child: Column( children: [ - Container( + /*Container( height: 75, child: AppText( "This is where upper view for avatar.. etc placed", fontWeight: FontWeight.normal, fontSize: 16, ), - ), + ),*/ const Divider( color: Color(0xffCCCCCC), height: 1, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7070d252..5dee728a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -533,6 +533,8 @@ class TranslationBase { String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; + String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 8284f1d475772be006da5e3ee5c5bbcb240775a9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 11:49:42 +0200 Subject: [PATCH 124/421] Fix profile widget --- .../profile/profile_medical_info_widget.dart | 146 +++++++++--------- 1 file changed, 70 insertions(+), 76 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 016b5972..8860a7dc 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,14 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; + import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; - -import 'PatientProfileButton.dart'; /* *@author: Elham Rababah @@ -45,16 +44,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: PATIENT_VITAL_SIGN, - icon: 'heartbeat.png'), - ), + if(selectedPatientType == 6 || selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: PATIENT_VITAL_SIGN, + icon: 'heartbeat.png'), + if(selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -62,13 +60,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PRESCRIPTIONS, - // nameLine1: TranslationBase.of(context).medicines, - // nameLine2: TranslationBase.of(context).prescription, - // icon: 'note.png'), + PatientProfileButton( key: key, patient: patient, @@ -76,32 +68,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png')), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( + if (selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), + if (selectedPatientType == 7) + PatientProfileButton( key: key, patient: patient, route: PATIENT_ADMISSION_REQUEST, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'heartbeat.png'), - ), - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PATIENT_INSURANCE_APPROVALS, - // nameLine1: TranslationBase.of(context).insurance, - // nameLine2: TranslationBase.of(context).approvals, - // icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -116,42 +98,54 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: 'Order Test', nameLine2: 'Or Procedures', icon: 'lab.png'), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'note.png')), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ORDERS, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).list, - icon: 'radiology-1.png')), - Visibility( - visible: selectedPatientType != 0 && selectedPatientType != 5, - child: PatientProfileButton( - key: key, - patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png')), - Visibility( - visible: selectedPatientType == 6 || selectedPatientType == 7, - child: PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png')), + if(selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + route: REFER_PATIENT_TO_DOCTOR, + nameLine1: TranslationBase + .of(context) + .myReferral, + nameLine2: TranslationBase + .of(context) + .patient, + icon: 'note.png'), + if(selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ORDERS, + nameLine1: TranslationBase + .of(context) + .orders, + nameLine2: TranslationBase + .of(context) + .list, + icon: 'radiology-1.png'), + if(selectedPatientType != 0 && selectedPatientType != 5) + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase + .of(context) + .patientSick, + nameLine2: TranslationBase + .of(context) + .leave, + icon: 'sick_leaves_icons.png'), + if( selectedPatientType == 7) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase + .of(context) + .patient, + nameLine2: TranslationBase + .of(context) + .ucaf, + icon: 'lab.png'), ]); } } From 88ee50f7cb467e2285a48aed8bb01e5a31c8426a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Jan 2021 12:21:17 +0200 Subject: [PATCH 125/421] change make referral page loading behaviour --- .../viewModel/patient-referral-viewmodel.dart | 6 +++--- .../referral/refer-patient-screen.dart | 19 +++++++++++++++---- lib/widgets/shared/app_loader_widget.dart | 5 +++-- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index e5657883..251407ef 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -41,7 +41,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getBranches() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.getProjectsList(); if (_referralPatientService.hasError) { error = _referralPatientService.error; @@ -52,7 +52,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getClinics(int projectId) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.getClinicsList(projectId); await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { @@ -63,7 +63,7 @@ class PatientReferralViewModel extends BaseViewModel { } Future getClinicDoctors(String clinicId) async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _referralPatientService.getDoctorsList(clinicId); if (_referralPatientService.hasError) { error = _referralPatientService.error; diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 69540176..e46ab6d5 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -10,6 +10,7 @@ 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_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_loader_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/dialogs/dailog-list-select.dart'; @@ -55,7 +56,8 @@ class _PatientMakeReferralScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getMasterLookup(MasterKeysService.physiotherapyGoals), + onModelReady: (model) => + model.getMasterLookup(MasterKeysService.physiotherapyGoals), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, @@ -64,6 +66,14 @@ class _PatientMakeReferralScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ + if (model.state == ViewState.BusyLocal) + Container( + color: Colors.white, + width: 50, + height: 50, + child: AppLoaderWidget( + containerColor: Colors.white, + )), Column( children: [ PatientPageHeaderWidget(patient), @@ -333,14 +343,15 @@ class _PatientMakeReferralScreenState extends State { _remarksController.text == null) return; model .makeReferral( - patient, + patient, appointmentDate.toIso8601String(), _selectedBranch['ID'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) .then((_) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).referralSuccessMsg); Navigator.pop(context); }); }, @@ -368,7 +379,7 @@ class _PatientMakeReferralScreenState extends State { setState(() { appointmentDate = picked; }); - /* model + /* model .getPatientArrivalList(DateUtils.convertStringToDateFormat( appointmentDate.toString(), "yyyy-MM-dd")) .then((_) { diff --git a/lib/widgets/shared/app_loader_widget.dart b/lib/widgets/shared/app_loader_widget.dart index aeb7f5b2..65a5f231 100644 --- a/lib/widgets/shared/app_loader_widget.dart +++ b/lib/widgets/shared/app_loader_widget.dart @@ -9,9 +9,10 @@ import 'package:progress_hud_v2/progress_hud.dart'; *@desc: AppLoaderWidget to create loader */ class AppLoaderWidget extends StatefulWidget { - AppLoaderWidget({Key key, this.title}) : super(key: key); + AppLoaderWidget({Key key, this.title, this.containerColor}) : super(key: key); final String title; + final Color containerColor; @override _AppLoaderWidgetState createState() => new _AppLoaderWidgetState(); @@ -30,7 +31,7 @@ class _AppLoaderWidgetState extends State { *@desc: create loader the desing */ _progressHUD = new ProgressHUD( - backgroundColor: Colors.black12, + backgroundColor: widget.containerColor == null ? Colors.black12 : widget.containerColor, color: Colors.black, // containerColor: Colors.blue, borderRadius: 5.0, From 9194d8a44b24a354041d26cca2efa2ae46ee55e0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 14:29:47 +0200 Subject: [PATCH 126/421] delete Allergy --- lib/models/SOAP/my_selected_allergy.dart | 5 +- .../profile/soap_update/steps_widget.dart | 14 ++-- .../subjective/update_allergies_widget.dart | 80 +++++++++++++------ .../subjective/update_subjective_page.dart | 5 ++ lib/widgets/shared/Text.dart | 7 +- 5 files changed, 78 insertions(+), 33 deletions(-) diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index 9996b65a..e5b45502 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -4,9 +4,10 @@ class MySelectedAllergy { MasterKeyModel selectedAllergySeverity; MasterKeyModel selectedAllergy; String remark; + bool isChecked; MySelectedAllergy( - {this.selectedAllergySeverity, this.selectedAllergy, this.remark}); + {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked}); MySelectedAllergy.fromJson(Map json) { selectedAllergySeverity = json['selectedAllergySeverity'] != null @@ -16,6 +17,7 @@ class MySelectedAllergy { ? new MasterKeyModel.fromJson(json['selectedAllergy']) : null; remark = json['remark']; + remark = json['isChecked']; } Map toJson() { @@ -27,6 +29,7 @@ class MySelectedAllergy { data['selectedAllergy'] = this.selectedAllergy.toJson(); } data['remark'] = this.remark; + data['isChecked'] = this.remark; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index 56f3435e..b7e9e837 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -34,7 +34,7 @@ class StepsWidget extends StatelessWidget { top: index == 0 ? 15 : 30, left: 0, child: InkWell( - //onTap: () => changeCurrentTab(0), + onTap: () => changeCurrentTab(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -84,7 +84,7 @@ class StepsWidget extends StatelessWidget { top: index == 1 ? 15 : 30, left: MediaQuery.of(context).size.width * 0.28, child: InkWell( - //onTap: () => index >= 1 ? changeCurrentTab(1) : null, + onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -187,7 +187,7 @@ class StepsWidget extends StatelessWidget { top: index == 3 ? 15 : 30, right: 0, child: InkWell( - //onTap: () => index >= 3 ? changeCurrentTab(4) : null, + onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -257,7 +257,7 @@ class StepsWidget extends StatelessWidget { top: index == 0 ? 15 : 30, right: 0, child: InkWell( - //onTap: () => changeCurrentTab(0), + onTap: () => changeCurrentTab(0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -307,7 +307,7 @@ class StepsWidget extends StatelessWidget { top: index == 1 ? 15 : 30, right: MediaQuery.of(context).size.width * 0.28, child: InkWell( - //onTap: () => index >= 2 ? changeCurrentTab(1) : null, + onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -357,7 +357,7 @@ class StepsWidget extends StatelessWidget { top: index == 2 ? 15 : 30, right: MediaQuery.of(context).size.width * 0.52, child: InkWell( - //onTap: () => index >= 3 ? changeCurrentTab(2) : null, + onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -411,7 +411,7 @@ class StepsWidget extends StatelessWidget { top: index == 3 ? 15 : 30, left: 0, child: InkWell( - //onTap: () => index >= 3 ? changeCurrentTab(4) : null, + onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 5d54dfa5..2d1f66ea 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -80,10 +80,15 @@ class _UpdateAllergiesWidgetState extends State { Container( child: Expanded( - child: Texts(projectViewModel.isArabic ? selectedAllergy - .selectedAllergy.nameAr : selectedAllergy - .selectedAllergy.nameEn.toUpperCase(), + child: Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, bold: true, color: Colors.black), ), @@ -95,17 +100,21 @@ class _UpdateAllergiesWidgetState extends State { .selectedAllergySeverity.nameEn .toUpperCase(), variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, bold: true, color: AppGlobal.appPrimaryColor), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeAllergy(selectedAllergy), - ) - ], + if(selectedAllergy.isChecked) + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeAllergy(selectedAllergy), + ) + ], ), SizedBox( height: 10, @@ -119,13 +128,22 @@ class _UpdateAllergiesWidgetState extends State { } removeAllergy(MySelectedAllergy mySelectedAllergy) { - Iterable allergy = - widget.myAllergiesList.where((element) => mySelectedAllergy == element); + List allergy = + // ignore: missing_return + widget.myAllergiesList.where((element) => + mySelectedAllergy.selectedAllergySeverity.id == + element.selectedAllergySeverity.id && + mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id + ).toList(); - if (allergy.length > 0) + if (allergy.length > 0) { setState(() { - widget.myAllergiesList.remove(allergy.first); + allergy[0].isChecked = false; }); + } + + + print(allergy); } openAllergiesList(BuildContext context) { @@ -137,14 +155,29 @@ class _UpdateAllergiesWidgetState extends State { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { setState(() { - if (!widget.myAllergiesList.contains(mySelectedAllergy)) { + List allergy = + // ignore: missing_return + widget.myAllergiesList.where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id + ).toList(); + if (allergy.isEmpty) { widget.myAllergiesList.add(mySelectedAllergy); Navigator.of(context).pop(); } else { - helpers.showErrorToast(TranslationBase - .of(context) - .itemExist); + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); } + + Navigator.of(context).pop(); }); },); }); @@ -353,9 +386,10 @@ class _AddAllergiesState extends State { title: "Add".toUpperCase(), onPressed: () { MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - selectedAllergySeverity: _selectedAllergySeverity); + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + isChecked: true, + selectedAllergySeverity: _selectedAllergySeverity,); widget.addAllergiesFun(mySelectedAllergy); }, ), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 98d1b7d0..ddab4734 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -131,6 +131,10 @@ class _UpdateSubjectivePageState extends State { return BaseView( onModelReady: (model) async { + widget.myAllergiesList.clear(); + widget.myHistoryList.clear(); + + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, @@ -165,6 +169,7 @@ class _UpdateSubjectivePageState extends State { ); MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: selectedAllergy, + isChecked: element.isChecked, selectedAllergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 9f6dfdf1..f2e663bf 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -16,11 +16,12 @@ class Texts extends StatefulWidget { final bool readMore; final String style; final bool allowExpand; + final TextDecoration textDecoration; Texts(this.text, {Key key, this.variant, this.color, this.bold, this.regular, this.medium, this.allowExpand = true, this.italic:false, this.textAlign, this.maxLength=60, - this.maxLines, this.readMore=false, this.style + this.maxLines, this.readMore=false, this.style, this.textDecoration }) : super(key: key); @override @@ -192,6 +193,7 @@ class _TextsState extends State { fontSize: _getFontSize(), letterSpacing: widget.variant=="overline" ? 1.5 : null, fontWeight: _getFontWeight(), + decoration: widget.textDecoration//TextDecoration.lineThrough ) ), if (widget.readMore && text.length > widget.maxLength && hidden) @@ -228,7 +230,8 @@ class _TextsState extends State { style: _getFontStyle().copyWith( color: HexColor('#FF0000'), fontWeight: FontWeight.w800, - fontFamily: "WorkSans" + fontFamily: "WorkSans", + ) ), ), From 68cfbf8fc78cdce7dc0bd8171ad4fe88cc9274c6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 3 Jan 2021 15:45:50 +0300 Subject: [PATCH 127/421] doctor leave --- lib/config/localized_values.dart | 1 + .../add-rescheduleleave.dart | 48 ++++++++++++++----- .../reschedule-leaves/reschedule_leave.dart | 26 +++++----- lib/screens/sick-leave/sick_leave.dart | 29 ++++++----- lib/util/translations_delegate_base.dart | 2 + 5 files changed, 70 insertions(+), 36 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 66c2e58c..19c4854c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -504,4 +504,5 @@ const Map> localizedValues = { 'itemExist': {'en': "This item already exist", 'ar': "هذا العنصر موجود"}, 'selectAllergy': {'en': "Select Allergy", 'ar': "أختر الحساسية"}, 'selectSeverity': {'en': "Select Severity", 'ar': "أختر الدرجه"}, + 'leaveCreated': {'en': "Leave has been created", 'ar': "تم إنشاء الإجازة"} }; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index a4739247..1b5957b9 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -45,23 +45,49 @@ class AddRescheduleLeavScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - AppTextFormField( - hintText: - TranslationBase.of(context).requestLeave, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons.add_circle, - color: Colors.red, - )), - textInputType: TextInputType.text, + InkWell( + child: Row( + children: [ + Expanded( + flex: 4, + child: AppText( + TranslationBase.of(context) + .requestLeave), + ), + IconButton( + icon: Icon( + Icons.add_circle, + color: Colors.red, + )) + ], + ) + // AppTextFormField( + // hintText: + // TranslationBase.of(context).requestLeave, + // borderColor: Colors.white, + // prefix: IconButton( + // icon: Icon( + // Icons.add_circle, + // color: Colors.red, + // )), + // // textInputType: TextInputType.text, + // readOnly: true, + // onTap: () { + // openLeave( + // context, + // false, + // ); + // return false; + // }, + // inputFormatter: ONLY_LETTERS, + // ) + , onTap: () { openLeave( context, false, ); }, - inputFormatter: ONLY_LETTERS, ) ], ), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index c74395a3..8c5889c7 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/text_validator.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -130,10 +131,12 @@ class _RescheduleLeaveScreen extends State { child: DropdownButton( focusColor: Colors.grey, isExpanded: true, + dropdownColor: + Colors.grey, value: getClinicName( model) ?? "", - iconSize: 40, + iconSize: 0, elevation: 16, selectedItemBuilder: (BuildContext @@ -151,8 +154,8 @@ class _RescheduleLeaveScreen extends State { fontSize: SizeConfig .textMultiplier * 2.1, - color: - Colors.grey, + color: Colors + .grey[500], ), ], ); @@ -234,7 +237,7 @@ class _RescheduleLeaveScreen extends State { child: DropdownButtonHideUnderline( child: DropdownButton( - focusColor: Colors.grey, + // focusColor: Colors.grey, isExpanded: true, value: offTime == null ? model2.allOffTime[0] @@ -256,8 +259,8 @@ class _RescheduleLeaveScreen extends State { fontSize: SizeConfig .textMultiplier * 2.1, - color: - Colors.grey, + // color: + // Colors.grey, ), ], ); @@ -560,8 +563,8 @@ class _RescheduleLeaveScreen extends State { fontSize: SizeConfig .textMultiplier * 2.1, - color: - Colors.grey, + // color: + // Colors.grey, ), ], ); @@ -654,8 +657,6 @@ class _RescheduleLeaveScreen extends State { fontSize: SizeConfig .textMultiplier * 2.1, - color: - Colors.grey, ), ], ); @@ -731,9 +732,10 @@ class _RescheduleLeaveScreen extends State { getProfile() async { Map p = await sharedPref.getObj(DOCTOR_PROFILE); + setState(() { + this.profile = p; if (widget.updateData != null) { - this.profile = p; this.clinicID = widget.updateData.clinicId; _toDateController.text = widget.updateData.dateTimeFrom; @@ -779,7 +781,7 @@ class _RescheduleLeaveScreen extends State { }; model.addReschedule(request).then((response) { - print(response); + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); }); } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 2aea6f43..fcc641ff 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -203,7 +203,7 @@ class _SickLeaveScreenState extends State { value: getClinicName( model) ?? "", - iconSize: 40, + iconSize: 0, elevation: 16, selectedItemBuilder: (BuildContext @@ -221,6 +221,8 @@ class _SickLeaveScreenState extends State { fontSize: SizeConfig .textMultiplier * 2.1, + color: + Colors.grey, ), ], ); @@ -310,18 +312,19 @@ class _SickLeaveScreenState extends State { // TranslationBase.of(context).remarks, // fontSize: 10, // ), - AppTextFormField( - borderColor: Colors.white, - hintText: widget.extendedData != null - ? widget.extendedData.remarks - : TranslationBase.of(context).remarks, - onChanged: (value) { - addSickLeave.remarks = value; - }, - validator: (value) { - // return TextValidator().validateName(value); - }, - inputFormatter: ONLY_LETTERS) + TextField( + maxLines: 3, + decoration: InputDecoration( + contentPadding: EdgeInsets.all(20.0), + border: InputBorder.none, + hintText: widget.extendedData != null + ? widget.extendedData.remarks + : TranslationBase.of(context) + .remarks), + onChanged: (value) { + addSickLeave.remarks = value; + }, + ) ], ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2cc38638..501c2ae5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -530,6 +530,8 @@ class TranslationBase { localizedValues['selectAllergy'][locale.languageCode]; String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get leaveCreated => + localizedValues['leaveCreated'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 3dffd337288620eeb7d328840e4c0a6afa64b43b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 15:01:38 +0200 Subject: [PATCH 128/421] hot fix --- .../profile/soap_update/subjective/update_allergies_widget.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 2d1f66ea..1d143310 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -171,13 +171,13 @@ class _UpdateAllergiesWidgetState extends State { mySelectedAllergy.selectedAllergySeverity; allergy.first.remark = mySelectedAllergy.remark; allergy.first.isChecked = mySelectedAllergy.isChecked; + Navigator.of(context).pop(); // helpers.showErrorToast(TranslationBase // .of(context) // .itemExist); } - Navigator.of(context).pop(); }); },); }); From ceb0cde34cf6805e01ff686a6ddb54b2a0c1915d Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 3 Jan 2021 15:23:37 +0200 Subject: [PATCH 129/421] finish UCAF design and solve problem on vital signs response --- lib/config/localized_values.dart | 8 + .../service/patient-vital-signs-service.dart | 2 +- .../patient-vital-sign-viewmodel.dart | 2 +- .../vital_sign/patient-vital-sign-data.dart | 2 +- .../profile/UCAF/UCAF-detail-screen.dart | 301 +++++++++++++++++- lib/util/translations_delegate_base.dart | 8 + 6 files changed, 314 insertions(+), 9 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ef5aaaa5..ff3ebd74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -509,4 +509,12 @@ const Map> localizedValues = { 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, 'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" }, 'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" }, + 'diagnoseType': {'en': "Diagnose Type", 'ar':"نوع التشخيص" }, + 'condition': {'en': "Condition", 'ar':"الحالة" }, + 'id': {'en': "ID", 'ar':"بطاقة هوية" }, + 'quantity': {'en': "Quantity", 'ar':"الكمية" }, + 'codeNo': {'en': "Code #", 'ar':"# الرمز" }, + 'covered': {'en': "Covered", 'ar':"مغطى" }, + 'approvalRequired': {'en': "Approval Required", 'ar':"الموافقة مطلوبة" }, + 'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar':"غير مغطى من قبل الدكتور" }, }; diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 31c8721d..43786ac0 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -59,7 +59,7 @@ class VitalSignsService extends BaseService{ onSuccess: (dynamic response, int statusCode) { if(response['VitalSignsList'] != null){ if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ - patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList']['0']); + patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); } } }, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index f53def7b..4282141c 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -95,7 +95,7 @@ class VitalSignsViewModel extends BaseViewModel { ); } - String getBMI(double bodyMassIndex) { + String getBMI(var bodyMassIndex) { if (bodyMassIndex <= 18.5) { return "Underweight"; } else if (bodyMassIndex <= 25.0) { diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index 5d20e017..c5e503c2 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -5,7 +5,7 @@ class VitalSignData { int bloodPressureHigher; int bloodPressureLower; int bloodPressurePatientPosition; - double bodyMassIndex; + var bodyMassIndex; int fio2; int headCircumCm; int heightCm; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 302b77a8..f9c2470a 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -5,6 +6,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.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:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -14,7 +16,6 @@ class UcafDetailScreen extends StatefulWidget { } class _UcafDetailScreenState extends State { - int _activeTap = 0; @override @@ -45,7 +46,7 @@ class _UcafDetailScreenState extends State { SizedBox( height: 16, ), - getSelectedTreatmentStepItem(context), + ...getSelectedTreatmentStepItem(context), ], ), ), @@ -64,8 +65,8 @@ class _UcafDetailScreenState extends State { ]; return Container( height: screenSize.height * 0.070, - decoration: - Helpers.containerBorderDecoration(Color(0Xffffffff), Color(0xFFCCCCCC)), + decoration: Helpers.containerBorderDecoration( + Color(0Xffffffff), Color(0xFFCCCCCC)), child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, @@ -105,8 +106,296 @@ class _UcafDetailScreenState extends State { ); } - Widget getSelectedTreatmentStepItem(BuildContext _context) { - return Container(); + List getSelectedTreatmentStepItem(BuildContext _context) { + switch (_activeTap) { + case 0: + return [...List.generate(2, (index) => DiagnosisWidget()).toList()]; + case 1: + return [...List.generate(2, (index) => MedicationWidget()).toList()]; + case 2: + return [...List.generate(2, (index) => ProceduresWidget()).toList()]; + default: + return [ + Container(), + ]; + } + } +} + +class DiagnosisWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).diagnoseType}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "Preliminary Diagnosis", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Expanded( + child: AppText( + "B34.2 | CORONA VIRUS INFECTION, UNSPECIFIED SITE", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).condition}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "174.00 Same", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 16, + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 16, + ), + ], + ); + } +} + +class MedicationWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).id}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "6", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + width: 16, + ), + AppText( + "${TranslationBase.of(context).price}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "35.6", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + width: 16, + ), + AppText( + "${TranslationBase.of(context).quantity}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "3", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Expanded( + child: AppText( + "EVE SKIN CREAM WITH HONEY -170GM", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Expanded( + child: AppText( + "Every other day for 5 days", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ), + ], + ), + SizedBox( + height: 16, + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 16, + ), + ], + ); } +} + +class ProceduresWidget extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Column( + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).codeNo}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "019054846", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + Expanded( + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + AppText( + "${TranslationBase.of(context).quantity}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "1", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Expanded( + child: AppText( + "SCAN - RENAL MASS PROTOCOL", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).covered}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "Yes", + fontWeight: FontWeight.normal, + color: Colors.green, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + width: 16, + ), + AppText( + "${TranslationBase.of(context).approvalRequired}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "Yes", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).uncoveredByDoctor}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "Yes", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 16, + ), + const Divider( + color: Color(0xffCCCCCC), + height: 1, + thickness: 1, + indent: 0, + endIndent: 0, + ), + SizedBox( + height: 16, + ), + ], + ); + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 5dee728a..4bbe718f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -535,6 +535,14 @@ class TranslationBase { String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get condition => localizedValues['condition'][locale.languageCode]; + String get id => localizedValues['id'][locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String get covered => localizedValues['covered'][locale.languageCode]; + String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; + String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From bbcd218a948e2760953e1cdbe954e02613a05ee4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 3 Jan 2021 15:39:38 +0200 Subject: [PATCH 130/421] history delete is fixed --- lib/models/SOAP/my_selected_history.dart | 30 ++++++ .../subjective/update_history_widget.dart | 93 ++++++++++++++----- .../subjective/update_subjective_page.dart | 48 +++++++--- .../soap_update/update_soap_index.dart | 3 +- 4 files changed, 134 insertions(+), 40 deletions(-) create mode 100644 lib/models/SOAP/my_selected_history.dart diff --git a/lib/models/SOAP/my_selected_history.dart b/lib/models/SOAP/my_selected_history.dart new file mode 100644 index 00000000..11e366c2 --- /dev/null +++ b/lib/models/SOAP/my_selected_history.dart @@ -0,0 +1,30 @@ +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + +class MySelectedHistory { + MasterKeyModel selectedHistory; + String remark; + bool isChecked; + + MySelectedHistory( + { this.selectedHistory, this.remark, this.isChecked}); + + MySelectedHistory.fromJson(Map json) { + + selectedHistory = json['selectedHistory'] != null + ? new MasterKeyModel.fromJson(json['selectedHistory']) + : null; + remark = json['remark']; + remark = json['isChecked']; + } + + Map toJson() { + final Map data = new Map(); + + if (this.selectedHistory != null) { + data['selectedHistory'] = this.selectedHistory.toJson(); + } + data['remark'] = this.remark; + data['isChecked'] = this.remark; + return data; + } +} diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index ebed11ca..9a7cba01 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -1,18 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -20,7 +17,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class UpdateHistoryWidget extends StatefulWidget { - final List myHistoryList; + final List myHistoryList; const UpdateHistoryWidget({Key key, this.myHistoryList}) : super(key: key); @@ -86,19 +83,28 @@ class _UpdateHistoryWidgetState extends State children: [ Container( child: Expanded( - child: Texts(projectViewModel.isArabic?myHistory.nameAr:myHistory.nameEn, - variant: "bodyText", bold: true, color: Colors.black), + child: Texts( + projectViewModel.isArabic + ? myHistory.selectedHistory.nameAr + : myHistory.selectedHistory.nameEn, + variant: "bodyText", + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), ), width: MediaQuery.of(context).size.width * 0.7, ), - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeHistory(myHistory), - ) + if (myHistory.isChecked) + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeHistory(myHistory.selectedHistory), + ) ], ), SizedBox( @@ -113,13 +119,24 @@ class _UpdateHistoryWidgetState extends State ); } - removeHistory(MasterKeyModel masterKey) { - Iterable history = widget.myHistoryList.where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + removeHistory(MasterKeyModel historyKey) { + // Iterable history = widget.myHistoryList.where((element) => + // masterKey.id == element.id && masterKey.typeId == element.typeId); + // + + List history = + // ignore: missing_return + widget.myHistoryList.where((element) => + historyKey.id == + element.selectedHistory.id && + historyKey.typeId == + element.selectedHistory.typeId + ).toList(); + if (history.length > 0) setState(() { - widget.myHistoryList.remove(history.first); + history[0].isChecked = false; }); } @@ -233,7 +250,7 @@ class _PriorityBarState extends State { class AddHistoryDialog extends StatefulWidget { final Function changePageViewIndex; final PageController controller; - final List myHistoryList; + final List myHistoryList; final Function addSelectedHistories; final Function (MasterKeyModel) removeHistory; @@ -306,7 +323,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -324,7 +342,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -342,7 +361,8 @@ class _AddHistoryDialogState extends State { }, addHistory: (history){ setState(() { - widget.myHistoryList.add(history); + createAndAddHistory( + history); }); }, addSelectedHistories: (){ @@ -361,12 +381,35 @@ class _AddHistoryDialogState extends State { )); } + createAndAddHistory(MasterKeyModel history) { + List myhistory = widget.myHistoryList.where((element) => + history.id == + element.selectedHistory.id && + history.typeId == + element.selectedHistory.typeId + ).toList(); + + if (myhistory.isEmpty) { + setState(() { + MySelectedHistory mySelectedHistory = MySelectedHistory( + remark: history.remarks ?? "", + selectedHistory: history, + isChecked: true); + widget.myHistoryList.add(mySelectedHistory); + }); + } else { + myhistory.first.isChecked = true; + } + } + isServiceSelected(MasterKeyModel masterKey) { - Iterable history = + Iterable history = widget .myHistoryList .where((element) => - masterKey.id == element.id && masterKey.typeId == element.typeId); + masterKey.id == element.selectedHistory.id && + masterKey.typeId == element.selectedHistory.typeId && + element.isChecked); if (history.length > 0) { return true; } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index ddab4734..89e617d6 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; @@ -28,7 +29,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; final List myAllergiesList; - final List myHistoryList; + final List myHistoryList; final PatiantInformtion patientInfo; UpdateSubjectivePage( @@ -90,7 +91,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -100,7 +106,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -110,7 +121,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } if (element.historyType == @@ -120,7 +136,12 @@ class _UpdateSubjectivePageState extends State { id: element.historyId, ); if (history != null) { - widget.myHistoryList.add(history); + MySelectedHistory mySelectedHistory = MySelectedHistory( + selectedHistory: history, + isChecked: element.isChecked, + remark: element.remarks); + + widget.myHistoryList.add(mySelectedHistory); } } }); @@ -408,10 +429,9 @@ class _UpdateSubjectivePageState extends State { ); } - addSubjectiveInfo( - {SOAPViewModel model, - List myAllergiesList, - List myHistoryList}) async { + addSubjectiveInfo({SOAPViewModel model, + List myAllergiesList, + List myHistoryList}) async { formKey.currentState.save(); formKey.currentState.validate(); @@ -488,9 +508,9 @@ class _UpdateSubjectivePageState extends State { } postHistories( - {List myHistoryList, SOAPViewModel model}) async { + {List myHistoryList, SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); + new PostHistoriesRequestModel(); widget.myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; @@ -500,9 +520,9 @@ class _UpdateSubjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: "", - historyId: history.id, - historyType: history.typeId, - isChecked: false, + historyId: history.selectedHistory.id, + historyType: history.selectedHistory.typeId, + isChecked: history.isChecked, )); }); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index fee067f4..0edaaaf9 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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/translations_delegate_base.dart'; @@ -30,7 +31,7 @@ class _UpdateSoapIndexState extends State PageController _controller; int _currentIndex = 0; List myAllergiesList= List(); - List myHistoryList = List(); + List myHistoryList = List(); List mySelectedExamination = List(); MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); changePageViewIndex(pageIndex) { From 76cc4d11f82f08662fd55a7b687a1ba5071db540 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 4 Jan 2021 00:31:55 +0200 Subject: [PATCH 131/421] medical file --- lib/core/model/medical_file_model.dart | 1080 ++--------------- lib/core/service/medical_file_service.dart | 5 +- .../viewModel/medical_file_view_model.dart | 4 +- .../medical-file/medical_file_details.dart | 999 ++++++++++----- .../medical-file/medical_file_page.dart | 257 ++-- .../prescription/add_prescription_form.dart | 48 +- pubspec.lock | 8 +- 7 files changed, 942 insertions(+), 1459 deletions(-) diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index 0496d0eb..4e9d8f3e 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -1,9 +1,8 @@ class MedicalFileModel { List entityList; - int rowcount; - Null statusMessage; + dynamic statusMessage; - MedicalFileModel({this.entityList, this.rowcount, this.statusMessage}); + MedicalFileModel({this.entityList, this.statusMessage}); MedicalFileModel.fromJson(Map json) { if (json['entityList'] != null) { @@ -12,7 +11,6 @@ class MedicalFileModel { entityList.add(new EntityList.fromJson(v)); }); } - rowcount = json['rowcount']; statusMessage = json['statusMessage']; } @@ -21,57 +19,17 @@ class MedicalFileModel { if (this.entityList != null) { data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); } - data['rowcount'] = this.rowcount; data['statusMessage'] = this.statusMessage; return data; } } class EntityList { - List admissions; - ClinicalSummary clinicalSummary; - List doctorWisePatientEpisodes; - List procedures; - List lstAllEpisodes; List timelines; - EntityList( - {this.admissions, - this.clinicalSummary, - this.doctorWisePatientEpisodes, - this.procedures, - this.lstAllEpisodes, - this.timelines}); + EntityList({this.timelines}); EntityList.fromJson(Map json) { - if (json['Admissions'] != null) { - admissions = new List(); - json['Admissions'].forEach((v) { - admissions.add(new Admissions.fromJson(v)); - }); - } - clinicalSummary = json['ClinicalSummary'] != null - ? new ClinicalSummary.fromJson(json['ClinicalSummary']) - : null; - if (json['DoctorWisePatientEpisodes'] != null) { - doctorWisePatientEpisodes = new List(); - json['DoctorWisePatientEpisodes'].forEach((v) { - doctorWisePatientEpisodes - .add(new DoctorWisePatientEpisodes.fromJson(v)); - }); - } - if (json['Procedures'] != null) { - procedures = new List(); - json['Procedures'].forEach((v) { - procedures.add(new Procedures.fromJson(v)); - }); - } - if (json['lstAllEpisodes'] != null) { - lstAllEpisodes = new List(); - json['lstAllEpisodes'].forEach((v) { - lstAllEpisodes.add(new LstAllEpisodes.fromJson(v)); - }); - } if (json['Timelines'] != null) { timelines = new List(); json['Timelines'].forEach((v) { @@ -82,23 +40,6 @@ class EntityList { Map toJson() { final Map data = new Map(); - if (this.admissions != null) { - data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - } - if (this.clinicalSummary != null) { - data['ClinicalSummary'] = this.clinicalSummary.toJson(); - } - if (this.doctorWisePatientEpisodes != null) { - data['DoctorWisePatientEpisodes'] = - this.doctorWisePatientEpisodes.map((v) => v.toJson()).toList(); - } - if (this.procedures != null) { - data['Procedures'] = this.procedures.map((v) => v.toJson()).toList(); - } - if (this.lstAllEpisodes != null) { - data['lstAllEpisodes'] = - this.lstAllEpisodes.map((v) => v.toJson()).toList(); - } if (this.timelines != null) { data['Timelines'] = this.timelines.map((v) => v.toJson()).toList(); } @@ -106,89 +47,45 @@ class EntityList { } } -class Admissions { - String admissionDate; - int admissionNo; - String clinic; - String doctor; - int projectID; - String projectName; - String setupID; - List lstDischargeDiag; - - Admissions( - {this.admissionDate, - this.admissionNo, - this.clinic, - this.doctor, - this.projectID, - this.projectName, - this.setupID, - this.lstDischargeDiag}); - - Admissions.fromJson(Map json) { - admissionDate = json['AdmissionDate']; - admissionNo = json['AdmissionNo']; - clinic = json['Clinic']; - doctor = json['Doctor']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - if (json['lstDischargeDiag'] != null) { - lstDischargeDiag = new List(); - json['lstDischargeDiag'].forEach((v) { - lstDischargeDiag.add(new LstDischargeDiag.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['AdmissionDate'] = this.admissionDate; - data['AdmissionNo'] = this.admissionNo; - data['Clinic'] = this.clinic; - data['Doctor'] = this.doctor; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - if (this.lstDischargeDiag != null) { - data['lstDischargeDiag'] = - this.lstDischargeDiag.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LstDischargeDiag { - int admissionNo; - String codeID; - String description; - int dischargeNo; +class Timelines { + int clinicId; + String clinicName; + String date; + int doctorId; + String doctorImage; + String doctorName; + int encounterNumber; + String encounterType; int projectID; String projectName; - String remarks; String setupID; List timeLineEvents; - LstDischargeDiag( - {this.admissionNo, - this.codeID, - this.description, - this.dischargeNo, + Timelines( + {this.clinicId, + this.clinicName, + this.date, + this.doctorId, + this.doctorImage, + this.doctorName, + this.encounterNumber, + this.encounterType, this.projectID, this.projectName, - this.remarks, this.setupID, this.timeLineEvents}); - LstDischargeDiag.fromJson(Map json) { - admissionNo = json['AdmissionNo']; - codeID = json['CodeID']; - description = json['Description']; - dischargeNo = json['DischargeNo']; + Timelines.fromJson(Map json) { + clinicId = json['ClinicId']; + clinicName = json['ClinicName']; + date = json['Date']; + doctorId = json['DoctorId']; + doctorImage = json['DoctorImage']; + doctorName = json['DoctorName']; + encounterNumber = json['EncounterNumber']; + encounterType = json['EncounterType']; projectID = json['ProjectID']; projectName = json['ProjectName']; - remarks = json['Remarks']; setupID = json['SetupID']; if (json['TimeLineEvents'] != null) { timeLineEvents = new List(); @@ -200,13 +97,16 @@ class LstDischargeDiag { Map toJson() { final Map data = new Map(); - data['AdmissionNo'] = this.admissionNo; - data['CodeID'] = this.codeID; - data['Description'] = this.description; - data['DischargeNo'] = this.dischargeNo; + data['ClinicId'] = this.clinicId; + data['ClinicName'] = this.clinicName; + data['Date'] = this.date; + data['DoctorId'] = this.doctorId; + data['DoctorImage'] = this.doctorImage; + data['DoctorName'] = this.doctorName; + data['EncounterNumber'] = this.encounterNumber; + data['EncounterType'] = this.encounterType; data['ProjectID'] = this.projectID; data['ProjectName'] = this.projectName; - data['Remarks'] = this.remarks; data['SetupID'] = this.setupID; if (this.timeLineEvents != null) { data['TimeLineEvents'] = @@ -219,659 +119,32 @@ class LstDischargeDiag { class TimeLineEvents { List admissions; String colorClass; - List consulations; - String disPlayName; - Null doctorName; - ERData eRData; - int eventId; - String fullName; - String iconClass; - bool isDisabled; - List labOrders; - List radReports; - String toolTip; + List consulations; - TimeLineEvents( - {this.admissions, - this.colorClass, - this.consulations, - this.disPlayName, - this.doctorName, - this.eRData, - this.eventId, - this.fullName, - this.iconClass, - this.isDisabled, - this.labOrders, - this.radReports, - this.toolTip}); + TimeLineEvents({this.admissions, this.colorClass, this.consulations}); TimeLineEvents.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // colorClass = json['ColorClass']; - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - disPlayName = json['DisPlayName']; - doctorName = json['DoctorName']; - eRData = - json['ERData'] != null ? new ERData.fromJson(json['ERData']) : null; - eventId = json['EventId']; - fullName = json['FullName']; - iconClass = json['IconClass']; - isDisabled = json['IsDisabled']; - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - toolTip = json['ToolTip']; - } - - Map toJson() { - final Map data = new Map(); - // if (this.admissions != null) { - // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - // } - // data['ColorClass'] = this.colorClass; - // if (this.consulations != null) { - // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); - // } - data['DisPlayName'] = this.disPlayName; - data['DoctorName'] = this.doctorName; - if (this.eRData != null) { - data['ERData'] = this.eRData.toJson(); - } - data['EventId'] = this.eventId; - data['FullName'] = this.fullName; - data['IconClass'] = this.iconClass; - data['IsDisabled'] = this.isDisabled; - // if (this.labOrders != null) { - // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); - // } - // if (this.radReports != null) { - // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); - // } - data['ToolTip'] = this.toolTip; - return data; - } -} - -class ERData { - List admissions; - List consulations; - List labOrders; - List radReports; - List lstErDischargeSummary; - - ERData( - {this.admissions, - this.consulations, - this.labOrders, - this.radReports, - this.lstErDischargeSummary}); - - ERData.fromJson(Map json) { - // if (json['Admissions'] != null) { - // admissions = new List(); - // json['Admissions'].forEach((v) { - // admissions.add(new Null.fromJson(v)); - // }); - // } - // if (json['Consulations'] != null) { - // consulations = new List(); - // json['Consulations'].forEach((v) { - // consulations.add(new Null.fromJson(v)); - // }); - // } - // if (json['LabOrders'] != null) { - // labOrders = new List(); - // json['LabOrders'].forEach((v) { - // labOrders.add(new Null.fromJson(v)); - // }); - // } - // if (json['RadReports'] != null) { - // radReports = new List(); - // json['RadReports'].forEach((v) { - // radReports.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstErDischargeSummary'] != null) { - // lstErDischargeSummary = new List(); - // json['lstErDischargeSummary'].forEach((v) { - // lstErDischargeSummary.add(new Null.fromJson(v)); - // }); - // } - } - - Map toJson() { - final Map data = new Map(); - // if (this.admissions != null) { - // data['Admissions'] = this.admissions.map((v) => v.toJson()).toList(); - // } - // if (this.consulations != null) { - // data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); - // } - // if (this.labOrders != null) { - // data['LabOrders'] = this.labOrders.map((v) => v.toJson()).toList(); - // } - // if (this.radReports != null) { - // data['RadReports'] = this.radReports.map((v) => v.toJson()).toList(); - // } - // if (this.lstErDischargeSummary != null) { - // data['lstErDischargeSummary'] = - // this.lstErDischargeSummary.map((v) => v.toJson()).toList(); - // } - return data; - } -} - -class ClinicalSummary { - List labAbnormalResults; - List lstAllergy; - List lstComplaintsDetail; - List lstDiagnosis; - List lstEncounterHistory; - List lstMedication; - List lstPastHistory; - - ClinicalSummary( - {this.labAbnormalResults, - this.lstAllergy, - this.lstComplaintsDetail, - this.lstDiagnosis, - this.lstEncounterHistory, - this.lstMedication, - this.lstPastHistory}); - - ClinicalSummary.fromJson(Map json) { - if (json['LabAbnormalResults'] != null) { - labAbnormalResults = new List(); - json['LabAbnormalResults'].forEach((v) { - labAbnormalResults.add(new LabAbnormalResults.fromJson(v)); - }); - } - if (json['lstAllergy'] != null) { - lstAllergy = new List(); - json['lstAllergy'].forEach((v) { - lstAllergy.add(new LstAllergy.fromJson(v)); - }); - } - if (json['lstComplaintsDetail'] != null) { - lstComplaintsDetail = new List(); - json['lstComplaintsDetail'].forEach((v) { - lstComplaintsDetail.add(new LstComplaintsDetail.fromJson(v)); - }); - } - if (json['lstDiagnosis'] != null) { - lstDiagnosis = new List(); - json['lstDiagnosis'].forEach((v) { - lstDiagnosis.add(new LstDiagnosis.fromJson(v)); - }); - } - if (json['lstEncounterHistory'] != null) { - lstEncounterHistory = new List(); - json['lstEncounterHistory'].forEach((v) { - lstEncounterHistory.add(new LstEncounterHistory.fromJson(v)); - }); - } - if (json['lstMedication'] != null) { - lstMedication = new List(); - json['lstMedication'].forEach((v) { - lstMedication.add(new LstMedication.fromJson(v)); + colorClass = json['ColorClass']; + if (json['Consulations'] != null) { + consulations = new List(); + json['Consulations'].forEach((v) { + consulations.add(new Consulations.fromJson(v)); }); } - if (json['lstPastHistory'] != null) { - lstPastHistory = new List(); - json['lstPastHistory'].forEach((v) { - lstPastHistory.add(new LstPastHistory.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - if (this.labAbnormalResults != null) { - data['LabAbnormalResults'] = - this.labAbnormalResults.map((v) => v.toJson()).toList(); - } - if (this.lstAllergy != null) { - data['lstAllergy'] = this.lstAllergy.map((v) => v.toJson()).toList(); - } - if (this.lstComplaintsDetail != null) { - data['lstComplaintsDetail'] = - this.lstComplaintsDetail.map((v) => v.toJson()).toList(); - } - if (this.lstDiagnosis != null) { - data['lstDiagnosis'] = this.lstDiagnosis.map((v) => v.toJson()).toList(); - } - if (this.lstEncounterHistory != null) { - data['lstEncounterHistory'] = - this.lstEncounterHistory.map((v) => v.toJson()).toList(); - } - if (this.lstMedication != null) { - data['lstMedication'] = - this.lstMedication.map((v) => v.toJson()).toList(); - } - if (this.lstPastHistory != null) { - data['lstPastHistory'] = - this.lstPastHistory.map((v) => v.toJson()).toList(); - } - return data; - } -} - -class LabAbnormalResults { - String createdOn; - String description; - bool isPackage; - int orderNo; - int packageID; - String packageName; - int projectID; - String projectName; - String referenceRange; - double referenceRangeLow; - double referenceRangeHigh; - String resultCriticalFlag; - String resultValue; - String resultValueFlag; - String setupID; - String testCode; - int testID; - String verifiedOn; - bool isAbnormal; - bool isCritical; - String unit; - - LabAbnormalResults( - {this.createdOn, - this.description, - this.isPackage, - this.orderNo, - this.packageID, - this.packageName, - this.projectID, - this.projectName, - this.referenceRange, - this.referenceRangeLow, - this.referenceRangeHigh, - this.resultCriticalFlag, - this.resultValue, - this.resultValueFlag, - this.setupID, - this.testCode, - this.testID, - this.verifiedOn, - this.isAbnormal, - this.isCritical, - this.unit}); - - LabAbnormalResults.fromJson(Map json) { - createdOn = json['CreatedOn']; - description = json['Description']; - isPackage = json['IsPackage']; - orderNo = json['OrderNo']; - packageID = json['PackageID']; - packageName = json['PackageName']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - referenceRange = json['ReferenceRange']; - referenceRangeLow = json['ReferenceRange_Low']; - referenceRangeHigh = json['ReferenceRange_high']; - resultCriticalFlag = json['ResultCriticalFlag']; - resultValue = json['ResultValue']; - resultValueFlag = json['ResultValueFlag']; - setupID = json['SetupID']; - testCode = json['TestCode']; - testID = json['TestID']; - verifiedOn = json['VerifiedOn']; - isAbnormal = json['isAbnormal']; - isCritical = json['isCritical']; - unit = json['unit']; - } - - Map toJson() { - final Map data = new Map(); - data['CreatedOn'] = this.createdOn; - data['Description'] = this.description; - data['IsPackage'] = this.isPackage; - data['OrderNo'] = this.orderNo; - data['PackageID'] = this.packageID; - data['PackageName'] = this.packageName; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['ReferenceRange'] = this.referenceRange; - data['ReferenceRange_Low'] = this.referenceRangeLow; - data['ReferenceRange_high'] = this.referenceRangeHigh; - data['ResultCriticalFlag'] = this.resultCriticalFlag; - data['ResultValue'] = this.resultValue; - data['ResultValueFlag'] = this.resultValueFlag; - data['SetupID'] = this.setupID; - data['TestCode'] = this.testCode; - data['TestID'] = this.testID; - data['VerifiedOn'] = this.verifiedOn; - data['isAbnormal'] = this.isAbnormal; - data['isCritical'] = this.isCritical; - data['unit'] = this.unit; - return data; - } -} - -class LstAllergy { - String allergy; - int projectID; - String projectName; - String setupID; - - LstAllergy({this.allergy, this.projectID, this.projectName, this.setupID}); - - LstAllergy.fromJson(Map json) { - allergy = json['Allergy']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; } Map toJson() { final Map data = new Map(); - data['Allergy'] = this.allergy; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - return data; - } -} - -class LstComplaintsDetail { - String cCDate; - String createdBy; - String plainChiefComplaint; - int projectID; - String projectName; - String setupID; - String rtfChiefComplaint; - - LstComplaintsDetail( - {this.cCDate, - this.createdBy, - this.plainChiefComplaint, - this.projectID, - this.projectName, - this.setupID, - this.rtfChiefComplaint}); - - LstComplaintsDetail.fromJson(Map json) { - cCDate = json['CCDate']; - createdBy = json['CreatedBy']; - plainChiefComplaint = json['PlainChiefComplaint']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - rtfChiefComplaint = json['rtfChiefComplaint']; - } - - Map toJson() { - final Map data = new Map(); - data['CCDate'] = this.cCDate; - data['CreatedBy'] = this.createdBy; - data['PlainChiefComplaint'] = this.plainChiefComplaint; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['rtfChiefComplaint'] = this.rtfChiefComplaint; - return data; - } -} - -class LstDiagnosis { - String diagnosis; - int projectID; - String projectName; - String setupID; - String state; - String status; - - LstDiagnosis( - {this.diagnosis, - this.projectID, - this.projectName, - this.setupID, - this.state, - this.status}); - LstDiagnosis.fromJson(Map json) { - diagnosis = json['Diagnosis']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - state = json['State']; - status = json['Status']; - } - - Map toJson() { - final Map data = new Map(); - data['Diagnosis'] = this.diagnosis; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['State'] = this.state; - data['Status'] = this.status; - return data; - } -} - -class LstEncounterHistory { - String clinician; - String date; - String encounterType; - int projectID; - String projectName; - String reason; - String setupID; - String speciality; - String type; - - LstEncounterHistory( - {this.clinician, - this.date, - this.encounterType, - this.projectID, - this.projectName, - this.reason, - this.setupID, - this.speciality, - this.type}); - - LstEncounterHistory.fromJson(Map json) { - clinician = json['Clinician']; - date = json['Date']; - encounterType = json['EncounterType']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - reason = json['Reason']; - setupID = json['SetupID']; - speciality = json['Speciality']; - type = json['Type']; - } - - Map toJson() { - final Map data = new Map(); - data['Clinician'] = this.clinician; - data['Date'] = this.date; - data['EncounterType'] = this.encounterType; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['Reason'] = this.reason; - data['SetupID'] = this.setupID; - data['Speciality'] = this.speciality; - data['Type'] = this.type; - return data; - } -} - -class LstMedication { - String date; - int doseDurationDays; - String lastFilled; - String medication; - String prescription; - int projectID; - String projectName; - String setupID; - String icon; - - LstMedication( - {this.date, - this.doseDurationDays, - this.lastFilled, - this.medication, - this.prescription, - this.projectID, - this.projectName, - this.setupID, - this.icon}); - - LstMedication.fromJson(Map json) { - date = json['Date']; - doseDurationDays = json['DoseDurationDays']; - lastFilled = json['LastFilled']; - medication = json['Medication']; - prescription = json['Prescription']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - icon = json['icon']; - } - - Map toJson() { - final Map data = new Map(); - data['Date'] = this.date; - data['DoseDurationDays'] = this.doseDurationDays; - data['LastFilled'] = this.lastFilled; - data['Medication'] = this.medication; - data['Prescription'] = this.prescription; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['icon'] = this.icon; - return data; - } -} - -class LstPastHistory { - String history; - String historyType; - String historyTypeID; - String historyTypeName; - int projectID; - String projectName; - String remarks; - String setupID; - - LstPastHistory( - {this.history, - this.historyType, - this.historyTypeID, - this.historyTypeName, - this.projectID, - this.projectName, - this.remarks, - this.setupID}); - - LstPastHistory.fromJson(Map json) { - history = json['History']; - historyType = json['HistoryType']; - historyTypeID = json['HistoryTypeID']; - historyTypeName = json['HistoryTypeName']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - remarks = json['Remarks']; - setupID = json['SetupID']; - } - - Map toJson() { - final Map data = new Map(); - data['History'] = this.history; - data['HistoryType'] = this.historyType; - data['HistoryTypeID'] = this.historyTypeID; - data['HistoryTypeName'] = this.historyTypeName; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['Remarks'] = this.remarks; - data['SetupID'] = this.setupID; - return data; - } -} - -class DoctorWisePatientEpisodes { - String clinicName; - String lastVisitDate; - int projectID; - String projectName; - String setupID; - int doctorID; - String doctorName; - List lstEpisodes; - - DoctorWisePatientEpisodes( - {this.clinicName, - this.lastVisitDate, - this.projectID, - this.projectName, - this.setupID, - this.doctorID, - this.doctorName, - this.lstEpisodes}); - - DoctorWisePatientEpisodes.fromJson(Map json) { - clinicName = json['ClinicName']; - lastVisitDate = json['LastVisitDate']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - doctorID = json['doctorID']; - doctorName = json['doctorName']; - if (json['lstEpisodes'] != null) { - lstEpisodes = new List(); - json['lstEpisodes'].forEach((v) { - lstEpisodes.add(new LstEpisodes.fromJson(v)); - }); - } - } - - Map toJson() { - final Map data = new Map(); - data['ClinicName'] = this.clinicName; - data['LastVisitDate'] = this.lastVisitDate; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; - data['doctorID'] = this.doctorID; - data['doctorName'] = this.doctorName; - if (this.lstEpisodes != null) { - data['lstEpisodes'] = this.lstEpisodes.map((v) => v.toJson()).toList(); + data['ColorClass'] = this.colorClass; + if (this.consulations != null) { + data['Consulations'] = this.consulations.map((v) => v.toJson()).toList(); } return data; } } -class LstEpisodes { +class Consulations { int admissionNo; String appointmentDate; int appointmentNo; @@ -894,8 +167,10 @@ class LstEpisodes { String dispalyName; List lstAssessments; List lstPhysicalExam; + List lstProcedure; + List lstMedicalHistory; - LstEpisodes( + Consulations( {this.admissionNo, this.appointmentDate, this.appointmentNo, @@ -917,9 +192,11 @@ class LstEpisodes { this.visitType, this.dispalyName, this.lstAssessments, - this.lstPhysicalExam}); + this.lstPhysicalExam, + this.lstProcedure, + this.lstMedicalHistory}); - LstEpisodes.fromJson(Map json) { + Consulations.fromJson(Map json) { admissionNo = json['AdmissionNo']; appointmentDate = json['AppointmentDate']; appointmentNo = json['AppointmentNo']; @@ -952,6 +229,18 @@ class LstEpisodes { lstPhysicalExam.add(new LstPhysicalExam.fromJson(v)); }); } + if (json['lstProcedure'] != null) { + lstProcedure = new List(); + json['lstProcedure'].forEach((v) { + lstProcedure.add(new LstProcedure.fromJson(v)); + }); + } + if (json['lstMedicalHistory'] != null) { + lstMedicalHistory = new List(); + json['lstMedicalHistory'].forEach((v) { + lstMedicalHistory.add(new LstMedicalHistory.fromJson(v)); + }); + } } Map toJson() { @@ -984,6 +273,13 @@ class LstEpisodes { data['lstPhysicalExam'] = this.lstPhysicalExam.map((v) => v.toJson()).toList(); } + if (this.lstProcedure != null) { + data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); + } + if (this.lstMedicalHistory != null) { + data['lstMedicalHistory'] = + this.lstMedicalHistory.map((v) => v.toJson()).toList(); + } return data; } } @@ -1118,7 +414,7 @@ class LstPhysicalExam { } } -class Procedures { +class LstProcedure { int appointmentNo; int episodeID; String orderDate; @@ -1131,7 +427,7 @@ class Procedures { String setupID; String dispalyName; - Procedures( + LstProcedure( {this.appointmentNo, this.episodeID, this.orderDate, @@ -1144,7 +440,7 @@ class Procedures { this.setupID, this.dispalyName}); - Procedures.fromJson(Map json) { + LstProcedure.fromJson(Map json) { appointmentNo = json['AppointmentNo']; episodeID = json['EpisodeID']; orderDate = json['OrderDate']; @@ -1175,245 +471,59 @@ class Procedures { } } -class LstAllEpisodes { - int admissionNo; - String appointmentDate; +class LstMedicalHistory { int appointmentNo; - String appointmentType; - String clinicID; - String clinicName; - int doctorID; - String doctorName; - String endTime; - String episodeDate; + String checked; int episodeID; + String history; int patientID; + String patientType; int projectID; String projectName; String remarks; String setupID; - String startTime; - String visitFor; - String visitType; String dispalyName; - List lstAssessments; - List lstCheifComplaint; - List lstMedicalHistory; - List lstMedicine; - List lstPhysicalExam; - List lstProcedure; - List lstTreatmentPlan; - List lstVitalSign; - LstAllEpisodes( - {this.admissionNo, - this.appointmentDate, - this.appointmentNo, - this.appointmentType, - this.clinicID, - this.clinicName, - this.doctorID, - this.doctorName, - this.endTime, - this.episodeDate, + LstMedicalHistory( + {this.appointmentNo, + this.checked, this.episodeID, + this.history, this.patientID, + this.patientType, this.projectID, this.projectName, this.remarks, this.setupID, - this.startTime, - this.visitFor, - this.visitType, - this.dispalyName, - this.lstAssessments, - this.lstCheifComplaint, - this.lstMedicalHistory, - this.lstMedicine, - this.lstPhysicalExam, - this.lstProcedure, - this.lstTreatmentPlan, - this.lstVitalSign}); + this.dispalyName}); - LstAllEpisodes.fromJson(Map json) { - admissionNo = json['AdmissionNo']; - appointmentDate = json['AppointmentDate']; + LstMedicalHistory.fromJson(Map json) { appointmentNo = json['AppointmentNo']; - appointmentType = json['AppointmentType']; - clinicID = json['ClinicID']; - clinicName = json['ClinicName']; - doctorID = json['DoctorID']; - doctorName = json['DoctorName']; - endTime = json['EndTime']; - episodeDate = json['EpisodeDate']; + checked = json['Checked']; episodeID = json['EpisodeID']; + history = json['History']; patientID = json['PatientID']; + patientType = json['PatientType']; projectID = json['ProjectID']; projectName = json['ProjectName']; remarks = json['Remarks']; setupID = json['SetupID']; - startTime = json['StartTime']; - visitFor = json['VisitFor']; - visitType = json['VisitType']; dispalyName = json['dispalyName']; - // if (json['lstAssessments'] != null) { - // lstAssessments = new List(); - // json['lstAssessments'].forEach((v) { - // lstAssessments.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstCheifComplaint'] != null) { - // lstCheifComplaint = new List(); - // json['lstCheifComplaint'].forEach((v) { - // lstCheifComplaint.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstMedicalHistory'] != null) { - // lstMedicalHistory = new List(); - // json['lstMedicalHistory'].forEach((v) { - // lstMedicalHistory.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstMedicine'] != null) { - // lstMedicine = new List(); - // json['lstMedicine'].forEach((v) { - // lstMedicine.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstPhysicalExam'] != null) { - // lstPhysicalExam = new List(); - // json['lstPhysicalExam'].forEach((v) { - // lstPhysicalExam.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstProcedure'] != null) { - // lstProcedure = new List(); - // json['lstProcedure'].forEach((v) { - // lstProcedure.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstTreatmentPlan'] != null) { - // lstTreatmentPlan = new List(); - // json['lstTreatmentPlan'].forEach((v) { - // lstTreatmentPlan.add(new Null.fromJson(v)); - // }); - // } - // if (json['lstVitalSign'] != null) { - // lstVitalSign = new List(); - // json['lstVitalSign'].forEach((v) { - // lstVitalSign.add(new Null.fromJson(v)); - // }); - // } } Map toJson() { final Map data = new Map(); - data['AdmissionNo'] = this.admissionNo; - data['AppointmentDate'] = this.appointmentDate; data['AppointmentNo'] = this.appointmentNo; - data['AppointmentType'] = this.appointmentType; - data['ClinicID'] = this.clinicID; - data['ClinicName'] = this.clinicName; - data['DoctorID'] = this.doctorID; - data['DoctorName'] = this.doctorName; - data['EndTime'] = this.endTime; - data['EpisodeDate'] = this.episodeDate; + data['Checked'] = this.checked; data['EpisodeID'] = this.episodeID; + data['History'] = this.history; data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; data['ProjectID'] = this.projectID; data['ProjectName'] = this.projectName; data['Remarks'] = this.remarks; data['SetupID'] = this.setupID; - data['StartTime'] = this.startTime; - data['VisitFor'] = this.visitFor; - data['VisitType'] = this.visitType; data['dispalyName'] = this.dispalyName; - // if (this.lstAssessments != null) { - // data['lstAssessments'] = - // this.lstAssessments.map((v) => v.toJson()).toList(); - // } - // if (this.lstCheifComplaint != null) { - // data['lstCheifComplaint'] = - // this.lstCheifComplaint.map((v) => v.toJson()).toList(); - // } - // if (this.lstMedicalHistory != null) { - // data['lstMedicalHistory'] = - // this.lstMedicalHistory.map((v) => v.toJson()).toList(); - // } - // if (this.lstMedicine != null) { - // data['lstMedicine'] = this.lstMedicine.map((v) => v.toJson()).toList(); - // } - // if (this.lstPhysicalExam != null) { - // data['lstPhysicalExam'] = - // this.lstPhysicalExam.map((v) => v.toJson()).toList(); - // } - // if (this.lstProcedure != null) { - // data['lstProcedure'] = this.lstProcedure.map((v) => v.toJson()).toList(); - // } - // if (this.lstTreatmentPlan != null) { - // data['lstTreatmentPlan'] = - // this.lstTreatmentPlan.map((v) => v.toJson()).toList(); - // } - // if (this.lstVitalSign != null) { - // data['lstVitalSign'] = this.lstVitalSign.map((v) => v.toJson()).toList(); - // } - return data; - } -} - -class Timelines { - int clinicId; - String clinicName; - String date; - int doctorId; - String doctorImage; - String doctorName; - int encounterNumber; - String encounterType; - int projectID; - String projectName; - String setupID; - - Timelines( - {this.clinicId, - this.clinicName, - this.date, - this.doctorId, - this.doctorImage, - this.doctorName, - this.encounterNumber, - this.encounterType, - this.projectID, - this.projectName, - this.setupID}); - - Timelines.fromJson(Map json) { - clinicId = json['ClinicId']; - clinicName = json['ClinicName']; - date = json['Date']; - doctorId = json['DoctorId']; - doctorImage = json['DoctorImage']; - doctorName = json['DoctorName']; - encounterNumber = json['EncounterNumber']; - encounterType = json['EncounterType']; - projectID = json['ProjectID']; - projectName = json['ProjectName']; - setupID = json['SetupID']; - } - - Map toJson() { - final Map data = new Map(); - data['ClinicId'] = this.clinicId; - data['ClinicName'] = this.clinicName; - data['Date'] = this.date; - data['DoctorId'] = this.doctorId; - data['DoctorImage'] = this.doctorImage; - data['DoctorName'] = this.doctorName; - data['EncounterNumber'] = this.encounterNumber; - data['EncounterType'] = this.encounterType; - data['ProjectID'] = this.projectID; - data['ProjectName'] = this.projectName; - data['SetupID'] = this.setupID; return data; } } diff --git a/lib/core/service/medical_file_service.dart b/lib/core/service/medical_file_service.dart index 0f6af46a..f1ab6dcd 100644 --- a/lib/core/service/medical_file_service.dart +++ b/lib/core/service/medical_file_service.dart @@ -9,12 +9,13 @@ class MedicalFileService extends BaseService { List get medicalFileList => _medicalFileList; MedicalFileRequestModel _fileRequestModel = MedicalFileRequestModel( - patientMRN: 1231755, + //patientMRN: 1231755, vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiNDM1MGNjZTYtYzc3MS00YjBiLThiNDItMGZhY2IzYzgxMjQ4IiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYwNTQiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA5MjI1MjMwLCJleHAiOjE2MTAwODkyMzAsImlhdCI6MTYwOTIyNTIzMH0.rs7lTBQ1ON4PbR11PBkOyjf818DdeMKuqz2IrCJMYQU", ); - Future getMedicalFile() async { + Future getMedicalFile({int mrn}) async { + _fileRequestModel = MedicalFileRequestModel(patientMRN: mrn); hasError = false; _medicalFileList.clear(); await baseAppClient.post(GET_MEDICAL_FILE, diff --git a/lib/core/viewModel/medical_file_view_model.dart b/lib/core/viewModel/medical_file_view_model.dart index 0ef21095..67760908 100644 --- a/lib/core/viewModel/medical_file_view_model.dart +++ b/lib/core/viewModel/medical_file_view_model.dart @@ -12,11 +12,11 @@ class MedicalFileViewModel extends BaseViewModel { List get medicalFileList => _medicalFileService.medicalFileList; - Future getMedicalFile() async { + Future getMedicalFile({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _medicalFileService.getMedicalFile(); + await _medicalFileService.getMedicalFile(mrn: mrn); if (_medicalFileService.hasError) { error = _medicalFileService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 4f966781..c916842c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.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/expandable-widget-header-body.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; @@ -16,21 +17,42 @@ class MedicalFileDetails extends StatefulWidget { String firstName; String lastName; String gender; - MedicalFileDetails({this.age, this.firstName, this.lastName, this.gender}); + int encounterNumber; + int pp; + + MedicalFileDetails( + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, age: age, lastName: lastName, gender: gender); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp); } class _MedicalFileDetailsState extends State { + int encounterNumber; String age; String firstName; String lastName; String gender; + int pp; _MedicalFileDetailsState( - {this.age, this.firstName, this.lastName, this.gender}); + {this.age, + this.firstName, + this.lastName, + this.gender, + this.encounterNumber, + this.pp}); bool isPhysicalExam = false; bool isProcedureExpand = false; bool isHistoryExpand = false; @@ -39,386 +61,689 @@ class _MedicalFileDetailsState extends State { @override Widget build(BuildContext context) { return BaseView( - //onModelReady: (model) => model.getMedicalFile(), + onModelReady: (model) => model.getMedicalFile(mrn: pp), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, appBarTitle: 'medical file'.toUpperCase(), - body: 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, + 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, ), - 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, - ), - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Visit Date : ', - fontWeight: FontWeight.w700, - ), - AppText( - '23/12/2020', - ), - SizedBox(width: 35.0), - AppText( - 'Appt Date : ', - fontWeight: FontWeight.w700, - ), - AppText( - '23/12/2020', - ), - ], ), - Row( - children: [ - AppText( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - AppText( - 'Muhammad assad'.toUpperCase(), - fontWeight: FontWeight.w700, - ), - ], - ), - Row( - children: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, - ), - AppText( - 'Gastroenterology', - ), - ], + SizedBox( + width: 20, ), - Row( + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Episode Number : ', - fontWeight: FontWeight.w700, + firstName + ' ' + lastName, + color: Colors.black, + fontWeight: FontWeight.bold, ), - AppText( - '200012334', + 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, + ), + ], ), ], - ), - SizedBox(height: 15.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ), - SizedBox(height: 25.0), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - Texts( - 'History of present illness' - .toUpperCase(), - variant: - isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: Column( - children: [ - Texts( - 'Ms J. K. is an 83 year old retired nurse with a long history of hypertension that was previously well controlled on diuretic therapy. She was first admitted to CPMC in 1995 when she presented with a complaint of intermittent midsternal chest pain.') - ], - ), - isExpand: isHistoryExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + Padding( + padding: EdgeInsets.all(10.0), + child: Container( + child: Column( + children: [ + Row( children: [ - Row( - children: [ - Texts('assessment'.toUpperCase(), - variant: - isAssessmentExpand ? "bodyText" : '', - bold: isAssessmentExpand ? true : false, - color: Colors.black), - ], + AppText( + 'Visit Date : ', + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.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', + // ), ], ), - bodyWidget: Column( - children: [ - Texts('ssss'), - ], - ), - isExpand: isAssessmentExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + Row( children: [ - Row( - children: [ - Texts('Test / procedures'.toUpperCase(), - variant: - isProcedureExpand ? "bodyText" : '', - bold: isProcedureExpand ? true : false, - color: Colors.black), - ], + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.length != 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), ], ), - bodyWidget: Column( - children: [ - SizedBox( - height: 20.0, - ), - Row( - children: [ - AppText( - 'Exam Type : ', - fontWeight: FontWeight.w700, - ), - AppText( - '59', - ), - ], - ), - Row( - children: [ - AppText( - 'ABDOMEN', - fontWeight: FontWeight.w700, - ), - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText( - 'no', - ), - ], - ), - SizedBox(height: 15.0), - Row( - children: [ + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + 'Clinic : ', + fontWeight: FontWeight.w700, + ), + if (model.medicalFileList.length != 0) AppText( - 'Some short remark about the allergy', - fontWeight: FontWeight.w300, + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .clinicName, ), - ], - ), - ], - ), - isExpand: isProcedureExpand, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - height: 30, - ), - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + ], + ), + Row( children: [ - Row( - children: [ - Texts('physical exam'.toUpperCase(), - variant: isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : false, - color: Colors.black), - ], + AppText( + 'Episode Number : ', + fontWeight: FontWeight.w700, ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) + if (model.medicalFileList.length != 0) + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .episodeID + .toString(), + ), ], ), - bodyWidget: Column( - children: [ - SizedBox( - height: 20.0, - ), - Row( + SizedBox(height: 15.0), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey.shade400, + ), + SizedBox(height: 25.0), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Exam Type : ', - fontWeight: FontWeight.w700, - ), - AppText( - '59', + Row( + children: [ + Texts( + 'History of present illness' + .toUpperCase(), + variant: + isHistoryExpand ? "bodyText" : '', + bold: isHistoryExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - Row( + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory + .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] + .lstMedicalHistory[ + index] + .history + .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) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'ABDOMEN', - fontWeight: FontWeight.w700, + Row( + children: [ + Texts('assessment'.toUpperCase(), + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: + isAssessmentExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - Row( + 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 + .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[encounterNumber] + .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, + ), + ], + ), + ), + ); + }), + isExpand: isAssessmentExpand, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + height: 30, + ), + if (model.medicalFileList.length != 0) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText( - 'no', + Row( + children: [ + Texts('Test / procedures'.toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: + isProcedureExpand ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - SizedBox(height: 15.0), - Row( + bodyWidget: ListView.builder( + //physics: , + 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, + ), + // AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[0] + // .timeLineEvents[0] + // .consulations[0] + // .lstProcedure[index] + // .orderDate + // .trim(), + // ), + ], + ), + Row( + children: [ + 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) + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - 'Some short remark about the allergy', - fontWeight: FontWeight.w300, + Row( + children: [ + Texts('physical exam'.toUpperCase(), + variant: + isPhysicalExam ? "bodyText" : '', + bold: isPhysicalExam ? true : false, + color: Colors.black), + ], ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.minus + : EvaIcons.plus)) ], ), - ], + bodyWidget: ListView.builder( + //physics: , + 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] + .examType), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[index] + .examDesc, + fontWeight: FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .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, + ), + ], + ), + ), + ); + }), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, ), - isExpand: isPhysicalExam, - ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ], + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], + ), ), ), - ), - ], + ], + ), ), ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 44fee1be..ad693f47 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -22,7 +22,7 @@ class _MedicalFilePageState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getMedicalFile(), + onModelReady: (model) => model.getMedicalFile(mrn: patient.patientMRN), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( @@ -30,140 +30,147 @@ class _MedicalFilePageState extends State { appBarTitle: 'medical Report'.toUpperCase(), body: NetworkBaseView( baseViewModel: model, - child: Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: 2, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 8.0), - child: InkWell( - child: Container( - child: Column( + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( children: [ - Row( - children: [ - AppText( - 'Branch : ', - fontWeight: FontWeight.w700, - ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].projectName, - ), - ], + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, ), - Row( - children: [ - AppText( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].doctor - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ], + SizedBox( + width: 5.0, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, ), - Row( + ], + ), + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + if (model.medicalFileList.length != 0) + ListView.builder( + //physics: , + 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: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + 'Branch : ', + fontWeight: FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName), + ], ), - AppText( - model.medicalFileList[0].entityList[0] - .admissions[index].clinic, + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + fontWeight: FontWeight.w700, + ), + AppText( + model.medicalFileList[0].entityList[0] + .timelines[index].doctorName, + fontWeight: FontWeight.w700, + ), + ], ), + Row( + children: [ + AppText( + 'Clinic : ', + 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, + ) ], ), - 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.patientMRN, + )), + ); + }, ), - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - )), - ); - }, - ), - ); - }) - ], + ); + }) + ], + ), ), ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 6d1d7cf3..28d9c45f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.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/dynamic_elements.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -17,14 +18,51 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; -void addPrescriptionForm(context, PrescriptionViewModel model) { +class AddPrescriptionFormScreen extends StatefulWidget { + @override + _AddPrescriptionFormScreenState createState() => + _AddPrescriptionFormScreenState(); +} + +class _AddPrescriptionFormScreenState extends State { + PrescriptionViewModel model = PrescriptionViewModel(); + // PostPrescriptionReqModel addPrescriptionModel = PostPrescriptionReqModel(); + // List sss = List(); + // void _presentDatePicker(id) { + // showDatePicker( + // context: context, + // initialDate: DateTime.now(), + // firstDate: DateTime(2019), + // lastDate: DateTime(2050), + // ).then((pickedDate) { + // if (pickedDate == null) { + // return; + // } + // setState(() { + // // var selectedDate = DateFormat.yMd().format(pickedDate); + // final df = new DateFormat('yyyy-MM-dd'); + // model.startDate = df.format(pickedDate); + // + // strengthController.text = sss.add(PrescriptionRequestModel(doseStartDate: '')); + // //addSickLeave.startDate = selectedDate; + // }); + // }); + // } + @override + Widget build(BuildContext context) { + return addPrescriptionForm(context, model); + } +} + +addPrescriptionForm(context, PrescriptionViewModel model) { TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); TextEditingController indicationController = TextEditingController(); - TextEditingController instructions = TextEditingController(); + TextEditingController instructionController = TextEditingController(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -267,10 +305,12 @@ void addPrescriptionForm(context, PrescriptionViewModel model) { width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( + maxLines: 6, + minLines: 4, hintText: TranslationBase.of(context) .instruction, - controller: indicationController, - keyboardType: TextInputType.number, + controller: instructionController, + //keyboardType: TextInputType.number, validator: (value) { if (value.isEmpty) return TranslationBase.of(context) diff --git a/pubspec.lock b/pubspec.lock index 67028733..5650f5f9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -461,7 +461,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -503,7 +503,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -760,7 +760,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -895,5 +895,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From ad48415038193db295efddccb50883532cf336d4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 4 Jan 2021 11:13:25 +0300 Subject: [PATCH 132/421] reschdule leave --- lib/screens/reschedule-leaves/reschedule_leave.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 8c5889c7..3fdbfbe3 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -51,10 +51,11 @@ class _RescheduleLeaveScreen extends State { var clinicID; TextEditingController _controller4; void _presentDatePicker(id) { + var date = new DateTime.now(); showDatePicker( context: context, - initialDate: DateTime.now(), - firstDate: DateTime.now(), + initialDate: new DateTime(date.year, date.month, date.day + 15), + firstDate: new DateTime(date.year, date.month, date.day + 15), lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { @@ -782,6 +783,7 @@ class _RescheduleLeaveScreen extends State { model.addReschedule(request).then((response) { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); + Navigator.pop(context); }); } From c9aac6e2e9fc1e50d5dbcc1385f7c14b91be96d9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 4 Jan 2021 11:32:14 +0200 Subject: [PATCH 133/421] vital signs solve overflow of the width --- .../vital_sign/vital-signs-screen.dart | 503 ++++++++++-------- 1 file changed, 287 insertions(+), 216 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index c66555c1..a53a3619 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -415,43 +415,57 @@ class _TemperatureWidgetState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).temperature} (C):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.temperatureCelcius}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).temperature} (C):", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.temperatureCelcius}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).temperature} (F):", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).temperature} (F):", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.temperatureCelcius * (9 / 5) + 32}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), @@ -534,44 +548,59 @@ class _PulseWidgetState extends State { children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).pulseBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.pulseBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).pulseBeats}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.pulseBeatPerMinute}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).rhythm}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.pulseRhythm}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).rhythm}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.pulseRhythm}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), @@ -628,43 +657,57 @@ class _RespirationWidgetState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).respBeats}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.respirationBeatPerMinute}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).respBeats}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.respirationBeatPerMinute}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).patternOfRespiration}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.respirationPattern}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).patternOfRespiration}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.respirationPattern}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), @@ -721,43 +764,57 @@ class _BloodPressureWidgetState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).bloodPressureDiastoleAndSystole}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.bloodPressureHigher}, ${widget.vitalSign.bloodPressureLower}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).cuffLocation}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressureCuffLocation}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).cuffLocation}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.bloodPressureCuffLocation}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), @@ -766,44 +823,54 @@ class _BloodPressureWidgetState extends State { ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).patientPosition}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressurePatientPosition}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Expanded( + child: AppText( + "${TranslationBase.of(context).patientPosition}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${widget.vitalSign.bloodPressurePatientPosition}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).cuffSize}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.bloodPressureCuffSize}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).cuffSize}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${widget.vitalSign.bloodPressureCuffSize}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), ), ], ), @@ -953,43 +1020,47 @@ class _PainScaleWidgetState extends State { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).painScale}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.painScore}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).painScale}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${widget.vitalSign.painScore}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).painManagement}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${widget.vitalSign.isPainManagementDone}", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + Expanded( + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).painManagement}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${widget.vitalSign.isPainManagementDone}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), ), ], ), From 31d6ca559387c9253d6d099ecd236a448b2ee888 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 4 Jan 2021 13:20:33 +0300 Subject: [PATCH 134/421] Doctor ID updated --- lib/screens/reschedule-leaves/reschedule_leave.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 3fdbfbe3..e5d83515 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -759,7 +759,7 @@ class _RescheduleLeaveScreen extends State { "requisitionNo": 0, "requisitionType": offTime, "clinicId": this.profile['ClinicID'], - "doctorId": this.profile['ClinicID'], + "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), "dateTimeTo": df.format(toDate), "date": df.format(DateTime.now()), @@ -794,7 +794,7 @@ class _RescheduleLeaveScreen extends State { "requisitionNo": 0, "requisitionType": offTime, "clinicId": this.profile['ClinicID'], - "doctorId": this.profile['ClinicID'], + "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), "dateTimeTo": df.format(toDate), "date": df.format(DateTime.now()), From d67b531865fdd6540195c5ce6d0a0c4eb13e7a67 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 4 Jan 2021 13:39:53 +0300 Subject: [PATCH 135/421] bug fix --- lib/screens/reschedule-leaves/add-rescheduleleave.dart | 4 ++-- lib/screens/reschedule-leaves/reschedule_leave.dart | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 1b5957b9..2067029f 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -184,7 +184,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { AppText(getDoctor( model .coveringDoctors, - item.doctorId)) + item.coveringDoctorId)) ]) : SizedBox(), AppText( @@ -298,7 +298,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { getDoctor(model, doctorId) { var obj; - obj = model.where((i) => i['doctorID'] == doctorId).toList(); + obj = model.where((i) => i['doctorID'].toString() == doctorId).toList(); print(obj); return obj.length > 0 ? obj[0]['doctorName'] : ""; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e5d83515..362e27d9 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -784,6 +784,7 @@ class _RescheduleLeaveScreen extends State { model.addReschedule(request).then((response) { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); Navigator.pop(context); + model.getRescheduleLeave(); }); } From c3bb40878768fac729f463a934119b6709ec1f1d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 4 Jan 2021 14:03:36 +0200 Subject: [PATCH 136/421] add some translations --- ios/Podfile.lock | 2 +- lib/config/localized_values.dart | 2 + lib/config/test.dart | 0 lib/util/translations_delegate_base.dart | 2 + .../subjective/update_allergies_widget.dart | 66 ++++++++++++------- .../soap_update/update_assessment_page.dart | 4 +- 6 files changed, 48 insertions(+), 28 deletions(-) delete mode 100644 lib/config/test.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 62e86469..108205bf 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -190,4 +190,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ef5aaaa5..7dda2cdb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -509,4 +509,6 @@ const Map> localizedValues = { 'vitalSignEmptyMsg': {'en': "There is no vital signs for this patient", 'ar':"لا توجد علامات حيوية لهذا المريض" }, 'referralEmptyMsg': {'en': "There is no referral data", 'ar':"لا توجد بيانات إحالة" }, 'referralSuccessMsg': {'en': "You make referral successfully", 'ar':"You make referral successfully" }, + 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, + 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, }; diff --git a/lib/config/test.dart b/lib/config/test.dart deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 5dee728a..e850c469 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -535,6 +535,8 @@ class TranslationBase { String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get assessment => localizedValues['assessment'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 1d143310..a9839a2c 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -71,41 +72,42 @@ class _UpdateAllergiesWidgetState extends State { return Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - - child: Expanded( - child: Texts( + Container( + child: Expanded( + child: Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), + ), + width: MediaQuery.of(context).size.width * 0.5, + ), + Texts( projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn + ? selectedAllergy.selectedAllergySeverity.nameAr + : selectedAllergy.selectedAllergySeverity.nameEn .toUpperCase(), variant: "bodyText", textDecoration: selectedAllergy.isChecked ? null : TextDecoration.lineThrough, bold: true, - color: Colors.black), - ), - width: MediaQuery.of(context).size.width * 0.5, - ), - Texts( - projectViewModel.isArabic ? selectedAllergy - .selectedAllergySeverity.nameAr : selectedAllergy - .selectedAllergySeverity.nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: AppGlobal.appPrimaryColor), - if(selectedAllergy.isChecked) + color: AppGlobal.appPrimaryColor), + if (selectedAllergy.isChecked) InkWell( child: Icon( FontAwesomeIcons.trash, @@ -115,6 +117,20 @@ class _UpdateAllergiesWidgetState extends State { onTap: () => removeAllergy(selectedAllergy), ) ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Container( + width: MediaQuery.of(context).size.width * 0.6, + child: AppText( + selectedAllergy.remark ?? '', + fontSize: 10, + color: Colors.grey, + ), + ), + ), + DividerWithSpacesAround() + ], ), SizedBox( height: 10, @@ -383,7 +399,7 @@ class _AddAllergiesState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( remark: remarkController.text, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 3eec290c..79d8878c 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -101,7 +101,7 @@ class _UpdateAssessmentPageState extends State { children: [ Row( children: [ - Texts('ASSESSMENT', + Texts(TranslationBase.of(context).assessment.toUpperCase(), variant: isAssessmentExpand ? "bodyText" : '', bold: isAssessmentExpand ? true : false, @@ -135,7 +135,7 @@ class _UpdateAssessmentPageState extends State { margin: EdgeInsets.only(left: 5, right: 5, top: 15), child: TextFields( - hintText: "Add ASSESSMENT", + hintText: TranslationBase.of(context).addAssessment, fontSize: 13.5, onTapTextFields: () { openAssessmentDialog(context); From 1be8ea7dcbee602061b680626f7003b514760e70 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 4 Jan 2021 14:07:55 +0200 Subject: [PATCH 137/421] Fix conflict --- lib/util/translations_delegate_base.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 1e9cfe71..1df9f8e9 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -548,9 +548,6 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; - String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; - String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; } From f997561bb8c656312f0febabe64195e3bd605926 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 5 Jan 2021 02:22:29 +0200 Subject: [PATCH 138/421] drug list --- lib/core/service/prescription_service.dart | 10 +- .../viewModel/prescription_view_model.dart | 14 +- .../admission-request-detail-screen.dart | 119 +- .../admission-request_second-screen.dart | 129 +- .../prescription/add_prescription_form.dart | 1046 +++++++++++------ .../prescription/prescription_screen.dart | 914 +++++++------- lib/screens/procedures/procedure_screen.dart | 4 +- .../shared/dialogs/dailog-list-select.dart | 7 +- 8 files changed, 1340 insertions(+), 903 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 3ccdc23c..aa881cbb 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -11,6 +11,8 @@ class PrescriptionService extends BaseService { List get prescriptionList => _prescriptionList; List _drugsList = List(); List get drugsList => _drugsList; + List doctorsList = []; + List specialityList = []; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( patientMRN: 3120877, @@ -26,7 +28,8 @@ class PrescriptionService extends BaseService { PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); - Future getPrescription() async { + Future getPrescription({int mrn}) async { + _prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, @@ -41,10 +44,11 @@ class PrescriptionService extends BaseService { Future getDrugs() async { hasError = false; - _drugsList.clear(); + await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { - _drugsList.add(SearchDrugModel.fromJson(response['MedicationList'])); + doctorsList = []; + doctorsList = response['MedicationList']['entityList']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index e5fa9a0f..3380d8c2 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -12,13 +12,13 @@ class PrescriptionViewModel extends BaseViewModel { List get prescriptionList => _prescriptionService.prescriptionList; - List get drugsList => _prescriptionService.drugsList; + List get drugsList => _prescriptionService.doctorsList; - Future getPrescription() async { + Future getPrescription({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _prescriptionService.getPrescription(); + await _prescriptionService.getPrescription(mrn: mrn); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); @@ -27,7 +27,7 @@ class PrescriptionViewModel extends BaseViewModel { } Future postPrescription( - PostPrescriptionReqModel postProcedureReqModel) async { + PostPrescriptionReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -36,13 +36,13 @@ class PrescriptionViewModel extends BaseViewModel { error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { - await getPrescription(); + await getPrescription(mrn: mrn); setState(ViewState.Idle); } } Future updatePrescription( - PostPrescriptionReqModel updatePrescriptionReqModel) async { + PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -51,7 +51,7 @@ class PrescriptionViewModel extends BaseViewModel { error = _prescriptionService.error; setState(ViewState.ErrorLocal); } else { - await getPrescription(); + await getPrescription(mrn: mrn); setState(ViewState.Idle); } } diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 9a474779..7ccc3ade 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -124,7 +124,10 @@ class _AdmissionRequestDetailScreenState ListSelectDialog dialog = ListSelectDialog( list: model.speciality, - attributeName: model.selectedLanguage == 'ar' ? 'nameAr' :'nameEn' , + attributeName: + model.selectedLanguage == 'ar' + ? 'nameAr' + : 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) @@ -149,7 +152,12 @@ class _AdmissionRequestDetailScreenState TranslationBase.of(context) .speciality, _selectedSpeciality != null - ? model.selectedLanguage == 'ar' ? _selectedSpeciality['nameAr'] : _selectedSpeciality['nameEn'] + ? model.selectedLanguage == + 'ar' + ? _selectedSpeciality[ + 'nameAr'] + : _selectedSpeciality[ + 'nameEn'] : null, true), enabled: false, @@ -163,36 +171,42 @@ class _AdmissionRequestDetailScreenState height: screenSize.height * 0.070, child: InkWell( onTap: model.doctorsList != null && - model.doctorsList.length > 0 + model.doctorsList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } + ListSelectDialog dialog = + ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } : null, child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).doctor, - _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, - true), + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .doctor, + _selectedDoctor != null + ? _selectedDoctor[ + 'DoctorName'] + : null, + true), enabled: false, ), ), @@ -202,23 +216,22 @@ class _AdmissionRequestDetailScreenState ), Container( height: screenSize.height * 0.070, - decoration: - Helpers.containerBorderDecoration( - Color(0xFFEEEEEE), - Color(0xFFCCCCCC), + decoration: Helpers.containerBorderDecoration( + Color(0xFFEEEEEE), Color(0xFFCCCCCC), borderWidth: 0.0), child: InkWell( onTap: () => null, child: TextField( decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).referringDate, - null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Color(0xFFCCCCCC), - )), + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .referringDate, + null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Color(0xFFCCCCCC), + )), enabled: false, ), ), @@ -228,17 +241,19 @@ class _AdmissionRequestDetailScreenState ), Container( decoration: - Helpers.containerBorderDecoration( - Color(0xFFEEEEEE), - Color(0xFFCCCCCC), - borderWidth: 0.0), + Helpers.containerBorderDecoration( + Color(0xFFEEEEEE), + Color(0xFFCCCCCC), + borderWidth: 0.0), height: screenSize.height * 0.070, child: TextField( decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).referringDoctor, - null, - true, dropDownColor: Color(0xFFCCCCCC)), + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .referringDoctor, + null, + true, + dropDownColor: Color(0xFFCCCCCC)), enabled: false, // controller: _remarksController, keyboardType: TextInputType.text, @@ -255,8 +270,10 @@ class _AdmissionRequestDetailScreenState child: AppButton( title: TranslationBase.of(context).next, color: HexColor("#B8382B"), - onPressed: (){ - Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_2, arguments: {'patient': patient}); + onPressed: () { + Navigator.of(context).pushNamed( + PATIENT_ADMISSION_REQUEST_2, + arguments: {'patient': patient}); }, ), ), diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 52995ab4..3c1e06dc 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -139,13 +139,13 @@ class _AdmissionRequestSecondScreenState _emergencyAdmission = newValue; }); }, - controlAffinity: ListTileControlAffinity.leading, + controlAffinity: + ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), CheckboxListTile( title: AppText( - TranslationBase.of(context) - .patientPregnant, + TranslationBase.of(context).patientPregnant, fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.1, ), @@ -155,28 +155,32 @@ class _AdmissionRequestSecondScreenState _patientPregnant = newValue; }); }, - controlAffinity: ListTileControlAffinity.leading, + controlAffinity: + ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), Container( child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).treatmentLine, + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .treatmentLine, null, false), - enabled: true, - controller: _treatmentLineController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), + enabled: true, + controller: _treatmentLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), SizedBox( height: 10, ), Container( height: screenSize.height * 0.070, child: InkWell( - onTap: /*model.doctorsList != null && + onTap: + /*model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = @@ -199,14 +203,17 @@ class _AdmissionRequestSecondScreenState }, ); } - :*/ null, + :*/ + null, child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).ward, - /* _selectedWard != null + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).ward, + /* _selectedWard != null ? _selectedWard['DoctorName'] - :*/ null, - true), + :*/ + null, + true), enabled: false, ), ), @@ -224,13 +231,15 @@ class _AdmissionRequestSecondScreenState _preAnesthesiaReferred = newValue; }); }, - controlAffinity: ListTileControlAffinity.leading, + controlAffinity: + ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), Container( height: screenSize.height * 0.070, child: InkWell( - onTap: /*model.doctorsList != null && + onTap: + /*model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = @@ -253,14 +262,18 @@ class _AdmissionRequestSecondScreenState }, ); } - :*/ null, + :*/ + null, child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).admissionType, - /* _admissionType != null + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .admissionType, + /* _admissionType != null ? _admissionType['DoctorName'] - :*/ null, - true), + :*/ + null, + true), enabled: false, ), ), @@ -271,7 +284,8 @@ class _AdmissionRequestSecondScreenState Container( height: screenSize.height * 0.070, child: InkWell( - onTap: /*model.doctorsList != null && + onTap: + /*model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = @@ -294,14 +308,18 @@ class _AdmissionRequestSecondScreenState }, ); } - :*/ null, + :*/ + null, child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).diagnosis, - /* _admissionType != null + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .diagnosis, + /* _admissionType != null ? _admissionType['DoctorName'] - :*/ null, - true), + :*/ + null, + true), enabled: false, ), ), @@ -311,23 +329,26 @@ class _AdmissionRequestSecondScreenState ), Container( child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).preOperativeOrders, + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .preOperativeOrders, null, false), - enabled: true, - controller: _preOperativeOrdersController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), + enabled: true, + controller: _preOperativeOrdersController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), SizedBox( height: 10, ), Container( height: screenSize.height * 0.070, child: InkWell( - onTap: /*model.doctorsList != null && + onTap: + /*model.doctorsList != null && model.doctorsList.length > 0 ? () { ListSelectDialog dialog = @@ -350,14 +371,18 @@ class _AdmissionRequestSecondScreenState }, ); } - :*/ null, + :*/ + null, child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).allergies, - /* _admissionType != null + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .allergies, + /* _admissionType != null ? _admissionType['DoctorName'] - :*/ null, - true), + :*/ + null, + true), enabled: false, ), ), @@ -374,8 +399,10 @@ class _AdmissionRequestSecondScreenState child: AppButton( title: TranslationBase.of(context).next, color: HexColor("#B8382B"), - onPressed: (){ - Navigator.of(context).pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: {'patient': patient}); + onPressed: () { + Navigator.of(context).pushNamed( + PATIENT_ADMISSION_REQUEST_3, + arguments: {'patient': patient}); }, ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 28d9c45f..f39499e1 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -5,439 +5,741 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.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/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/dynamic_elements.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; -class AddPrescriptionFormScreen extends StatefulWidget { - @override - _AddPrescriptionFormScreenState createState() => - _AddPrescriptionFormScreenState(); +addPrescriptionForm( + context, PrescriptionViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + isScrollControlled: true, + context: context, + builder: (BuildContext bc) { + return PrescriptionFormWidget(model, patient); + }); } -class _AddPrescriptionFormScreenState extends State { - PrescriptionViewModel model = PrescriptionViewModel(); - // PostPrescriptionReqModel addPrescriptionModel = PostPrescriptionReqModel(); - // List sss = List(); - // void _presentDatePicker(id) { - // showDatePicker( - // context: context, - // initialDate: DateTime.now(), - // firstDate: DateTime(2019), - // lastDate: DateTime(2050), - // ).then((pickedDate) { - // if (pickedDate == null) { - // return; - // } - // setState(() { - // // var selectedDate = DateFormat.yMd().format(pickedDate); - // final df = new DateFormat('yyyy-MM-dd'); - // model.startDate = df.format(pickedDate); - // - // strengthController.text = sss.add(PrescriptionRequestModel(doseStartDate: '')); - // //addSickLeave.startDate = selectedDate; - // }); - // }); - // } - @override - Widget build(BuildContext context) { - return addPrescriptionForm(context, model); +postProcedure( + {String duration, + String doseTimeIn, + String dose, + String drugId, + String strength, + String route, + String frequency, + String indication, + String instruction, + PrescriptionViewModel model, + DateTime doseTime, + PatiantInformtion patient}) async { + PostPrescriptionReqModel postProcedureReqModel = + new PostPrescriptionReqModel(); + List sss = List(); + + postProcedureReqModel.appointmentNo = 2016055159; + postProcedureReqModel.clinicID = 17; + postProcedureReqModel.episodeID = 200012330; + postProcedureReqModel.patientMRN = 3120877; + postProcedureReqModel.vidaAuthTokenID = + "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; + sss.add(PrescriptionRequestModel( + covered: true, + dose: 1, + itemId: int.parse(drugId), + doseUnitId: 1, + route: int.parse(route), + frequency: int.parse(frequency), + remarks: instruction, + approvalRequired: true, + icdcode10Id: "test2", + doseTime: int.parse(doseTimeIn), + duration: int.parse(duration), + doseStartDate: doseTime.toIso8601String())); + postProcedureReqModel.prescriptionRequestModel = sss; + //postProcedureReqModel.procedures = controlsProcedure; + + await model.postPrescription(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('Medication has been added'); } } -addPrescriptionForm(context, PrescriptionViewModel model) { +class PrescriptionFormWidget extends StatefulWidget { + final PrescriptionViewModel model; + PatiantInformtion patient; + PrescriptionFormWidget(this.model, this.patient); + + @override + _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); +} + +class _PrescriptionFormWidgetState extends State { TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); TextEditingController indicationController = TextEditingController(); TextEditingController instructionController = TextEditingController(); + DateTime selectedDate; + dynamic selectedDrug; TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; + List referToList; + dynamic type; + dynamic strength; + dynamic route; + dynamic frequency; + dynamic duration; + dynamic doseTime; - showModalBottomSheet( - isScrollControlled: true, - context: context, - builder: (BuildContext bc) { - return //BaseView( - //onModelReady: (model) => model.getDrugs(), - //builder: (BuildContext context, PrescriptionViewModel model, - //Widget child) => - DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context) - .medicines - .toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .searchMedicine, - controller: drugIdController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox( - height: spaceBetweenTextFileds, + List strengthList; + List routeList; + List frequencyList; + List durationList; + List doseTimeList; + //PatiantInformtion patient; + dynamic _strength; + dynamic _selectedBranch; + @override + void initState() { + super.initState(); + referToList = List(); + strengthList = List(); + routeList = List(); + frequencyList = List(); + durationList = List(); + doseTimeList = List(); + + dynamic regularOrder = {"id": 1, "name": "regular Order"}; + dynamic urgentOrder = {"id": 2, "name": "urgent Order"}; + dynamic strength1 = {"id": 1, "name": "1"}; + dynamic strength2 = {"id": 2, "name": "2"}; + dynamic strength3 = {"id": 3, "name": "3"}; + dynamic route1 = {"id": 7, "name": "By Mouth"}; + dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; + dynamic route3 = {"id": 15, "name": "for INJECTION"}; + dynamic route4 = {"id": 17, "name": "Drops"}; + dynamic route5 = {"id": 18, "name": "Rub On"}; + dynamic route6 = {"id": 20, "name": "Spary"}; + dynamic route7 = {"id": 27, "name": "In Both EYES"}; + dynamic route8 = {"id": 28, "name": "In Both Ears"}; + dynamic route9 = {"id": 32, "name": "Intramuscular"}; + dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; + dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; + dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; + dynamic frequency4 = {"id": 8, "name": "As Needed"}; + dynamic frequency5 = {"id": 9, "name": "Bed Time"}; + dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; + dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; + dynamic frequency8 = {"id": 34, "name": "As Directed"}; + dynamic duration1 = {"id": 1, "name": "For 1 Day"}; + dynamic duration2 = {"id": 2, "name": "For 2 Days"}; + dynamic duration3 = {"id": 3, "name": "For 3 Days"}; + dynamic duration4 = {"id": 4, "name": "For 4 Days"}; + dynamic duration5 = {"id": 5, "name": "For 5 Days"}; + dynamic duration6 = {"id": 6, "name": "For 6 Days"}; + dynamic duration7 = {"id": 7, "name": "For 7 Days"}; + dynamic duration8 = {"id": 8, "name": "For 8 Days"}; + dynamic duration9 = {"id": 9, "name": "For 9 Days"}; + dynamic duration10 = {"id": 10, "name": "For 10 Days"}; + dynamic duration11 = {"id": 14, "name": "For 14 Days"}; + dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; + dynamic doseTime2 = {"id": 2, "name": "After Meals"}; + dynamic doseTime3 = {"id": 3, "name": "With Meals"}; + dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; + dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; + dynamic doseTime6 = {"id": 6, "name": "After Supper"}; + dynamic doseTime7 = {"id": 7, "name": "With Supper"}; + dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; + dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; + dynamic doseTime10 = {"id": 10, "name": "While wake"}; + dynamic doseTime11 = {"id": 12, "name": "Any Time"}; + dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + + doseTimeList.add(doseTime1); + doseTimeList.add(doseTime2); + doseTimeList.add(doseTime3); + doseTimeList.add(doseTime4); + doseTimeList.add(doseTime5); + doseTimeList.add(doseTime6); + doseTimeList.add(doseTime7); + doseTimeList.add(doseTime8); + doseTimeList.add(doseTime9); + doseTimeList.add(doseTime10); + doseTimeList.add(doseTime11); + doseTimeList.add(doseTime12); + frequencyList.add(frequency1); + frequencyList.add(frequency2); + frequencyList.add(frequency3); + frequencyList.add(frequency4); + frequencyList.add(frequency5); + frequencyList.add(frequency6); + frequencyList.add(frequency7); + frequencyList.add(frequency8); + routeList.add(route1); + routeList.add(route2); + routeList.add(route3); + routeList.add(route4); + routeList.add(route5); + routeList.add(route6); + routeList.add(route7); + routeList.add(route8); + routeList.add(route9); + strengthList.add(strength1); + strengthList.add(strength2); + strengthList.add(strength3); + durationList.add(duration1); + durationList.add(duration2); + durationList.add(duration3); + durationList.add(duration4); + durationList.add(duration5); + durationList.add(duration6); + durationList.add(duration7); + durationList.add(duration8); + durationList.add(duration9); + durationList.add(duration10); + durationList.add(duration11); + referToList.add(regularOrder); + referToList.add(urgentOrder); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + // final routeArgs = ModalRoute.of(context).settings.arguments as Map; + // patient = routeArgs['patient']; + + return BaseView( + onModelReady: (model) => model.getDrugs(), + builder: (BuildContext context, PrescriptionViewModel model, + Widget child) => + DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.drugsList != null && + model.drugsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.drugsList, + attributeName: 'GenericName', + attributeValueId: 'ItemId', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + selectedDrug = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).search, + selectedDrug != null + ? selectedDrug['GenericName'] + : null, + true), + enabled: false, + ), ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .orderType, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: referToList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: referToList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + type = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .orderType, + type != null ? type['name'] : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .strength, - keyboardType: TextInputType.number, - controller: strengthController, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: strengthList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: strengthList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + strength = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .strength, + strength != null + ? strength['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( TranslationBase.of(context).route, - controller: routeController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + route != null + ? route['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .frequency, - controller: frequencyController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .frequency, + frequency != null + ? frequency['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .doseTime, - controller: doseController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .indication, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: TranslationBase.of(context) + .indication, + controller: indicationController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .fromDate, - keyboardType: TextInputType.datetime, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .duration, - // borderColor: Colors.white, - keyboardType: TextInputType.number, - controller: durationController, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - maxLines: 6, - minLines: 4, - hintText: TranslationBase.of(context) - .instruction, - controller: instructionController, - //keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: durationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: durationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .duration, + duration != null + ? duration['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + maxLines: 6, + minLines: 4, + hintText: TranslationBase.of(context) + .instruction, + controller: instructionController, + //keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState - .validate()) { - postProcedure( - model: model, + if (formKey.currentState + .validate()) { + postProcedure( + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, duration: - durationController.text, - dose: doseController.text, - frequency: - frequencyController.text, - route: routeController.text, - drugId: drugIdController.text, + duration['id'].toString(), + frequency: frequency['id'] + .toString(), + route: route['id'].toString(), + drugId: selectedDrug['ItemId'] + .toString(), strength: - strengthController.text, + strength['id'].toString(), indication: indicationController.text, instruction: - indicationController.text, - ); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], - ), + instructionController + .text, + doseTime: selectedDate); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ), - ); - }); - //); - }); -} - -// openAllergiesList(BuildContext context) { -// showModalBottomSheet( -// backgroundColor: Colors.white, -// isScrollControlled: true, -// context: context, -// builder: (context) { -// return AddAllergies( -// addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { -// setState(() { -// widget.myAllergiesList.add(mySelectedAllergy); -// Navigator.of(context).pop(); -// }); -// }, -// ); -// }); -// } - -postProcedure( - {String duration, - String dose, - String drugId, - String strength, - String route, - String frequency, - String indication, - String instruction, - PrescriptionViewModel model}) async { - PostPrescriptionReqModel postProcedureReqModel = - new PostPrescriptionReqModel(); - List sss = List(); - - postProcedureReqModel.appointmentNo = 2016055159; - postProcedureReqModel.clinicID = 17; - postProcedureReqModel.episodeID = 200012330; - postProcedureReqModel.patientMRN = 3120877; - postProcedureReqModel.vidaAuthTokenID = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; - sss.add(PrescriptionRequestModel( - covered: true, - dose: int.parse(dose), - itemId: int.parse(drugId), - doseUnitId: 1, - route: int.parse(route), - frequency: int.parse(frequency), - remarks: instruction, - approvalRequired: true, - icdcode10Id: "test2", - doseTime: 1, - duration: int.parse(duration), - doseStartDate: "2020-12-20T13:07:41.769Z")); - postProcedureReqModel.prescriptionRequestModel = sss; - //postProcedureReqModel.procedures = controlsProcedure; + ), + ); + }), + ); + } - await model.postPrescription(postProcedureReqModel); + selectDate(BuildContext context, PrescriptionViewModel model) async { + DateTime selectedDate; + selectedDate = DateTime.now().add(Duration(hours: 10)); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now().add(Duration(hours: 15)), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + this.selectedDate = picked; + }); + } + } - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('Medication has been added'); + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 06a6a218..142f3a98 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -33,452 +33,535 @@ class _NewPrescriptionScreenState extends State { @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getPrescription(), - builder: (BuildContext context, PrescriptionViewModel model, - Widget child) => - AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescription, - body: NetworkBaseView( - baseViewModel: model, - child: SingleChildScrollView( - child: Container( - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - if (model.prescriptionList.length > 0) - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], + onModelReady: (model) => model.getPrescription(mrn: patient.patientMRN), + builder: + (BuildContext context, PrescriptionViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), - if (model.prescriptionList.length != 0) - SizedBox( - height: model.prescriptionList[0].rowcount == 0 - ? 200.0 - : 10.0), - //model.prescriptionList == null - if (model.prescriptionList.length != 0) - model.prescriptionList[0].rowcount == 0 - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - addPrescriptionForm(context, model); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), - child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + + ' ' + + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + //if (model.prescriptionList.length > 0) + Row( + children: [ + AppText( + TranslationBase.of(context).age2, color: Colors.black, - size: 45.0, + fontWeight: FontWeight.bold, ), - ), + SizedBox( + width: 5.0, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context) - .noPrescriptionListed, - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w900, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(14.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular(10.0), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - ' Add more medication', - fontWeight: FontWeight.w100, - fontSize: 12.5, - ), - Icon( - Icons.add, - color: Color(0XFFB8382C), - ) - ], + AppText( + "ALLERGIC TO: FOOD, ASPIRIN", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ], + ) + ], + ), + ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.prescriptionList.length != 0) + ? SizedBox( + height: + model.prescriptionList[0].rowcount == 0 + ? 200.0 + : 10.0) + : SizedBox(height: 200.0), + //model.prescriptionList == null + (model.prescriptionList.length != 0) + ? model.prescriptionList[0].rowcount == 0 + ? Column( + mainAxisAlignment: + MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm( + context, model, patient); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: + Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), ), ), ), - onTap: () { - addPrescriptionForm(context, model); - //model.postPrescription(); - }, - ), - SizedBox( - height: 15.0, - ), - ...List.generate( - model.prescriptionList[0].rowcount, - (index) => Container( - //height: 240, - child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - // crossAxisAlignment: - // CrossAxisAlignment.start, - children: [ - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.23, - width: - MediaQuery.of(context) - .size - .width * - 0.09, - child: Column( - children: [ - AppText( - '8\nDEC', - color: Colors.green, - ) - ], - ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context) + .noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context) + .addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(14.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey), + borderRadius: + BorderRadius.circular( + 10.0), + ), + child: Padding( + padding: + EdgeInsets.all(8.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + ' Add more medication', + fontWeight: + FontWeight.w100, + fontSize: 12.5, + ), + Icon( + Icons.add, + color: + Color(0XFFB8382C), + ) + ], ), - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.282, - width: - MediaQuery.of(context) - .size - .width * - 0.77, - child: Column( + ), + ), + onTap: () { + addPrescriptionForm( + context, model, patient); + //model.postPrescription(); + }, + ), + SizedBox( + height: 15.0, + ), + ...List.generate( + model.prescriptionList[0] + .rowcount, + (index) => Container( + //height: 240, + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, children: [ - Row( - children: [ - AppText( - 'Start Date:', - fontWeight: - FontWeight - .w700, - fontSize: 14.0, - ), - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .startDate, - fontSize: - 12.0, + Container( + height: MediaQuery.of( + context) + .size + .height * + 0.23, + width: MediaQuery.of( + context) + .size + .width * + 0.09, + child: Column( + children: [ + AppText( + '8\nDEC', + color: Colors + .green, + ) + ], + ), + ), + Container( + height: MediaQuery.of( + context) + .size + .height * + 0.282, + width: MediaQuery.of( + context) + .size + .width * + 0.77, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: + FontWeight + .w700, + fontSize: + 14.0, + ), + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .startDate, + fontSize: + 12.0, + ), + ), + SizedBox( + width: + 6.0, + ), + AppText( + 'Order Type:', + fontWeight: + FontWeight + .w700, + fontSize: + 14.0, + ), + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .orderTypeDescription, + fontSize: + 13.0, + ), + ), + ], ), - ), - SizedBox( - width: 6.0, - ), - AppText( - 'Order Type:', - fontWeight: - FontWeight - .w700, - fontSize: 14.0, - ), - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .orderTypeDescription, - fontSize: - 13.0, + SizedBox( + height: 5.5, ), - ), - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Container( - child: Expanded( - child: - AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), + Row( + children: [ + Container( + child: + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .medicationName, + fontWeight: + FontWeight.w700, + fontSize: + 15.0, + ), + ), + ) + ], ), - ) - ], - ), - SizedBox( - height: 5.5, - ), - Row( - children: [ - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .doseDetail, - fontSize: - 15.0, + SizedBox( + height: 5.5, ), - ) - ], - ), - SizedBox( - height: 3.0, - ), - Row( - children: [ - AppText( - 'Indication: ', - fontWeight: - FontWeight - .w700, - fontSize: 17.0, - ), - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .indication, - fontSize: - 15.0), - ) - ], - ), - SizedBox( - height: 18.0, - ), - Row( - children: [ - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .doctorName, - fontWeight: - FontWeight - .w700, + Row( + children: [ + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .doseDetail, + fontSize: + 15.0, + ), + ) + ], ), - ) - ], - ), - Row( - children: [ - Expanded( - child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .remarks, - fontSize: - 14.0, + SizedBox( + height: 3.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: AppText( + model + .prescriptionList[0] + .entityList[index] + .indication, + fontSize: 15.0), + ) + ], + ), + SizedBox( + height: 18.0, + ), + Row( + children: [ + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .doctorName, + fontWeight: + FontWeight.w700, + ), + ) + ], + ), + Row( + children: [ + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .remarks, + fontSize: + 14.0, + ), + ), + ], + ), + SizedBox( + height: 10.0, ), - ), - ], - ), - SizedBox( - height: 10.0, - ), - Divider( - height: 0, - thickness: 1.0, - color: Colors.grey, + Divider( + height: 0, + thickness: + 1.0, + color: Colors + .grey, + ), + // SizedBox( + // height: 40, + // ), + ], + ), ), - // SizedBox( - // height: 40, - // ), - ], - ), - ), - Container( - height: - MediaQuery.of(context) - .size - .height * - 0.05, - width: - MediaQuery.of(context) - .size - .width * - 0.06, - child: Column( - children: [ - InkWell( - child: Icon( - Icons.edit), - onTap: () { - updatePrescriptionForm( - context, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicineCode, - model, - ); - //model.postPrescription(); - }, + Container( + height: MediaQuery.of( + context) + .size + .height * + 0.05, + width: MediaQuery.of( + context) + .size + .width * + 0.06, + child: Column( + children: [ + InkWell( + child: Icon( + Icons + .edit), + onTap: () { + updatePrescriptionForm( + context, + model + .prescriptionList[ + 0] + .entityList[ + index] + .medicationName, + model + .prescriptionList[ + 0] + .entityList[ + index] + .medicineCode, + model, + ); + //model.postPrescription(); + }, + ), + ], + ), ), ], ), - ), - ], + ], + ), ), - ], + ), + ], + ), + ), + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + addPrescriptionForm( + context, model, patient); + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, ), ), ), - ], - ), - ), - ) - ], + ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context) + .noPrescriptionListed, + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w900, + ), + ], + ), + ], + ) + ], + ), + ), ), - ), - ), - )), + )), ); } + selectDate(BuildContext context, PrescriptionViewModel model) async { + DateTime selectedDate; + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now().add(Duration(hours: 2)), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + selectedDate = picked; + }); + } + } + void updatePrescriptionForm( context, String drugName, int drugId, PrescriptionViewModel model) { TextEditingController remarksController = TextEditingController(); @@ -637,7 +720,8 @@ class _NewPrescriptionScreenState extends State { updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; - await model.updatePrescription(updatePrescriptionReqModel); + await model.updatePrescription( + updatePrescriptionReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index c0afe663..a6b9791b 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -509,7 +509,7 @@ class _AddSelectedProcedureState extends State { baseViewModel: widget.model, child: SingleChildScrollView( child: Container( - height: 790, + height: 810, child: Padding( padding: EdgeInsets.all(12.0), child: Column( @@ -566,7 +566,7 @@ class _AddSelectedProcedureState extends State { maxLines: 5, ), SizedBox( - height: 80.0, + height: 50.0, ), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 9e17d53b..68dce5a4 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -66,10 +66,13 @@ class _ListSelectDialogState extends State { ...widget.list .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), - groupValue: widget.selectedValue[widget.attributeValueId].toString(), + groupValue: widget.selectedValue[widget.attributeValueId] + .toString(), value: item[widget.attributeValueId].toString(), activeColor: Colors.blue.shade700, - selected: item[widget.attributeValueId].toString() == widget.selectedValue[widget.attributeValueId].toString(), + selected: item[widget.attributeValueId].toString() == + widget.selectedValue[widget.attributeValueId] + .toString(), onChanged: (val) { setState(() { widget.selectedValue = item; From 9aa5ab4228feabc8b85063377b7c679741b529b1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 5 Jan 2021 09:23:15 +0200 Subject: [PATCH 139/421] small changes --- lib/client/base_app_client.dart | 3 +++ .../post_chief_complaint_request_model.dart | 21 ++++++++++++------- ...et_patient_arrival_list_request_model.dart | 3 ++- .../subjective/update_subjective_page.dart | 5 +++-- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83923ea7..e2dbfd02 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -49,6 +49,9 @@ class BaseAppClient { if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; } + if (body['DoctorID'] == '') { + body['DoctorID'] =null; + } body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index bedf2978..ed58e58a 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -8,17 +8,19 @@ class PostChiefComplaintRequestModel { bool ispregnant; bool isLactation; int numberOfWeeks; + dynamic doctorID; PostChiefComplaintRequestModel( {this.appointmentNo, - this.episodeID, - this.patientMRN, - this.chiefComplaint, - this.hopi, - this.currentMedication, - this.ispregnant, - this.isLactation, - this.numberOfWeeks}); + this.episodeID, + this.patientMRN, + this.chiefComplaint, + this.hopi, + this.currentMedication, + this.ispregnant, + this.isLactation, + this.doctorID, + this.numberOfWeeks}); PostChiefComplaintRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; @@ -30,6 +32,7 @@ class PostChiefComplaintRequestModel { ispregnant = json['ispregnant']; isLactation = json['isLactation']; numberOfWeeks = json['numberOfWeeks']; + doctorID = json['DoctorID']; } Map toJson() { @@ -43,6 +46,8 @@ class PostChiefComplaintRequestModel { data['ispregnant'] = this.ispregnant; data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; + data['DoctorID'] = this.doctorID; + return data; } } diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 393790dd..66890a8f 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -28,13 +28,14 @@ class GetPatientArrivalListRequestModel { Map toJson() { final Map data = new Map(); - data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['From'] = this.from; data['To'] = this.to; data['DoctorID'] = this.doctorID; data['PageIndex'] = this.pageIndex; data['PageSize'] = this.pageSize; data['ClinicID'] = this.clinicID; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 89e617d6..e0d92788 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -552,8 +552,9 @@ class _UpdateSubjectivePageState extends State { currentMedication: " currentMedication ", hopi: illnessController.text, isLactation: false, - ispregnant: true, - numberOfWeeks: 22); + ispregnant: false, + doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work await model.postChiefComplaint(postChiefComplaintRequestModel); From e75e7801aa2773ce83ad5240266c624247e23257 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 5 Jan 2021 10:02:51 +0200 Subject: [PATCH 140/421] working on UCAF get data --- lib/client/base_app_client.dart | 2 + lib/config/localized_values.dart | 1 + lib/core/service/patient-ucaf-service.dart | 53 ++ .../service/patient-vital-signs-service.dart | 37 +- .../viewModel/patient-ucaf-viewmodel.dart | 21 + .../profile/UCAF/UCAF-input-screen.dart | 581 +++++++++--------- lib/util/translations_delegate_base.dart | 1 + pubspec.lock | 6 +- 8 files changed, 386 insertions(+), 316 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 83923ea7..3a39c5e9 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -42,6 +42,8 @@ class BaseAppClient { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; + if (body['DoctorID'] == "") + body['DoctorID'] = null; body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 10ac9856..d0cd8720 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -527,4 +527,5 @@ const Map> localizedValues = { 'covered': {'en': "Covered", 'ar':"مغطى" }, 'approvalRequired': {'en': "Approval Required", 'ar':"الموافقة مطلوبة" }, 'uncoveredByDoctor': {'en': "Uncovered By Doctor", 'ar':"غير مغطى من قبل الدكتور" }, + 'chiefComplaintEmptyMsg': {'en': "There is no Chief Complaint", 'ar':"ليس هناك شكوى رئيس" }, }; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index e776720c..06fbce41 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -1,5 +1,58 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; class UcafService extends BaseService { + List patientChiefComplaintList = []; + VitalSignData patientVitalSigns; + + Future getPatientChiefComplaint(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; + body['DoctorID'] = ""; + + await baseAppClient.post (GET_CHIEF_COMPLAINT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientChiefComplaintList.clear(); + response['List_ChiefComplaint']['entityList'].forEach((v) { + patientChiefComplaintList.add(GetChiefComplaintResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientVitalSign(PatiantInformtion patient) async { + patientVitalSigns = null; + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; + + await baseAppClient.post( + GET_PATIENT_VITAL_SIGN_DATA, + onSuccess: (dynamic response, int statusCode) { + if(response['VitalSignsList'] != null){ + if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ + patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); + } + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error.toString(); + }, + body: body, + ); + } } \ No newline at end of file diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 43786ac0..8d0cfc31 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -11,43 +11,8 @@ class VitalSignsService extends BaseService{ List patientVitalSignOrderdSubList = []; VitalSignData patientVitalSigns; - /*Future getPatientVitalSign(patient) async { - hasError = false; - await baseAppClient.post( - GET_PATIENT_VITAL_SIGN, - onSuccess: (dynamic response, int statusCode) { - patientVitalSignList = []; - response['List_DoctorPatientVitalSign'].forEach((v) { - patientVitalSignList.add(new VitalSignResModel.fromJson(v)); - }); - - if (patientVitalSignList.length > 0) { - List patientVitalSignOrderdSubListTemp = []; - patientVitalSignOrderdSubListTemp = patientVitalSignList; - patientVitalSignOrderdSubListTemp - .sort((VitalSignResModel a, VitalSignResModel b) { - return b.vitalSignDate.microsecondsSinceEpoch - - a.vitalSignDate.microsecondsSinceEpoch; - }); - patientVitalSignOrderdSubList.clear(); - int length = patientVitalSignOrderdSubListTemp.length >= 20 - ? 20 - : patientVitalSignOrderdSubListTemp.length; - for (int x = 0; x < length; x++) { - patientVitalSignOrderdSubList - .add(patientVitalSignOrderdSubListTemp[x]); - } - } - }, - onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, - body: patient, - ); - } // Vit*/ - Future getPatientVitalSign(PatiantInformtion patient) async { + patientVitalSigns = null; hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientMRN; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index cf11854b..c120e2ab 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,9 +1,30 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import '../../locator.dart'; class UcafViewModel extends BaseViewModel { UcafService _ucafService = locator(); + + List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns; + + Future getUCAFData(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _ucafService.getPatientVitalSign(patient); + await _ucafService.getPatientChiefComplaint(patient); + + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + } \ No newline at end of file diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index e0c2f9a7..0116ce46 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -14,6 +14,7 @@ import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; +import '../../../QR_reader_screen.dart'; class UCAFInputScreen extends StatefulWidget { @override @@ -55,312 +56,338 @@ class _UCAFInputScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) => model.getUCAFData(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, - body: SingleChildScrollView( - child: Column( - children: [ - PatientHeaderWidgetNoAvatar(patient), - Container( - margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + body: model.patientVitalSigns != null && + model.patientChiefComplaintList != null && + model.patientChiefComplaintList.length > 0 + ? SingleChildScrollView( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, children: [ - CheckboxListTile( - title: AppText( - TranslationBase.of(context).inPatient, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _inPatient, - onChanged: (newValue) { - setState(() { - _inPatient = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).emergencyCase, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _emergencyCase, - onChanged: (newValue) { - setState(() { - _emergencyCase = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), + PatientHeaderWidgetNoAvatar(patient), Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).durationOfIllness, - null, - false), - enabled: true, - controller: _durationOfIllnessController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "BP (H/L)", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "120/80", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "37.5(C), 98.6(F)", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row( - children: [ - AppText( - "${TranslationBase.of(context).pulseBeats} :", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + CheckboxListTile( + title: AppText( + TranslationBase.of(context).inPatient, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, ), - AppText( - "80", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, + value: _inPatient, + onChanged: (newValue) { + setState(() { + _inPatient = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context).emergencyCase, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, ), - ], - ), - ], - ), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).chiefComplaintsAndSymptoms, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 8, - ), - AppText( - TranslationBase.of(context) - .patientFeelsPainInHisBackAndCough, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).additionalTextComplaints, - null, - false), - enabled: true, - controller: _additionalComplaintsController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).otherConditions, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - ...List.generate( - conditionsData.length, - (index) => CheckboxListTile( - title: AppText( - conditionsData[index]['name'], - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.1, + value: _emergencyCase, + onChanged: (newValue) { + setState(() { + _emergencyCase = newValue; + }); + }, + controlAffinity: ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .durationOfIllness, + null, + false), + enabled: true, + controller: _durationOfIllnessController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "BP (H/L)", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.bloodPressureHigher}/${model.patientVitalSigns.bloodPressureLower}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], ), - value: conditionsData[index]['isChecked'], - onChanged: (newValue) { - setState(() { - conditionsData[index]['isChecked'] = newValue; - }); - }, - controlAffinity: ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).other, - null, - false), - enabled: true, - controller: _otherController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).how, - null, - false), - enabled: true, - controller: _howController, - keyboardType: TextInputType.text, - )), - SizedBox( - height: 8, - ), - Row( - children: [ - Expanded( - child: Container( + Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + AppText( + "${TranslationBase.of(context).pulseBeats} :", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + AppText( + "${model.patientVitalSigns.pulseBeatPerMinute}", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ], + ), + ], + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context) + .chiefComplaintsAndSymptoms, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 8, + ), + AppText( + TranslationBase.of(context) + .patientFeelsPainInHisBackAndCough, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .additionalTextComplaints, + helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), + false), + enabled: false, + controller: _additionalComplaintsController, + keyboardType: TextInputType.text, + /*minLines: 4, + maxLines: 6,*/ + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).otherConditions, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ...List.generate( + conditionsData.length, + (index) => CheckboxListTile( + title: AppText( + conditionsData[index]['name'], + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: conditionsData[index]['isChecked'], + onChanged: (newValue) { + setState(() { + conditionsData[index]['isChecked'] = + newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + )), + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).when, + TranslationBase.of(context).other, null, false), enabled: true, - controller: _whenController, + controller: _otherController, keyboardType: TextInputType.text, )), - ), - SizedBox( - width: 4, - ), - Expanded( - child: Container( + SizedBox( + height: 8, + ), + Container( height: screenSize.height * 0.070, child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).where, + TranslationBase.of(context).how, null, false), enabled: true, - controller: _whereController, + controller: _howController, keyboardType: TextInputType.text, )), - ), - ], - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).specifyPossibleLineManagement, - null, - false), - enabled: true, - controller: _managementsLineController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context) - .significantSigns, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, - ), - SizedBox( - height: 8, - ), - Container( - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).backAbdomen, - null, - false), - enabled: true, - controller: _signsController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 16, - ), - AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#B8382B"), - onPressed: (){ - Navigator.of(context).pushNamed(PATIENT_UCAF_DETAIL, arguments: {'patient': patient}); - }, + SizedBox( + height: 8, + ), + Row( + children: [ + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).when, + null, + false), + enabled: true, + controller: _whenController, + keyboardType: TextInputType.text, + )), + ), + SizedBox( + width: 4, + ), + Expanded( + child: Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).where, + null, + false), + enabled: true, + controller: _whereController, + keyboardType: TextInputType.text, + )), + ), + ], + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .specifyPossibleLineManagement, + null, + false), + enabled: true, + controller: _managementsLineController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).significantSigns, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + SizedBox( + height: 8, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).backAbdomen, + null, + false), + enabled: true, + controller: _signsController, + keyboardType: TextInputType.text, + )), + SizedBox( + height: 16, + ), + AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: () { + Navigator.of(context).pushNamed( + PATIENT_UCAF_DETAIL, + arguments: {'patient': patient}); + }, + ), + ], + ), ), ], ), + ) + : Container( + child: Center( + child: AppText( + model.patientVitalSigns == null + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context).chiefComplaintEmptyMsg, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ), ), - ], - ), - ), ), ); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 37e39676..e2cba7f3 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -548,6 +548,7 @@ class TranslationBase { String get covered => localizedValues['covered'][locale.languageCode]; String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index 5650f5f9..7f1d8c1d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -503,7 +503,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: @@ -760,7 +760,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: @@ -895,5 +895,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 044ad7b51a7ea81f384b80c9d98a3c72f3d4962d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 5 Jan 2021 12:14:35 +0300 Subject: [PATCH 141/421] offtime leave --- lib/config/localized_values.dart | 2 + lib/core/viewModel/sick_leave_view_model.dart | 1 + .../add-rescheduleleave.dart | 4 +- .../reschedule-leaves/reschedule_leave.dart | 77 +++++++++++++------ lib/util/translations_delegate_base.dart | 4 + 5 files changed, 63 insertions(+), 25 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 7e824f5f..254bca19 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -519,4 +519,6 @@ const Map> localizedValues = { 'en': "You make referral successfully", 'ar': "You make referral successfully" }, + 'fromTime': {'en': "From Time", 'ar': "من وقت"}, + 'toTime': {'en': "To Time", 'ar': "الى وقت"}, }; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index d5aba154..5e86249c 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -99,6 +99,7 @@ class SickLeaveViewModel extends BaseViewModel { Future addReschedule(request) async { setState(ViewState.Busy); await _sickLeaveService.addReschedule(request); + notifyListeners(); if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 2067029f..685259b4 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -299,7 +299,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { getDoctor(model, doctorId) { var obj; obj = model.where((i) => i['doctorID'].toString() == doctorId).toList(); - print(obj); + //print(obj); return obj.length > 0 ? obj[0]['doctorName'] : ""; } @@ -307,7 +307,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { getReasons(model, reasonID) { var obj; obj = model.where((i) => i['id'] == reasonID).toList(); - print(obj); + //print(obj); return obj.length > 0 ? projectsProvider.isArabic == true diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 362e27d9..bdd87499 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -24,6 +24,7 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; Helpers helpers = Helpers(); @@ -49,13 +50,40 @@ class _RescheduleLeaveScreen extends State { var fromDate; var toDate; var clinicID; + var fromTime; + var toTime; TextEditingController _controller4; void _presentDatePicker(id) { var date = new DateTime.now(); + var initialDate = id == 'fromDate' + ? new DateTime(date.year, date.month, date.day + 15) + : new DateTime(fromDate.year, fromDate.month, fromDate.day); + var firstDate = id == 'fromDate' + ? new DateTime(date.year, date.month, date.day + 15) + : new DateTime(fromDate.year, fromDate.month, fromDate.day); showDatePicker( context: context, - initialDate: new DateTime(date.year, date.month, date.day + 15), - firstDate: new DateTime(date.year, date.month, date.day + 15), + initialDate: initialDate, + firstDate: firstDate, + lastDate: DateTime(2050), + ).then((pickedDate) { + if (pickedDate == null) { + return; + } + setState(() { + final df = new DateFormat('yyyy-MM-dd'); + fromDate = pickedDate; //df.format(); + _toDateController.text = df.format(pickedDate); + toDate = pickedDate; + }); + }); + } + + void _presentCurrentDate(id) { + showDatePicker( + context: context, + initialDate: DateTime.now(), + firstDate: DateTime.now(), lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { @@ -328,7 +356,7 @@ class _RescheduleLeaveScreen extends State { TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker( + _presentCurrentDate( 'fromDate'); }, inputFormatter: ONLY_DATE, @@ -355,14 +383,11 @@ class _RescheduleLeaveScreen extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - // new AppTextFormField( - // readOnly: true, - // hintText: "", - // borderColor: Colors.white, - // onSaved: (value) {}, - // inputFormatter: ONLY_NUMBERS), - DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .fromTime, type: DateTimePickerType.time, controller: _controller4, @@ -373,6 +398,7 @@ class _RescheduleLeaveScreen extends State { //locale: Locale('en', 'US'), onChanged: (val) => () { print(val); + this.fromTime = val; }, validator: (val) { print(val); @@ -403,16 +429,15 @@ class _RescheduleLeaveScreen extends State { CrossAxisAlignment.start, children: [ DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .toTime, type: DateTimePickerType.time, controller: _controller4, - //initialValue: _initialValue, - // icon: Icon(Icons.access_time), - - //use24HourFormat: false, - //locale: Locale('en', 'US'), onChanged: (val) => () { - print(val); + this.toTime = val; }, validator: (val) { print(val); @@ -761,7 +786,7 @@ class _RescheduleLeaveScreen extends State { "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), - "dateTimeTo": df.format(toDate), + "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -772,8 +797,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": null, - "timeTo": null, + "timeFrom": fromTime, + "timeTo": toTime, "timeFromstr": "", "timeTostr": "" } @@ -784,7 +809,13 @@ class _RescheduleLeaveScreen extends State { model.addReschedule(request).then((response) { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); Navigator.pop(context); - model.getRescheduleLeave(); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + ), + ); }); } @@ -797,7 +828,7 @@ class _RescheduleLeaveScreen extends State { "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], "dateTimeFrom": df.format(fromDate), - "dateTimeTo": df.format(toDate), + "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -808,8 +839,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": null, - "timeTo": null, + "timeFrom": fromTime, + "timeTo": toTime, "timeFromstr": "", "timeTostr": "" } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 7edccb43..ec34bf4c 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -289,6 +289,10 @@ class TranslationBase { String get toDate => localizedValues['toDate'][locale.languageCode]; + String get fromTime => localizedValues['fromTime'][locale.languageCode]; + + String get toTime => localizedValues['toTime'][locale.languageCode]; + String get searchPatientImageCaptionTitle => localizedValues['searchPatientImageCaptionTitle'][locale.languageCode]; From eb5a3a59ffed5e8659cfcdc9ce15b1a114df2bf0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 5 Jan 2021 11:19:13 +0200 Subject: [PATCH 142/421] hot fixing --- .../medical-file/medical_file_page.dart | 10 +++--- lib/screens/patients/patients_screen.dart | 20 ++++------- .../prescription/add_prescription_form.dart | 2 +- .../profile/patient_profile_widget.dart | 36 ++++++++++--------- .../soap_update/update_objective_page.dart | 2 ++ 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index ad693f47..1e3b4739 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -124,10 +124,12 @@ class _MedicalFilePageState extends State { 'Doctor : '.toUpperCase(), fontWeight: FontWeight.w700, ), - AppText( - model.medicalFileList[0].entityList[0] - .timelines[index].doctorName, - fontWeight: FontWeight.w700, + Expanded( + child: AppText( + model.medicalFileList[0].entityList[0] + .timelines[index].doctorName, + fontWeight: FontWeight.w700, + ), ), ], ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 33b2606c..602bd180 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -466,25 +466,17 @@ class _PatientsScreenState extends State { height: 10.0, ), - Padding( - padding: EdgeInsets.symmetric( - vertical: - 5.5, - horizontal: - 22.5), - child: - AppText( + AppText( item.firstName + - " " + - item.lastName, + " " + + item.lastName, fontSize: - 2.0 * SizeConfig.textMultiplier, + 2.0 * SizeConfig.textMultiplier, fontWeight: - FontWeight.bold, + FontWeight.bold, backGroundcolor: - Colors.white, + Colors.white, ), - ), ], ), Row( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f39499e1..405f240b 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -696,7 +696,7 @@ class _PrescriptionFormWidgetState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; - selectedDate = DateTime.now().add(Duration(hours: 10)); + selectedDate = DateTime.now().add(Duration(hours: 15)); final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index f50c7669..7f49c868 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget { color: Color(0xffCCCCCC), ), Container( - height: 10 * SizeConfig.textMultiplier, + height: 11 * SizeConfig.textMultiplier, child: Row( children: [ Expanded( @@ -232,14 +232,16 @@ class PatientProfileWidget extends StatelessWidget { SizeConfig.textMultiplier, ), ), - AppText( - patient.admissionDate != null - ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, + Expanded( + child: AppText( + patient.admissionDate != null + ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, + ), ), ], ), @@ -374,13 +376,15 @@ class PatientProfileWidget extends StatelessWidget { SizedBox( width: 4, ), - AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight.normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, + Expanded( + child: AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: + FontWeight.normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, + ), ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index e3aef3f4..37a5d72f 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -505,6 +505,8 @@ class _AddExaminationDailogState extends State { baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, + hintSearchText: 'Search Examination', + buttonName: 'Add Examination', masterList: model.physicalExaminationList, removeHistory: (history){ setState(() { From c4cae6fb38e4d18ae560c0bca412c4f17a9ae14c Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 5 Jan 2021 16:45:20 +0300 Subject: [PATCH 143/421] doctor leave bug fix --- lib/core/service/sickleave_service.dart | 13 +- lib/core/viewModel/sick_leave_view_model.dart | 3 +- .../reschedule-leaves/reschedule_leave.dart | 173 ++++++++++-------- 3 files changed, 112 insertions(+), 77 deletions(-) diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index c4aa8abf..63a7496c 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -21,6 +21,9 @@ class SickLeaveService extends BaseService { List get getAllRescheduleLeave => _getReScheduleLeave; List _getReScheduleLeave = []; + dynamic get postReschedule => _postReschedule; + dynamic _postReschedule; + Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -171,15 +174,17 @@ class SickLeaveService extends BaseService { ); } - addReschedule(request) async { + Future addReschedule(request) async { hasError = false; await baseAppClient.post( ADD_RESCHDEULE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); + // return Future.value(response); + _postReschedule = response; }, onFailure: (String error, int statusCode) { + _postReschedule = null; hasError = true; super.error = error; }, @@ -193,9 +198,11 @@ class SickLeaveService extends BaseService { await baseAppClient.post( UPDATE_RESCHDEULE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); + _postReschedule = response; + // return Future.value(response); }, onFailure: (String error, int statusCode) { + _postReschedule = null; hasError = true; super.error = error; }, diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 5e86249c..8e1c68d9 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -16,6 +16,7 @@ class SickLeaveViewModel extends BaseViewModel { List get allReasons => _sickLeaveService.getReasons; List get coveringDoctors => _sickLeaveService.coveringDoctorsList; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; + get postSechedule => _sickLeaveService.postReschedule; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); @@ -99,7 +100,7 @@ class SickLeaveViewModel extends BaseViewModel { Future addReschedule(request) async { setState(ViewState.Busy); await _sickLeaveService.addReschedule(request); - notifyListeners(); + if (_sickLeaveService.hasError) { error = _sickLeaveService.error; setState(ViewState.Error); diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index bdd87499..6f3299d1 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/sick_leave_view_model.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; @@ -41,9 +42,10 @@ class _RescheduleLeaveScreen extends State { TextEditingController _toDateController = new TextEditingController(); TextEditingController _toDateController2 = new TextEditingController(); ProjectViewModel projectsProvider; + SickLeaveViewModel sickLeaveViewModel; String _selectedClinic; Map profile = {}; - var offTime = '2'; + var offTime = '1'; var date; var doctorID; var reason; @@ -53,6 +55,7 @@ class _RescheduleLeaveScreen extends State { var fromTime; var toTime; TextEditingController _controller4; + TextEditingController _controller5; void _presentDatePicker(id) { var date = new DateTime.now(); var initialDate = id == 'fromDate' @@ -66,25 +69,6 @@ class _RescheduleLeaveScreen extends State { initialDate: initialDate, firstDate: firstDate, lastDate: DateTime(2050), - ).then((pickedDate) { - if (pickedDate == null) { - return; - } - setState(() { - final df = new DateFormat('yyyy-MM-dd'); - fromDate = pickedDate; //df.format(); - _toDateController.text = df.format(pickedDate); - toDate = pickedDate; - }); - }); - } - - void _presentCurrentDate(id) { - showDatePicker( - context: context, - initialDate: DateTime.now(), - firstDate: DateTime.now(), - lastDate: DateTime(2050), ).then((pickedDate) { if (pickedDate == null) { return; @@ -99,6 +83,13 @@ class _RescheduleLeaveScreen extends State { _toDateController2.text = df.format(pickedDate); } }); + + setState(() { + final df = new DateFormat('yyyy-MM-dd'); + fromDate = pickedDate; //df.format(); + _toDateController.text = df.format(pickedDate); + toDate = pickedDate; + }); }); } @@ -112,6 +103,7 @@ class _RescheduleLeaveScreen extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); + return BaseView( onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => BaseView( @@ -345,24 +337,26 @@ class _RescheduleLeaveScreen extends State { CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: _toDateController, - onTap: () { - _presentCurrentDate( - 'fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - fromDate = value; - }), + hintText: + TranslationBase.of(context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + Icons.calendar_today)), + textInputType: + TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker( + 'fromDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (val) => + fromDate = val, + onSaved: (val) => + fromDate = val, + ) ], )), Row( @@ -391,22 +385,16 @@ class _RescheduleLeaveScreen extends State { type: DateTimePickerType.time, controller: _controller4, - //initialValue: _initialValue, - // icon: Icon(Icons.access_time), - - //use24HourFormat: false, - //locale: Locale('en', 'US'), - onChanged: (val) => () { - print(val); - this.fromTime = val; - }, + onChanged: (val) => + fromTime = val, validator: (val) { print(val); // setState( // () => _valueToValidate4 = val); return null; }, - onSaved: (val) => {}, + onSaved: (val) => + fromTime = val, ) ], ), @@ -435,10 +423,9 @@ class _RescheduleLeaveScreen extends State { .toTime, type: DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => () { - this.toTime = val; - }, + controller: _controller5, + onChanged: (val) => + toTime = val, validator: (val) { print(val); // setState( @@ -446,7 +433,7 @@ class _RescheduleLeaveScreen extends State { return null; }, onSaved: (val) => - {print(val)}, + toTime = val, ) ], ), @@ -510,7 +497,7 @@ class _RescheduleLeaveScreen extends State { AppTextFormField( hintText: TranslationBase .of(context) - .fromDate, + .toDate, borderColor: Colors.white, prefix: IconButton( icon: Icon( @@ -777,16 +764,34 @@ class _RescheduleLeaveScreen extends State { return clinicInfo.length > 0 ? clinicInfo[0]['ClinicDescription'] : ""; } - addRecheduleLeave(model) { - final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); + addRecheduleLeave(model) async { + final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); + final dateFormat = new DateFormat('yyyy-MM-dd'); + var fromDates = fromDate; + var toDates = toDate; + if (offTime == '1') { + fromDate = df.format(DateTime.parse(dateFormat.format(fromDates) + + 'T' + + fromTime + + ':' + + DateTime.now().second.toString())); + toDate = df.format(DateTime.parse(dateFormat.format(fromDates) + + 'T' + + toTime + + ':' + + DateTime.now().second.toString())); + } else { + fromDate = df.format(fromDates); + toDate = df.format(toDates); + } Map request = { "Requisition": { "requisitionNo": 0, "requisitionType": offTime, "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], - "dateTimeFrom": df.format(fromDate), - "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), + "dateTimeFrom": fromDate, + "dateTimeTo": toDate, "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -797,8 +802,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": fromTime, - "timeTo": toTime, + "timeFrom": "", + "timeTo": "", "timeFromstr": "", "timeTostr": "" } @@ -806,29 +811,41 @@ class _RescheduleLeaveScreen extends State { } }; - model.addReschedule(request).then((response) { - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); - Navigator.pop(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - // MyReferredPatient(), - ), - ); + await model.addReschedule(request).then((value) { + if (model.postSechedule != null) { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); + Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + ), + ); + } }); } updateRecheduleLeave(model) { final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); + final dateFormat = new DateFormat('yyyy-MM-dd'); + + if (offTime == '1') { + fromDate = dateFormat.format(fromDate) + 'T' + fromTime + '00'; + toDate = dateFormat.format(fromDate) + 'T' + toTime + '00'; + } else { + fromDate = df.format(fromDate); + toDate = df.format(toDate); + } + Map request = { "Requisition": { "requisitionNo": 0, "requisitionType": offTime, "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], - "dateTimeFrom": df.format(fromDate), - "dateTimeTo": toDate != null ? df.format(toDate) : df.format(fromDate), + "dateTimeFrom": fromDate, + "dateTimeTo": toDate, "date": df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": @@ -849,7 +866,17 @@ class _RescheduleLeaveScreen extends State { }; model.updateReschedule(request).then((response) { - print(response); + if (model.postSechedule != null) { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).leaveCreated); + Navigator.pushNamedAndRemoveUntil(context, HOME, (r) => false); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + ), + ); + } }); } } From 50d7f733b638cf7c351a89e14f08f32c11963882 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 5 Jan 2021 16:25:05 +0200 Subject: [PATCH 144/421] working on UCAF datails and add patient procedure list and diagnosis --- lib/config/config.dart | 1 + lib/core/service/patient-ucaf-service.dart | 48 +++++++- .../viewModel/patient-ucaf-viewmodel.dart | 94 ++++++++++++++- lib/models/SOAP/order-procedure.dart | 110 ++++++++++++++++++ .../profile/UCAF/UCAF-detail-screen.dart | 101 +++++++++++++--- 5 files changed, 332 insertions(+), 22 deletions(-) create mode 100644 lib/models/SOAP/order-procedure.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e3163bb2..1ac3c517 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -160,6 +160,7 @@ const GET_CHIEF_COMPLAINT = const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; +const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index 06fbce41..ac8ff300 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -1,14 +1,19 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -class UcafService extends BaseService { +class UcafService extends LookupService { List patientChiefComplaintList = []; VitalSignData patientVitalSigns; + List patientAssessmentList = []; + List orderProcedureList = []; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -55,4 +60,45 @@ class UcafService extends BaseService { body: body, ); } + + Future getPatientAssessment(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; + + await baseAppClient.post (GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getOrderProcedures(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + // body['AppointmentNo'] = patient.appointmentNo; + // body['EpisodeID'] = patient.episodeNo; + + await baseAppClient.post (GET_ORDER_PROCEDURE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + orderProcedureList.clear(); + response['OrderedProcedureList']['entityList'].forEach((v) { + orderProcedureList.add(OrderProcedure.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + } \ No newline at end of file diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index c120e2ab..5586e711 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,19 +1,42 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:flutter/material.dart'; import '../../locator.dart'; class UcafViewModel extends BaseViewModel { - UcafService _ucafService = locator(); - List get patientChiefComplaintList => _ucafService.patientChiefComplaintList; + List get patientChiefComplaintList => + _ucafService.patientChiefComplaintList; + VitalSignData get patientVitalSigns => _ucafService.patientVitalSigns; + List get patientAssessmentList => + _ucafService.patientAssessmentList; + + List get diagnosisTypes => _ucafService.listOfDiagnosisType; + + List get diagnosisConditions => + _ucafService.listOfDiagnosisCondition; + + List get orderProcedures => _ucafService.orderProcedureList; + + String selectedLanguage; + + Future getLanguage() async { + selectedLanguage = await sharedPref.getString(APP_Language); + } + Future getUCAFData(PatiantInformtion patient) async { setState(ViewState.Busy); await _ucafService.getPatientVitalSign(patient); @@ -27,4 +50,69 @@ class UcafViewModel extends BaseViewModel { } } -} \ No newline at end of file + Future getPatientAssessment(PatiantInformtion patient) async { + if (patientAssessmentList.isEmpty) { + setState(ViewState.Busy); + await _ucafService.getPatientAssessment(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + if (patientAssessmentList.isNotEmpty) { + if (diagnosisConditions.length == 0) { + await _ucafService + .getMasterLookup(MasterKeysService.DiagnosisCondition); + } + if (diagnosisTypes.length == 0) { + await _ucafService.getMasterLookup(MasterKeysService.DiagnosisType); + } + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } else + setState(ViewState.Idle); // but with empty list + } + } + } + + Future getOrderProcedures(PatiantInformtion patient) async { + if (orderProcedures.isEmpty) { + setState(ViewState.Busy); + await _ucafService.getOrderProcedures(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + } + + MasterKeyModel findMasterDataById( + {@required MasterKeysService masterKeys, dynamic id}) { + switch (masterKeys) { + case MasterKeysService.DiagnosisCondition: + List result = diagnosisConditions.where((element) { + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + return null; + case MasterKeysService.DiagnosisType: + List result = diagnosisTypes.where((element) { + return element.id == id && + element.typeId == masterKeys.getMasterKeyService(); + }).toList(); + if (result.isNotEmpty) { + return result.first; + } + return null; + default: + return null; + } + } +} diff --git a/lib/models/SOAP/order-procedure.dart b/lib/models/SOAP/order-procedure.dart new file mode 100644 index 00000000..4e134a07 --- /dev/null +++ b/lib/models/SOAP/order-procedure.dart @@ -0,0 +1,110 @@ +class OrderProcedure { + + String achiCode; + String appointmentDate; + int appointmentNo; + int categoryID; + String clinicDescription; + String cptCode; + int createdBy; + String createdOn; + String doctorName; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + bool isInvoiced; + bool isReferralInvoiced; + bool isUncoveredByDoctor; + int lineItemNo; + String orderDate; + int orderNo; + int orderType; + String procedureId; + String procedureName; + String remarks; + String status; + String template; + + OrderProcedure( + {this.achiCode, + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); + + OrderProcedure.fromJson(Map json) { + achiCode = json['achiCode']; + appointmentDate = json['appointmentDate']; + appointmentNo = json['appointmentNo']; + categoryID = json['categoryID']; + clinicDescription = json['clinicDescription']; + cptCode = json['cptCode']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + isApprovalCreated = json['isApprovalCreated']; + isApprovalRequired = json['isApprovalRequired']; + isCovered = json['isCovered']; + isInvoiced = json['isInvoiced']; + isReferralInvoiced = json['isReferralInvoiced']; + isUncoveredByDoctor = json['isUncoveredByDoctor']; + lineItemNo = json['lineItemNo']; + orderDate = json['orderDate']; + orderNo = json['orderNo']; + orderType = json['orderType']; + procedureId = json['procedureId']; + procedureName = json['procedureName']; + remarks = json['remarks']; + status = json['status']; + template = json['template']; + } + + Map toJson() { + final Map data = new Map(); + data['achiCode'] = this.achiCode; + data['appointmentDate'] = this.appointmentDate; + data['appointmentNo'] = this.appointmentNo; + data['categoryID'] = this.categoryID; + data['clinicDescription'] = this.clinicDescription; + data['cptCode'] = this.cptCode; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['isApprovalCreated'] = this.isApprovalCreated; + data['isApprovalRequired'] = this.isApprovalRequired; + data['isCovered'] = this.isCovered; + data['isInvoiced'] = this.isInvoiced; + data['isReferralInvoiced'] = this.isReferralInvoiced; + data['isUncoveredByDoctor'] = this.isUncoveredByDoctor; + data['lineItemNo'] = this.lineItemNo; + data['orderDate'] = this.orderDate; + data['orderNo'] = this.orderNo; + data['orderType'] = this.orderType; + data['procedureId'] = this.procedureId; + data['procedureName'] = this.procedureName; + data['remarks'] = this.remarks; + data['status'] = this.status; + data['template'] = this.template; + return data; + } + +} \ No newline at end of file diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index f9c2470a..4428da8d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,5 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/order-procedure.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/helpers.dart'; @@ -25,6 +29,10 @@ class _UcafDetailScreenState extends State { final screenSize = MediaQuery.of(context).size; return BaseView( + onModelReady: (model) async { + await model.getLanguage(); + await model.getPatientAssessment(patient); + }, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, @@ -42,11 +50,12 @@ class _UcafDetailScreenState extends State { EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( children: [ - treatmentStepsBar(context, screenSize), + treatmentStepsBar( + context, model, screenSize, patient), SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem(context), + ...getSelectedTreatmentStepItem(context, model), ], ), ), @@ -57,7 +66,8 @@ class _UcafDetailScreenState extends State { )); } - Widget treatmentStepsBar(BuildContext _context, Size screenSize) { + Widget treatmentStepsBar(BuildContext _context, UcafViewModel model, + Size screenSize, PatiantInformtion patient) { List __treatmentSteps = [ TranslationBase.of(context).diagnosis.toUpperCase(), TranslationBase.of(context).medications.toUpperCase(), @@ -93,8 +103,16 @@ class _UcafDetailScreenState extends State { ), )), ), - onTap: () { + onTap: () async { print(__treatmentSteps.indexOf(item)); + if (__treatmentSteps.indexOf(item) == 0) { + await model.getPatientAssessment(patient); + } else if (__treatmentSteps.indexOf(item) == 1) { + print("call Medications"); + } + if (__treatmentSteps.indexOf(item) == 2) { + await model.getOrderProcedures(patient); + } setState(() { _activeTap = __treatmentSteps.indexOf(item); }); @@ -106,14 +124,41 @@ class _UcafDetailScreenState extends State { ); } - List getSelectedTreatmentStepItem(BuildContext _context) { + List getSelectedTreatmentStepItem( + BuildContext _context, UcafViewModel model) { switch (_activeTap) { case 0: - return [...List.generate(2, (index) => DiagnosisWidget()).toList()]; + if (model.patientAssessmentList != null) { + return [ + ...List.generate( + model.patientAssessmentList.length, + (index) => DiagnosisWidget( + model, model.patientAssessmentList[index])).toList() + ]; + } else { + return [ + Container(), + ]; + } + break; case 1: return [...List.generate(2, (index) => MedicationWidget()).toList()]; + break; case 2: - return [...List.generate(2, (index) => ProceduresWidget()).toList()]; + if (model.orderProcedures != null) { + return [ + ...List.generate( + model.orderProcedures.length, + (index) => + ProceduresWidget(model, model.orderProcedures[index])) + .toList() + ]; + } else { + return [ + Container(), + ]; + } + break; default: return [ Container(), @@ -123,8 +168,20 @@ class _UcafDetailScreenState extends State { } class DiagnosisWidget extends StatelessWidget { + final UcafViewModel model; + final GetAssessmentResModel diagnosis; + + DiagnosisWidget(this.model, this.diagnosis); + @override Widget build(BuildContext context) { + MasterKeyModel diagnosisType = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisType, + id: diagnosis.diagnosisTypeID); + MasterKeyModel diagnosisCondition = model.findMasterDataById( + masterKeys: MasterKeysService.DiagnosisCondition, + id: diagnosis.conditionID); + return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -136,7 +193,11 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Preliminary Diagnosis", + diagnosisType != null + ? model.selectedLanguage == 'ar' + ? diagnosisType.nameAr + : diagnosisType.nameEn + : "-", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -149,7 +210,7 @@ class DiagnosisWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "B34.2 | CORONA VIRUS INFECTION, UNSPECIFIED SITE", + diagnosis.asciiDesc, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -167,7 +228,7 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "174.00 Same", + "${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -284,6 +345,11 @@ class MedicationWidget extends StatelessWidget { } class ProceduresWidget extends StatelessWidget { + final UcafViewModel model; + final OrderProcedure procedure; + + ProceduresWidget(this.model, this.procedure); + @override Widget build(BuildContext context) { return Column( @@ -296,7 +362,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "019054846", + procedure.achiCode, fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -310,14 +376,13 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "1", + "${procedure.lineItemNo}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), ], ), ), - ], ), SizedBox( @@ -327,7 +392,7 @@ class ProceduresWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "SCAN - RENAL MASS PROTOCOL", + procedure.procedureName, fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -345,9 +410,9 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isCovered}", fontWeight: FontWeight.normal, - color: Colors.green, + color: procedure.isCovered ? Colors.green : Colors.red, fontSize: SizeConfig.textMultiplier * 2.0, ), SizedBox( @@ -359,7 +424,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isApprovalRequired}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -376,7 +441,7 @@ class ProceduresWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "Yes", + "${procedure.isUncoveredByDoctor}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), From a46a61c5cf4e52f03c1d0fb31c51c768c2d6b8c8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 5 Jan 2021 18:59:32 +0200 Subject: [PATCH 145/421] fix get and post issue to make it works with vida --- lib/client/base_app_client.dart | 4 + lib/config/localized_values.dart | 3 + .../GetChiefComplaintReqModel.dart | 9 +- lib/models/SOAP/GeneralGetReqForSOAP.dart | 15 +- lib/models/SOAP/GetHistoryReqModel.dart | 7 +- lib/models/SOAP/GetPhysicalExamReqModel.dart | 21 ++- lib/models/SOAP/my_selected_allergy.dart | 9 +- lib/models/SOAP/my_selected_examination.dart | 10 +- .../SOAP/post_histories_request_model.dart | 5 +- lib/util/translations_delegate_base.dart | 3 + .../subjective/update_allergies_widget.dart | 55 ++++--- .../subjective/update_subjective_page.dart | 136 +++++++++--------- .../soap_update/update_objective_page.dart | 19 ++- .../soap_update/update_soap_index.dart | 2 +- 14 files changed, 184 insertions(+), 114 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ea5580ca..6ab902de 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -44,6 +44,7 @@ class BaseAppClient { body['DoctorID'] = doctorProfile?.doctorID; if (body['DoctorID'] == "") body['DoctorID'] = null; + if( body['EditedBy'] ==null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; @@ -54,6 +55,9 @@ class BaseAppClient { if (body['DoctorID'] == '') { body['DoctorID'] =null; } + if (body['EditedBy'] == '') { + body.remove("EditedBy"); + } body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); if (lang != null && lang == 'ar') diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index adca1232..4ad53ebe 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -538,4 +538,7 @@ const Map> localizedValues = { }, 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, + 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, + 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, + 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, }; diff --git a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart index 68ab6c40..80188dfe 100644 --- a/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart +++ b/lib/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart @@ -3,16 +3,19 @@ class GetChiefComplaintReqModel { int appointmentNo; int episodeId; int episodeID; + dynamic doctorID; GetChiefComplaintReqModel( - {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID}); + {this.patientMRN, this.appointmentNo, this.episodeId, this.episodeID, this.doctorID}); GetChiefComplaintReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; episodeID = json['EpisodeID']; - } + doctorID = json['DoctorID']; + +} Map toJson() { final Map data = new Map(); @@ -20,6 +23,8 @@ class GetChiefComplaintReqModel { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['EpisodeID'] = this.episodeID; + data['DoctorID'] = this.doctorID; + return data; } } diff --git a/lib/models/SOAP/GeneralGetReqForSOAP.dart b/lib/models/SOAP/GeneralGetReqForSOAP.dart index 488a06d4..70e76313 100644 --- a/lib/models/SOAP/GeneralGetReqForSOAP.dart +++ b/lib/models/SOAP/GeneralGetReqForSOAP.dart @@ -2,16 +2,23 @@ class GeneralGetReqForSOAP { int patientMRN; int appointmentNo; int episodeId; - String doctorID; + dynamic editedBy; + dynamic doctorID; - GeneralGetReqForSOAP( - {this.patientMRN, this.appointmentNo, this.episodeId, this.doctorID}); + GeneralGetReqForSOAP({ + this.patientMRN, + this.appointmentNo, + this.episodeId, + this.doctorID, + this.editedBy, + }); GeneralGetReqForSOAP.fromJson(Map json) { patientMRN = json['PatientMRN']; appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeId']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -20,6 +27,8 @@ class GeneralGetReqForSOAP { data['AppointmentNo'] = this.appointmentNo; data['EpisodeId'] = this.episodeId; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetHistoryReqModel.dart b/lib/models/SOAP/GetHistoryReqModel.dart index 1df26690..720b6342 100644 --- a/lib/models/SOAP/GetHistoryReqModel.dart +++ b/lib/models/SOAP/GetHistoryReqModel.dart @@ -5,8 +5,9 @@ class GetHistoryReqModel { String from; String to; int clinicID; - int doctorID; int appointmentNo; + dynamic editedBy; + dynamic doctorID; GetHistoryReqModel( {this.patientMRN, @@ -16,6 +17,7 @@ class GetHistoryReqModel { this.to, this.clinicID, this.doctorID, + this.editedBy, this.appointmentNo}); GetHistoryReqModel.fromJson(Map json) { @@ -27,6 +29,7 @@ class GetHistoryReqModel { clinicID = json['ClinicID']; doctorID = json['DoctorID']; appointmentNo = json['AppointmentNo']; + editedBy = json['EditedBy']; } @@ -40,6 +43,8 @@ class GetHistoryReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; + return data; } } diff --git a/lib/models/SOAP/GetPhysicalExamReqModel.dart b/lib/models/SOAP/GetPhysicalExamReqModel.dart index ce045c22..5145c419 100644 --- a/lib/models/SOAP/GetPhysicalExamReqModel.dart +++ b/lib/models/SOAP/GetPhysicalExamReqModel.dart @@ -4,13 +4,18 @@ class GetPhysicalExamReqModel { String episodeID; String from; String to; + dynamic editedBy; + dynamic doctorID; - GetPhysicalExamReqModel( - {this.patientMRN, - this.appointmentNo, - this.episodeID, - this.from, - this.to}); + GetPhysicalExamReqModel({ + this.patientMRN, + this.appointmentNo, + this.episodeID, + this.from, + this.to, + this.doctorID, + this.editedBy, + }); GetPhysicalExamReqModel.fromJson(Map json) { patientMRN = json['PatientMRN']; @@ -18,6 +23,8 @@ class GetPhysicalExamReqModel { episodeID = json['EpisodeID']; from = json['From']; to = json['To']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -27,6 +34,8 @@ class GetPhysicalExamReqModel { data['EpisodeID'] = this.episodeID; data['From'] = this.from; data['To'] = this.to; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/my_selected_allergy.dart b/lib/models/SOAP/my_selected_allergy.dart index e5b45502..5a6bd749 100644 --- a/lib/models/SOAP/my_selected_allergy.dart +++ b/lib/models/SOAP/my_selected_allergy.dart @@ -5,9 +5,14 @@ class MySelectedAllergy { MasterKeyModel selectedAllergy; String remark; bool isChecked; + int createdBy; MySelectedAllergy( - {this.selectedAllergySeverity, this.selectedAllergy, this.remark, this.isChecked}); + {this.selectedAllergySeverity, + this.selectedAllergy, + this.remark, + this.isChecked, + this.createdBy}); MySelectedAllergy.fromJson(Map json) { selectedAllergySeverity = json['selectedAllergySeverity'] != null @@ -18,6 +23,7 @@ class MySelectedAllergy { : null; remark = json['remark']; remark = json['isChecked']; + createdBy = json['createdBy']; } Map toJson() { @@ -30,6 +36,7 @@ class MySelectedAllergy { } data['remark'] = this.remark; data['isChecked'] = this.remark; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 3b6685c8..5a717a4e 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -5,18 +5,23 @@ class MySelectedExamination { String remark; bool isNormal; bool isAbnormal; + int createdBy; MySelectedExamination( - {this.selectedExamination, this.remark, this.isNormal = true, this.isAbnormal = false}); + {this.selectedExamination, + this.remark, + this.isNormal = true, + this.isAbnormal = false, + this.createdBy}); MySelectedExamination.fromJson(Map json) { - selectedExamination = json['selectedExamination'] != null ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; remark = json['isNormal']; remark = json['isAbnormal']; + createdBy = json['createdBy']; } Map toJson() { @@ -28,6 +33,7 @@ class MySelectedExamination { data['remark'] = this.remark; data['isNormal'] = this.isNormal; data['isAbnormal'] = this.isAbnormal; + data['createdBy'] = this.createdBy; return data; } } diff --git a/lib/models/SOAP/post_histories_request_model.dart b/lib/models/SOAP/post_histories_request_model.dart index baa428fd..d8be3fb2 100644 --- a/lib/models/SOAP/post_histories_request_model.dart +++ b/lib/models/SOAP/post_histories_request_model.dart @@ -1,7 +1,8 @@ class PostHistoriesRequestModel { List listMedicalHistoryVM; + dynamic doctorID; - PostHistoriesRequestModel({this.listMedicalHistoryVM}); + PostHistoriesRequestModel({this.listMedicalHistoryVM, this.doctorID}); PostHistoriesRequestModel.fromJson(Map json) { if (json['listMedicalHistoryVM'] != null) { @@ -10,6 +11,7 @@ class PostHistoriesRequestModel { listMedicalHistoryVM.add(new ListMedicalHistoryVM.fromJson(v)); }); } + doctorID = json['DoctorID']; } Map toJson() { @@ -18,6 +20,7 @@ class PostHistoriesRequestModel { data['listMedicalHistoryVM'] = this.listMedicalHistoryVM.map((v) => v.toJson()).toList(); } + data['DoctorID'] = this.doctorID; return data; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e295266f..e6b5dbd5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -555,6 +555,9 @@ class TranslationBase { String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index a9839a2c..6de9e031 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -170,31 +170,40 @@ class _UpdateAllergiesWidgetState extends State { builder: (context) { return AddAllergies( addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id - ).toList(); - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); + if (mySelectedAllergy.selectedAllergySeverity == null || + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); - } + } else { + setState(() { + List allergy = + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); - }); + if (allergy.isEmpty) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + } },); }); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index e0d92788..4370df4f 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_chief_complaint_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_histories_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/translations_delegate_base.dart'; @@ -54,20 +56,11 @@ class _UpdateSubjectivePageState extends State { GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), - appointmentNo: widget.patientInfo.appointmentNo); - - getHistoryReqModel.historyType = - MasterKeysService.HistoryFamily.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel, isFirst: true); - getHistoryReqModel.historyType = - MasterKeysService.HistoryMedical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySurgical.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); - getHistoryReqModel.historyType = - MasterKeysService.HistorySports.getMasterKeyService(); - await model.getPatientHistories(getHistoryReqModel); + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + + await model.getPatientHistories(getHistoryReqModel,isFirst: true); if (model.patientHistoryList.isNotEmpty) { if (model.historyFamilyList.isEmpty) { @@ -147,58 +140,64 @@ class _UpdateSubjectivePageState extends State { }); } } + + getAllergies(SOAPViewModel model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + if (model.patientAllergiesList.isNotEmpty) { + if (model.allergiesList.isEmpty) + await model.getMasterLookup(MasterKeysService.Allergies); + if (model.allergySeverityList.isEmpty) + await model.getMasterLookup(MasterKeysService.AllergySeverity); + + model.patientAllergiesList.forEach((element) { + MasterKeyModel selectedAllergy = model.getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( + selectedAllergy: selectedAllergy, + isChecked: element.isChecked, + createdBy: element.createdBy, + selectedAllergySeverity: selectedAllergySeverity); + if (selectedAllergy != null && selectedAllergySeverity != null) + widget.myAllergiesList.add(mySelectedAllergy); + }); + } + } + @override Widget build(BuildContext context) { - - return BaseView( + return BaseView( onModelReady: (model) async { widget.myAllergiesList.clear(); widget.myHistoryList.clear(); - - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo); GetChiefComplaintReqModel getChiefComplaintReqModel = GetChiefComplaintReqModel( patientMRN: widget.patientInfo.patientMRN, appointmentNo: widget.patientInfo.appointmentNo, episodeId: widget.patientInfo.episodeNo, - episodeID: widget.patientInfo.episodeNo); + episodeID: widget.patientInfo.episodeNo, + doctorID: ''); await model.getPatientChiefComplaint(getChiefComplaintReqModel); if (model.patientChiefComplaintList.isNotEmpty) { - complaintsController.text = helpers.parseHtmlString(model.patientChiefComplaintList[0].chiefComplaint) - ; + complaintsController.text = helpers.parseHtmlString( + model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; } - await model.getPatientAllergy(generalGetReqForSOAP); - if (model.patientAllergiesList.isNotEmpty) { - if (model.allergiesList.isEmpty) - await model.getMasterLookup(MasterKeysService.Allergies); - if (model.allergySeverityList.isEmpty) - await model.getMasterLookup(MasterKeysService.AllergySeverity); - - model.patientAllergiesList.forEach((element) { - MasterKeyModel selectedAllergy = model.getOneMasterKey( - masterKeys: MasterKeysService.Allergies, - id: element.allergyDiseaseId, - typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( - masterKeys: MasterKeysService.AllergySeverity, - id: element.severity, - ); - MySelectedAllergy mySelectedAllergy = MySelectedAllergy( - selectedAllergy: selectedAllergy, - isChecked: element.isChecked, - selectedAllergySeverity: selectedAllergySeverity); - if (selectedAllergy != null && selectedAllergySeverity != null) - widget.myAllergiesList.add(mySelectedAllergy); - }); - } await getHistory(model); - + await getAllergies(model); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, @@ -472,29 +471,30 @@ class _UpdateSubjectivePageState extends State { {List myAllergiesList, SOAPViewModel model}) async { PostAllergyRequestModel postAllergyRequestModel = new PostAllergyRequestModel(); + + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); widget.myAllergiesList.forEach((allergy) { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; //TODO: make static value dynamic - postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM - .add(ListHisProgNotePatientAllergyDiseaseVM( - allergyDiseaseId: allergy.selectedAllergy.id, - allergyDiseaseType: allergy.selectedAllergy.typeId, - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - severity: allergy.selectedAllergySeverity.id, - remarks: allergy.remark, - createdBy: 4709, - // - createdOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - editedBy: 4709, - editedOn: DateTime.now().toIso8601String(), - //"2020-08-14T20:37:22.780Z", - isChecked: false, - isUpdatedByNurse: false)); + postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( + ListHisProgNotePatientAllergyDiseaseVM( + allergyDiseaseId: allergy.selectedAllergy.id, + allergyDiseaseType: allergy.selectedAllergy.typeId, + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + severity: allergy.selectedAllergySeverity.id, + remarks: allergy.remark, + createdBy: allergy.createdBy??doctorProfile.doctorID, + createdOn: DateTime.now().toIso8601String(), + editedBy: doctorProfile.doctorID, + editedOn: DateTime.now().toIso8601String(), + isChecked: allergy.isChecked, + isUpdatedByNurse: false)); }); if (model.patientAllergiesList.isEmpty) { await model.postAllergy(postAllergyRequestModel); @@ -510,7 +510,7 @@ class _UpdateSubjectivePageState extends State { postHistories( {List myHistoryList, SOAPViewModel model}) async { PostHistoriesRequestModel postHistoriesRequestModel = - new PostHistoriesRequestModel(); + new PostHistoriesRequestModel(doctorID: ''); widget.myHistoryList.forEach((history) { if (postHistoriesRequestModel.listMedicalHistoryVM == null) postHistoriesRequestModel.listMedicalHistoryVM = []; diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 37a5d72f..0c8bece6 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -7,6 +8,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; import 'package:doctor_app_flutter/models/SOAP/post_physical_exam_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/translations_delegate_base.dart'; @@ -77,6 +79,7 @@ class _UpdateObjectivePageState extends State { selectedExamination: examMaster, remark: element.remarks, isNormal: element.isNormal, + createdBy: element.createdBy, isAbnormal: element.isAbnormal); widget.mySelectedExamination.add(tempEam); }); @@ -102,7 +105,7 @@ class _UpdateObjectivePageState extends State { children: [ Row( children: [ - Texts('Physical/System Examination', + Texts(TranslationBase.of(context).physicalSystemExamination, variant: isSysExaminationExpand ? "bodyText" : '', @@ -137,7 +140,7 @@ class _UpdateObjectivePageState extends State { margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Add Examination", + hintText: TranslationBase.of(context).physicalSystemExamination, fontSize: 13.5, onTapTextFields: () { openExaminationList(context); @@ -351,7 +354,11 @@ class _UpdateObjectivePageState extends State { } submitUpdateObjectivePage(SOAPViewModel model) async { + if(widget.mySelectedExamination.isNotEmpty){ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); PostPhysicalExamRequestModel postPhysicalExamRequestModel = new PostPhysicalExamRequestModel(); widget.mySelectedExamination.forEach((exam) { if (postPhysicalExamRequestModel.listHisProgNotePhysicalExaminationVM == @@ -364,9 +371,9 @@ class _UpdateObjectivePageState extends State { episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, remarks: exam.remark ?? '', - createdBy: 4709, + createdBy: exam.createdBy??doctorProfile.doctorID, createdOn: DateTime.now().toIso8601String(), - editedBy: 4709, + editedBy: doctorProfile.doctorID, editedOn: DateTime.now().toIso8601String(), examId: exam.selectedExamination.id, examType: exam.selectedExamination.typeId, @@ -505,8 +512,8 @@ class _AddExaminationDailogState extends State { baseViewModel: model, child: MasterKeyCheckboxSearchWidget( model: model, - hintSearchText: 'Search Examination', - buttonName: 'Add Examination', + hintSearchText: TranslationBase.of(context).searchExamination, + buttonName: TranslationBase.of(context).addExamination, masterList: model.physicalExaminationList, removeHistory: (history){ setState(() { diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 0edaaaf9..3b793d6a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = new MySelectedAssessment(); + MySelectedAssessment mySelectedAssessment = MySelectedAssessment(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } From 7f250baf32de6fb32c558e7ee58f3c0265362634 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 14:07:53 +0200 Subject: [PATCH 146/421] date picker fix --- lib/screens/prescription/add_prescription_form.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f39499e1..9c3bda7f 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -696,11 +696,11 @@ class _PrescriptionFormWidgetState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; - selectedDate = DateTime.now().add(Duration(hours: 10)); + selectedDate = DateTime.now().add(Duration(hours: 1)); final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 15)), + firstDate: DateTime.now().add(Duration(hours: 5)), lastDate: DateTime(2040), initialEntryMode: DatePickerEntryMode.calendar, ); From 9a5cafaaf5d3cdc16357bad16bd32c3da8b982b9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 6 Jan 2021 15:11:36 +0200 Subject: [PATCH 147/421] working on UCAF detail screen , and some cahgnes on referral list --- lib/core/service/base/base_service.dart | 8 +- .../viewModel/patient-referral-viewmodel.dart | 15 ++++ .../patient-vital-sign-viewmodel.dart | 29 ------- .../profile/UCAF/UCAF-detail-screen.dart | 80 ++++++++++++++----- .../referral/my-referral-detail-screen.dart | 32 ++++++-- .../profile/profile_medical_info_widget.dart | 3 +- 6 files changed, 109 insertions(+), 58 deletions(-) diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index d2c4eb1f..32edf34f 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -30,13 +30,19 @@ class BaseService { } } - Future getPatientArrivalList(String date,{String fromDate}) async{ + Future getPatientArrivalList(String date,{String fromDate, int patientMrn = -1, int appointmentNo = -1}) async{ hasError = false; Map body = Map(); body['From'] = fromDate == null ? date : fromDate; body['To'] = date; body['PageIndex'] = 0; body['PageSize'] = 0; + if(patientMrn == -1){ + body['PatientMRN'] = patientMrn; + } + if(appointmentNo == -1){ + body['AppointmentNo'] = appointmentNo; + } await baseAppClient.post( GET_PATIENT_ARRIVAL_LIST, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 251407ef..35747c37 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -133,4 +133,19 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } } + + Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { + setState(ViewState.Busy); + + await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn, appointmentNo: appointmentNo); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + /* + * model + .getPatientArrivalList()*/ } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4282141c..4f2e7e28 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -16,35 +16,6 @@ class VitalSignsViewModel extends BaseViewModel { VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; - /*Future getPatientArrivalList(String date, PatiantInformtion patient, - {String fromDate}) async { - // TODO when arrival list work un comment below lines - *//* setState(ViewState.Busy); - await _vitalSignService.getPatientArrivalList(date, fromDate: fromDate); - if (_vitalSignService.hasError) { - error = _vitalSignService.error; - setState(ViewState.Error); - } else { - await getPatientVitalSign(patient); - }*//* - makeVitalSignDemoData(); - } - - PatientArrivalEntity getPatientAppointmentEntity(PatiantInformtion patient) { - String ffName = "${patient.firstName} ${patient.lastName}"; - String fmfName = - "${patient.firstName} ${patient.middleName} ${patient.lastName}"; - - for (var element in patientArrivalList) { - int index = patientArrivalList.indexOf(element); - if (element.patientName == ffName || element.patientName == fmfName) { - return element; - } - // print("patient index: $index"); - } - return null; - }*/ - Future getPatientVitalSign(PatiantInformtion patient) async { setState(ViewState.Busy); await _vitalSignService.getPatientVitalSign(patient); diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 4428da8d..0a655231 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -11,9 +11,12 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.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/borderedButton.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../routes.dart'; + class UcafDetailScreen extends StatefulWidget { @override _UcafDetailScreenState createState() => _UcafDetailScreenState(); @@ -36,32 +39,73 @@ class _UcafDetailScreenState extends State { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).ucaf, - body: Container( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientHeaderWidgetNoAvatar(patient), - SizedBox( - height: 10, - ), - Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + body: Column( + children: [ + Expanded( + child: Container( + child: SingleChildScrollView( child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - treatmentStepsBar( - context, model, screenSize, patient), + PatientHeaderWidgetNoAvatar(patient), SizedBox( - height: 16, + height: 10, + ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + children: [ + treatmentStepsBar( + context, model, screenSize, patient), + SizedBox( + height: 16, + ), + ...getSelectedTreatmentStepItem(context, model), + ], + ), ), - ...getSelectedTreatmentStepItem(context, model), ], ), ), - ], + ), ), - ), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: BorderedButton( + TranslationBase.of(context).save, + hasBorder: true, + vPadding: 16, + hPadding: 8, + borderColor: HexColor("#B8382B"), + backgroundColor: HexColor("#B8382B"), + textColor: Colors.white, + fontSize: SizeConfig.textMultiplier * 2.0, + handler: () {}, + ), + ), + Container( + margin: + EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16), + child: BorderedButton( + TranslationBase.of(context).cancel, + hasBorder: true, + vPadding: 16, + hPadding: 8, + borderColor: Colors.white, + backgroundColor: Colors.white, + textColor: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.2, + handler: () { + Navigator.of(context).popUntil((route){ + return route.settings.name == PATIENTS_PROFILE; + }); + + }, + ), + ), + ], ), )); } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 4c9d41e0..1019ede4 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; @@ -13,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../routes.dart'; + class MyReferralDetailScreen extends StatelessWidget { PendingReferral pendingReferral; @@ -25,6 +28,14 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral = routeArgs['referral']; return BaseView( + onModelReady: (model) => model.getPatientDetails( + DateUtils.convertStringToDateFormat( + DateTime.now().subtract(Duration(days: 350)).toString(), + "yyyy-MM-dd"), + DateUtils.convertStringToDateFormat( + DateTime.now().toString(), "yyyy-MM-dd"), + pendingReferral.patientID, + pendingReferral.sourceAppointmentNo), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, @@ -63,8 +74,10 @@ class MyReferralDetailScreen extends StatelessWidget { patientName: pendingReferral.patientName, referralStatus: null, isReferredTo: false, - isSameBranch: pendingReferral.isReferralDoctorSameBranch, - referralDoctorName: pendingReferral.referredByDoctorInfo, + isSameBranch: + pendingReferral.isReferralDoctorSameBranch, + referralDoctorName: + pendingReferral.referredByDoctorInfo, clinicDescription: null, remark: pendingReferral.remarksFromSource, ), @@ -73,7 +86,8 @@ class MyReferralDetailScreen extends StatelessWidget { childAspectRatio: 1.8, crossAxisSpacing: 8, mainAxisSpacing: 10, - controller: new ScrollController(keepScrollOffset: false), + controller: + new ScrollController(keepScrollOffset: false), shrinkWrap: true, padding: const EdgeInsets.all(4.0), crossAxisCount: 2, @@ -82,8 +96,10 @@ class MyReferralDetailScreen extends StatelessWidget { key: key, // patient: patient, // route: RADIOLOGY, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, + nameLine1: + TranslationBase.of(context).previewHealth, + nameLine2: + TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), PatientProfileButton( key: key, @@ -95,7 +111,7 @@ class MyReferralDetailScreen extends StatelessWidget { PatientProfileButton( key: key, // patient: patient, - // route: VITAL_SIGN_DETAILS, + route: PATIENT_VITAL_SIGN, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, icon: 'heartbeat.png'), @@ -119,7 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: (){ + handler: () { model.responseReferral(pendingReferral, true); }, ), @@ -135,7 +151,7 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: (){ + handler: () { model.responseReferral(pendingReferral, false); }, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 8860a7dc..c39c7c95 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -44,13 +44,12 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - if(selectedPatientType == 6 || selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: PATIENT_VITAL_SIGN, + route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), if(selectedPatientType != 7) PatientProfileButton( From a3fa8ef839e33c5ba40296e8d6e180bcf2ac0ff7 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 16:14:19 +0200 Subject: [PATCH 148/421] medical file fix --- .../medical-file/medical_file_details.dart | 80 +++++++++++++++-- .../prescription/add_prescription_form.dart | 86 +++++++++++++++---- 2 files changed, 140 insertions(+), 26 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index c916842c..3823a88e 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -135,7 +135,15 @@ class _MedicalFileDetailsState extends State { 'Visit Date : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText(model .medicalFileList[0] .entityList[0] @@ -160,7 +168,15 @@ class _MedicalFileDetailsState extends State { 'Doctor : '.toUpperCase(), fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -181,7 +197,15 @@ class _MedicalFileDetailsState extends State { 'Clinic : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -199,7 +223,15 @@ class _MedicalFileDetailsState extends State { 'Episode Number : ', fontWeight: FontWeight.w700, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) AppText( model .medicalFileList[0] @@ -219,7 +251,15 @@ class _MedicalFileDetailsState extends State { color: Colors.grey.shade400, ), SizedBox(height: 25.0), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -305,7 +345,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -463,7 +511,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: @@ -610,7 +666,15 @@ class _MedicalFileDetailsState extends State { SizedBox( height: 30, ), - if (model.medicalFileList.length != 0) + if (model.medicalFileList.length != 0 && + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations + .length != + 0) HeaderBodyExpandableNotifier( headerWidget: Row( mainAxisAlignment: diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 405f240b..dffcfdff 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -112,12 +112,15 @@ class _PrescriptionFormWidgetState extends State { dynamic frequency; dynamic duration; dynamic doseTime; + dynamic indication; List strengthList; List routeList; List frequencyList; List durationList; List doseTimeList; + List indicationList; + //PatiantInformtion patient; dynamic _strength; dynamic _selectedBranch; @@ -130,6 +133,7 @@ class _PrescriptionFormWidgetState extends State { frequencyList = List(); durationList = List(); doseTimeList = List(); + indicationList = List(); dynamic regularOrder = {"id": 1, "name": "regular Order"}; dynamic urgentOrder = {"id": 2, "name": "urgent Order"}; @@ -176,6 +180,30 @@ class _PrescriptionFormWidgetState extends State { dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; + dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; + dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; + dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; + dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; + dynamic indication6 = { + "id": 550, + "name": "Phenytoin Hypersensitivity Syndrome" + }; + dynamic indication7 = {"id": 551, "name": "Asterixis"}; + dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; + dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; + dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; + + indicationList.add(indication1); + indicationList.add(indication2); + indicationList.add(indication3); + indicationList.add(indication4); + indicationList.add(indication5); + indicationList.add(indication6); + indicationList.add(indication7); + indicationList.add(indication8); + indicationList.add(indication9); + indicationList.add(indication10); doseTimeList.add(doseTime1); doseTimeList.add(doseTime2); @@ -521,24 +549,46 @@ class _PrescriptionFormWidgetState extends State { ), SizedBox(height: spaceBetweenTextFileds), Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: TranslationBase.of(context) - .indication, - controller: indicationController, - keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indicationList = + selectedValue; + _selectedBranch = null; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .indication, + indication != null + ? indication['name'] + : null, + true), + enabled: false, + ), ), ), SizedBox(height: spaceBetweenTextFileds), From 34b7b4564cade3e4ae550a02371b088078675a70 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 Jan 2021 16:59:35 +0200 Subject: [PATCH 149/421] assessment work fine now --- lib/models/SOAP/my_selected_assement.dart | 22 +- .../soap_update/update_assessment_page.dart | 607 ++++++++++-------- .../soap_update/update_soap_index.dart | 4 +- 3 files changed, 354 insertions(+), 279 deletions(-) diff --git a/lib/models/SOAP/my_selected_assement.dart b/lib/models/SOAP/my_selected_assement.dart index b5f82379..4d4afc2d 100644 --- a/lib/models/SOAP/my_selected_assement.dart +++ b/lib/models/SOAP/my_selected_assement.dart @@ -6,12 +6,21 @@ class MySelectedAssessment { MasterKeyModel selectedDiagnosisType; String remark; int appointmentId; + int createdBy; + String createdOn; + int doctorID; + String doctorName; + String icdCode10ID; MySelectedAssessment( {this.selectedICD, this.selectedDiagnosisCondition, this.selectedDiagnosisType, - this.remark, this.appointmentId}); + this.remark, this.appointmentId, this.createdBy, + this.createdOn, + this.doctorID, + this.doctorName, + this.icdCode10ID}); MySelectedAssessment.fromJson(Map json) { selectedICD = json['selectedICD'] != null @@ -25,6 +34,11 @@ class MySelectedAssessment { : null; remark = json['remark']; appointmentId = json['appointmentId']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorID = json['doctorID']; + doctorName = json['doctorName']; + icdCode10ID = json['icdCode10ID']; } Map toJson() { @@ -41,7 +55,11 @@ class MySelectedAssessment { } data['remark'] = this.remark; data['appointmentId'] = this.appointmentId; - + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorID'] = this.doctorID; + data['doctorName'] = this.doctorName; + data['icdCode10ID'] = this.icdCode10ID; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 79d8878c..1a38de87 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -25,11 +25,13 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; - final MySelectedAssessment mySelectedAssessment; + List mySelectedAssessmentList; final PatiantInformtion patientInfo; - UpdateAssessmentPage( - {Key key, this.changePageViewIndex, this.mySelectedAssessment, this.patientInfo}); + UpdateAssessmentPage({Key key, + this.changePageViewIndex, + this.mySelectedAssessmentList, + this.patientInfo}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -43,8 +45,7 @@ class _UpdateAssessmentPageState extends State { return BaseView( onModelReady: (model) async{ - - widget.mySelectedAssessment.appointmentId =widget.patientInfo.appointmentNo; + widget.mySelectedAssessmentList.clear(); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), @@ -60,25 +61,33 @@ class _UpdateAssessmentPageState extends State { if (model.listOfICD10.length == 0) { await model.getMasterLookup(MasterKeysService.ICD10); } + model.patientAssessmentList.forEach((element) { + MasterKeyModel diagnosisType = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisType, + id: element.diagnosisTypeID, + ); + MasterKeyModel selectedICD = model.getOneMasterKey( + masterKeys: MasterKeysService.ICD10, + id: element.icdCode10ID, + ); + MasterKeyModel diagnosisCondition = model.getOneMasterKey( + masterKeys: MasterKeysService.DiagnosisCondition, + id: element.conditionID, + ); + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + icdCode10ID: element.icdCode10ID + ); - MasterKeyModel selectedICD = model.getOneMasterKey( - masterKeys: MasterKeysService.ICD10, - id: model.patientAssessmentList[0].icdCode10ID, - ); - widget.mySelectedAssessment.selectedICD= selectedICD; - MasterKeyModel diagnosisCondition = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisCondition, - id: model.patientAssessmentList[0].conditionID, - ); - - widget.mySelectedAssessment.selectedDiagnosisCondition = diagnosisCondition; - MasterKeyModel diagnosisType = model.getOneMasterKey( - masterKeys: MasterKeysService.DiagnosisType, - id: model.patientAssessmentList[0].diagnosisTypeID, - ); - - widget.mySelectedAssessment.selectedDiagnosisType = diagnosisType; - widget.mySelectedAssessment.remark = model.patientAssessmentList[0].remarks; + widget.mySelectedAssessmentList.add(temMySelectedAssessment); + }); } }, builder: (_, model, w) => AppScaffold( @@ -130,7 +139,6 @@ class _UpdateAssessmentPageState extends State { ), Column( children: [ - if(model.patientAssessmentList.isEmpty) Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -138,7 +146,8 @@ class _UpdateAssessmentPageState extends State { hintText: TranslationBase.of(context).addAssessment, fontSize: 13.5, onTapTextFields: () { - openAssessmentDialog(context); + openAssessmentDialog(context,isUpdate: false, + model: model); }, readOnly: true, // hintColor: Colors.black, @@ -159,266 +168,239 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 20, ), - if(widget.mySelectedAssessment != null && - widget.mySelectedAssessment - .appointmentId != - null && widget.mySelectedAssessment - .selectedDiagnosisType != null && - widget.mySelectedAssessment - .selectedDiagnosisCondition != null) - Container( - margin: EdgeInsets.only( - left: 5, right: 5, top: 15), - child: Row( - mainAxisAlignment: MainAxisAlignment - .spaceBetween, - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment - .start, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "DEC".toUpperCase(), - fontSize: 10, - color: Colors.grey, - ), - ], - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Appointment #: ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .appointmentId - .toString(), - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Type : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - widget.mySelectedAssessment - .selectedDiagnosisType - .nameEn, - fontSize: 10, - color: Colors.grey, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - "Doc : ", - fontWeight: FontWeight.bold, - fontSize: 16, - ), - AppText( - "Anas Abdullah", - fontSize: 10, - color: Colors.grey, - ), - ], - ), - SizedBox( - height: 6, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - SizedBox( - height: 6, - ), - Container( - width: MediaQuery.of(context).size.width * 0.5, - child: AppText( - widget.mySelectedAssessment.remark??"", + + Column( + children: widget.mySelectedAssessmentList.map(( + assessment) { + return Container( + margin: EdgeInsets.only( + left: 5, right: 5, top: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment + .spaceBetween, + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment + .start, + children: [ + Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + "12".toUpperCase(), + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + "DEC".toUpperCase(), fontSize: 10, color: Colors.grey, ), - ), - ], - ), - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment - .start, - children: [ - Row( - - children: [ - AppText( - "ICD: ".toUpperCase(), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - Container( - child: AppText( - widget.mySelectedAssessment.selectedICD.code.trim().toUpperCase()??"", + ], + ) + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Appointment #: ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment + .appointmentId + .toString(), fontSize: 10, color: Colors.grey, ), - ), - ], - ) - ], - ), - Column( - children: [ - InkWell( - onTap: () { - openAssessmentDialog(context); - }, - child: Icon(EvaIcons - .edit2Outline), - ) - ], - ), - ], - ), - ) + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + assessment + .selectedDiagnosisCondition + .nameEn, + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Type : ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment + .selectedDiagnosisType + .nameEn, + fontSize: 10, + color: Colors.grey, + ), + ], + ), + if(assessment.doctorName != null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + "Doc : ", + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + AppText( + assessment.doctorName??'', + fontSize: 10, + color: Colors.grey, + ), + ], + ), + SizedBox( + height: 6, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + SizedBox( + height: 6, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.5, + child: AppText( + assessment.remark ?? "", + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ), + ], + ), + Column( + crossAxisAlignment: CrossAxisAlignment + .start, + children: [ + Row( + + children: [ + AppText( + "ICD: ".toUpperCase(), + fontWeight: FontWeight + .bold, + fontSize: 16, + ), + Container( + child: AppText( + assessment.selectedICD + .code.trim() + .toUpperCase() ?? + "", + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ) + ], + ), + Column( + children: [ + InkWell( + onTap: () { + openAssessmentDialog( + context, isUpdate: true, + assessment: assessment, + model: model); + }, + child: Icon(EvaIcons + .edit2Outline), + ) + ], + ), + ], + ), + ); + }).toList(),) ], ) ]), isExpand: isAssessmentExpand, ), - DividerWithSpacesAround( - height: 30, - ), - AppButton( - title: TranslationBase - .of(context) - .next, - loading: model.state == ViewState.BusyLocal, - onPressed: () async { - await submitAssessment(model); - }, - ), - SizedBox( - height: 30, - ), - ], + DividerWithSpacesAround( + height: 30, ), - ), + AppButton( + title: TranslationBase + .of(context) + .next, + loading: model.state == ViewState.BusyLocal, + onPressed: () async { + widget.changePageViewIndex(3); + }, + ), + SizedBox( + height: 30, + ), + ], ), - ))); + ), + ), + ))); } - submitAssessment(SOAPViewModel model) async { - if (widget.mySelectedAssessment.selectedDiagnosisCondition != null && - widget.mySelectedAssessment.selectedDiagnosisType != null && widget.mySelectedAssessment.selectedICD !=null ) { - - if(model.patientAssessmentList.isEmpty){ - PostAssessmentRequestModel postAssessmentRequestModel = - new PostAssessmentRequestModel( - patientMRN: widget.patientInfo.patientMRN, - episodeId: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - icdCodeDetails: [ - new IcdCodeDetails( - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: widget.mySelectedAssessment.selectedICD.code) - ]); - - await model.postAssessment(postAssessmentRequestModel); - } else { - PatchAssessmentReqModel patchAssessmentReqModel = - PatchAssessmentReqModel( - patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo, - appointmentNo: widget.patientInfo.appointmentNo, - remarks: widget.mySelectedAssessment.remark, - complexDiagnosis: true, - conditionId: - widget.mySelectedAssessment.selectedDiagnosisCondition.id, - diagnosisTypeId: - widget.mySelectedAssessment.selectedDiagnosisType.id, - icdcode10Id: widget.mySelectedAssessment.selectedICD.code, - prevIcdCode10ID: model.patientAssessmentList[0].icdCode10ID - ); - - await model.patchAssessment(patchAssessmentReqModel); - } - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else { - widget.changePageViewIndex(3); - } - } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + openAssessmentDialog(BuildContext context, + { + MySelectedAssessment assessment, bool isUpdate, + SOAPViewModel model + }) { + if (assessment == null) { + assessment = MySelectedAssessment( + remark: '', appointmentId: widget.patientInfo.appointmentNo); } - - widget.changePageViewIndex(3); - } - - openAssessmentDialog(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { return AddAssessmentDetails( - mySelectedAssessment: widget.mySelectedAssessment, - addSelectedAssessment: () { + mySelectedAssessment: assessment, + patientInfo: widget.patientInfo, + isUpdate: isUpdate, + mySelectedAssessmentList: widget.mySelectedAssessmentList, + addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, + bool isUpdate) async { setState(() { - Navigator.of(context).pop(); + }); }); }); @@ -428,32 +410,34 @@ class _UpdateAssessmentPageState extends State { class AddAssessmentDetails extends StatefulWidget { final MySelectedAssessment mySelectedAssessment; - final Function() addSelectedAssessment; + final List mySelectedAssessmentList; + final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; - const AddAssessmentDetails( - {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo}) - : super(key: key); + final bool isUpdate; + + AddAssessmentDetails( + {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); + @override _AddAssessmentDetailsState createState() => _AddAssessmentDetailsState(); } class _AddAssessmentDetailsState extends State { - // MasterKeyModel _selectedDiagnosisCondition; - // MasterKeyModel _selectedDiagnosisType; TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController(); GlobalKey key = new GlobalKey>(); @override Widget build(BuildContext context) { - remarkController.text = widget.mySelectedAssessment.remark??""; - appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); + remarkController.text = widget.mySelectedAssessment.remark ?? ""; + appointmentIdController.text = + widget.mySelectedAssessment.appointmentId.toString(); final screenSize = MediaQuery .of(context) .size; InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { + String selectedText, bool isDropDown, {IconData icon}) { //TODO: make one Input InputDecoration for all return InputDecoration( focusedBorder: OutlineInputBorder( @@ -686,16 +670,34 @@ class _AddAssessmentDetailsState extends State { ), AppButton( title: "Add".toUpperCase(), - onPressed: () { - setState(() { + loading: model.state == ViewState.BusyLocal, + onPressed: () async { widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment .appointmentId = int.parse( appointmentIdController.text); - - widget.addSelectedAssessment(); - }); + if (widget.mySelectedAssessment + .selectedDiagnosisCondition != + null && + widget.mySelectedAssessment + .selectedDiagnosisType != + null && + widget.mySelectedAssessment + .selectedICD != null) { + widget.addSelectedAssessment( + widget.mySelectedAssessment, + widget.isUpdate); + await submitAssessment( + isUpdate: widget.isUpdate, + model: model, + mySelectedAssessment: widget + .mySelectedAssessment); + } else { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + } }, ), ])), @@ -704,6 +706,61 @@ class _AddAssessmentDetailsState extends State { ))), ); } + + submitAssessment( + {SOAPViewModel model, MySelectedAssessment mySelectedAssessment, bool isUpdate = false}) async { + if (isUpdate) { + PatchAssessmentReqModel patchAssessmentReqModel = + PatchAssessmentReqModel( + patientMRN: widget.patientInfo.patientMRN, + episodeID: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code, + prevIcdCode10ID: mySelectedAssessment.icdCode10ID + ); + + await model.patchAssessment(patchAssessmentReqModel); + } else { + PostAssessmentRequestModel postAssessmentRequestModel = + new PostAssessmentRequestModel( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + icdCodeDetails: [ + new IcdCodeDetails( + remarks: mySelectedAssessment.remark, + complexDiagnosis: true, + conditionId: + mySelectedAssessment.selectedDiagnosisCondition.id, + diagnosisTypeId: + mySelectedAssessment.selectedDiagnosisType.id, + icdcode10Id: mySelectedAssessment.selectedICD.code) + ]); + + await model.postAssessment(postAssessmentRequestModel); + } + + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else { + mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + + if (!isUpdate) { + widget.mySelectedAssessmentList.add(mySelectedAssessment); + } + Navigator.of(context).pop(); + } + + + // widget.changePageViewIndex(3); + } } diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 3b793d6a..84b8cc61 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -33,7 +33,7 @@ class _UpdateSoapIndexState extends State List myAllergiesList= List(); List myHistoryList = List(); List mySelectedExamination = List(); - MySelectedAssessment mySelectedAssessment = MySelectedAssessment(); + List mySelectedAssessment = List(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -106,7 +106,7 @@ class _UpdateSoapIndexState extends State ), UpdateAssessmentPage( changePageViewIndex: changePageViewIndex, - mySelectedAssessment: + mySelectedAssessmentList: mySelectedAssessment, patientInfo: patient, ), From caddbdb53cd3307c68a55af9254f30c921f369f0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 Jan 2021 18:33:17 +0200 Subject: [PATCH 150/421] small fixes in progress note --- lib/models/SOAP/GetAssessmentReqModel.dart | 6 +++++- lib/models/SOAP/GetGetProgressNoteReqModel.dart | 7 ++++++- .../SOAP/post_chief_complaint_request_model.dart | 5 +++++ .../SOAP/post_physical_exam_request_model.dart | 2 +- .../SOAP/post_progress_note_request_model.dart | 13 ++++++++++++- .../subjective/update_subjective_page.dart | 2 ++ .../soap_update/update_assessment_page.dart | 2 ++ .../profile/soap_update/update_plan_page.dart | 14 +++++++------- 8 files changed, 40 insertions(+), 11 deletions(-) diff --git a/lib/models/SOAP/GetAssessmentReqModel.dart b/lib/models/SOAP/GetAssessmentReqModel.dart index 1085bf8c..965382b5 100644 --- a/lib/models/SOAP/GetAssessmentReqModel.dart +++ b/lib/models/SOAP/GetAssessmentReqModel.dart @@ -5,7 +5,8 @@ class GetAssessmentReqModel { String from; String to; int clinicID; - int doctorID; + dynamic doctorID; + dynamic editedBy; GetAssessmentReqModel( {this.patientMRN, @@ -14,6 +15,7 @@ class GetAssessmentReqModel { this.from, this.to, this.clinicID, + this.editedBy, this.doctorID}); GetAssessmentReqModel.fromJson(Map json) { @@ -24,6 +26,7 @@ class GetAssessmentReqModel { to = json['To']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -35,6 +38,7 @@ class GetAssessmentReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/GetGetProgressNoteReqModel.dart b/lib/models/SOAP/GetGetProgressNoteReqModel.dart index 936c6f65..1da4a8bf 100644 --- a/lib/models/SOAP/GetGetProgressNoteReqModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteReqModel.dart @@ -5,7 +5,8 @@ class GetGetProgressNoteReqModel { String from; String to; int clinicID; - int doctorID; + dynamic doctorID; + dynamic editedBy; GetGetProgressNoteReqModel( {this.patientMRN, @@ -14,6 +15,7 @@ class GetGetProgressNoteReqModel { this.from, this.to, this.clinicID, + this.editedBy, this.doctorID}); GetGetProgressNoteReqModel.fromJson(Map json) { @@ -24,6 +26,8 @@ class GetGetProgressNoteReqModel { to = json['To']; clinicID = json['ClinicID']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; + } Map toJson() { @@ -35,6 +39,7 @@ class GetGetProgressNoteReqModel { data['To'] = this.to; data['ClinicID'] = this.clinicID; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/models/SOAP/post_chief_complaint_request_model.dart b/lib/models/SOAP/post_chief_complaint_request_model.dart index ed58e58a..f1e9c2b4 100644 --- a/lib/models/SOAP/post_chief_complaint_request_model.dart +++ b/lib/models/SOAP/post_chief_complaint_request_model.dart @@ -9,6 +9,8 @@ class PostChiefComplaintRequestModel { bool isLactation; int numberOfWeeks; dynamic doctorID; + dynamic editedBy; + PostChiefComplaintRequestModel( {this.appointmentNo, @@ -20,6 +22,7 @@ class PostChiefComplaintRequestModel { this.ispregnant, this.isLactation, this.doctorID, + this.editedBy, this.numberOfWeeks}); PostChiefComplaintRequestModel.fromJson(Map json) { @@ -33,6 +36,7 @@ class PostChiefComplaintRequestModel { isLactation = json['isLactation']; numberOfWeeks = json['numberOfWeeks']; doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -47,6 +51,7 @@ class PostChiefComplaintRequestModel { data['isLactation'] = this.isLactation; data['numberOfWeeks'] = this.numberOfWeeks; data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index adc8daf7..46a104f1 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -1,4 +1,4 @@ -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; + import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class PostPhysicalExamRequestModel { List listHisProgNotePhysicalExaminationVM; diff --git a/lib/models/SOAP/post_progress_note_request_model.dart b/lib/models/SOAP/post_progress_note_request_model.dart index 069f4dbf..2925819d 100644 --- a/lib/models/SOAP/post_progress_note_request_model.dart +++ b/lib/models/SOAP/post_progress_note_request_model.dart @@ -3,15 +3,24 @@ class PostProgressNoteRequestModel { int episodeId; int patientMRN; String planNote; + dynamic doctorID; + dynamic editedBy; PostProgressNoteRequestModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + {this.appointmentNo, + this.episodeId, + this.patientMRN, + this.planNote, + this.doctorID, + this.editedBy}); PostProgressNoteRequestModel.fromJson(Map json) { appointmentNo = json['AppointmentNo']; episodeId = json['EpisodeID']; patientMRN = json['PatientMRN']; planNote = json['PlanNote']; + doctorID = json['DoctorID']; + editedBy = json['EditedBy']; } Map toJson() { @@ -20,6 +29,8 @@ class PostProgressNoteRequestModel { data['EpisodeID'] = this.episodeId; data['PatientMRN'] = this.patientMRN; data['PlanNote'] = this.planNote; + data['DoctorID'] = this.doctorID; + data['EditedBy'] = this.editedBy; return data; } } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 4370df4f..de5d2d68 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -554,9 +554,11 @@ class _UpdateSubjectivePageState extends State { isLactation: false, ispregnant: false, doctorID: '', + numberOfWeeks: 0); if (model.patientChiefComplaintList.isEmpty) { // TODO: make it postChiefComplaint after it start to work + postChiefComplaintRequestModel.editedBy=''; await model.postChiefComplaint(postChiefComplaintRequestModel); } else { await model.patchChiefComplaint(postChiefComplaintRequestModel); diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 1a38de87..10bfc120 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -49,6 +49,8 @@ class _UpdateAssessmentPageState extends State { GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), + editedBy: '', + doctorID: '', appointmentNo: widget.patientInfo.appointmentNo); await model.getPatientAssessment(getAssessmentReqModel); if(model.patientAssessmentList.isNotEmpty){ diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 9c851cd5..a91447d6 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -59,7 +59,7 @@ class _UpdatePlanPageState extends State { GetGetProgressNoteReqModel( appointmentNo: widget.patientInfo.appointmentNo, patientMRN: widget.patientInfo.patientMRN, - episodeID: widget.patientInfo.episodeNo.toString()); + episodeID: widget.patientInfo.episodeNo.toString(), editedBy: '', doctorID: ''); await model.getPatientProgressNote(getGetProgressNoteReqModel); if (model.patientProgressNoteList.isNotEmpty) { @@ -285,15 +285,15 @@ class _UpdatePlanPageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text); + planNote: progressNoteController.text, doctorID: '', editedBy: ''); - if(model.patientProgressNoteList.isEmpty){ + // if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); - }else { - await model.patchProgressNote(postProgressNoteRequestModel); - - } + // }else { + // await model.patchProgressNote(postProgressNoteRequestModel); + // + // } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From bcbd091daed9e0dc6c0b7ae152e440d07f46d452 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 6 Jan 2021 18:59:20 +0200 Subject: [PATCH 151/421] ss --- lib/core/service/prescription_service.dart | 11 ++--- .../prescription/add_prescription_form.dart | 8 +-- .../prescription/prescription_screen.dart | 49 ++++++++++++------- 3 files changed, 41 insertions(+), 27 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index aa881cbb..25aa98ea 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -15,12 +15,11 @@ class PrescriptionService extends BaseService { List specialityList = []; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( - patientMRN: 3120877, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyODA0IiwianRpIjoiNzNiNmUyZDctMjA0ZC00NzAyLTkxMDYtODE3MzI3OTZkYzI5IiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW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CJBRE1JU1NJT04gU1RBRkYiLCJIRUxQIERFU0sgQURNSU4iLCJBUFBST1ZBTCBTVEFGRiIsIklOUEFUSUVOVCBCSUxMSU5HIENPT1JESU5BVE9SIiwiQklMTElORyBTVEFGRiIsIkNPTlNFTlQgIiwiQ29uc2VudCAtIERlbnRhbCIsIldFQkVNUiJdLCJuYmYiOjE2MDgyMzY2MjAsImV4cCI6MTYwOTEwMDYyMCwiaWF0IjoxNjA4MjM2NjIwfQ.z4Lh0dCRr9GWXvaTo7x5GPV7R5z8ONyh3-0uk3PXMu8", - ); + //patientMRN: 3120877, + + ); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( - search: ["panadol"], + search: ["Acetaminophen"], vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", ); @@ -29,7 +28,7 @@ class PrescriptionService extends BaseService { PostPrescriptionReqModel(); Future getPrescription({int mrn}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: 3120877); + _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index dffcfdff..18208c7c 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -51,10 +51,10 @@ postProcedure( new PostPrescriptionReqModel(); List sss = List(); - postProcedureReqModel.appointmentNo = 2016055159; - postProcedureReqModel.clinicID = 17; - postProcedureReqModel.episodeID = 200012330; - postProcedureReqModel.patientMRN = 3120877; + postProcedureReqModel.appointmentNo = patient.appointmentNo; + postProcedureReqModel.clinicID = patient.clinicId; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.vidaAuthTokenID = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 142f3a98..aa2de753 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -453,21 +453,30 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( - context, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicationName, - model - .prescriptionList[ - 0] - .entityList[ - index] - .medicineCode, - model, - ); + patient: + patient, + drugId: model + .prescriptionList[ + 0] + .entityList[ + index] + .medicineCode, + drugName: model + .prescriptionList[ + 0] + .entityList[ + index] + .medicationName, + remarks: model + .prescriptionList[ + 0] + .entityList[ + index] + .remarks, + model: + model, + context: + context); //model.postPrescription(); }, ), @@ -563,7 +572,12 @@ class _NewPrescriptionScreenState extends State { } void updatePrescriptionForm( - context, String drugName, int drugId, PrescriptionViewModel model) { + {context, + String drugName, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); @@ -635,6 +649,7 @@ class _NewPrescriptionScreenState extends State { SizedBox( height: 12.0, ), + AppText('Remarks'), Container( decoration: BoxDecoration( borderRadius: @@ -642,7 +657,7 @@ class _NewPrescriptionScreenState extends State { border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( - hintText: 'Remarks', + hintText: remarks, controller: remarksController, maxLines: 7, minLines: 4, From fd2a86dca403ef62f7432da3104027f44ef825bf Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 7 Jan 2021 11:21:43 +0200 Subject: [PATCH 152/421] some changes in patientArrivalList And make action when click on vitalSign widget inside pendingReferral --- lib/config/localized_values.dart | 4 ++++ lib/core/service/base/base_service.dart | 5 +++-- lib/core/viewModel/patient-referral-viewmodel.dart | 2 +- .../viewModel/patient-vital-sign-viewmodel.dart | 3 --- .../referral/my-referral-detail-screen.dart | 14 ++++++++++++-- lib/util/translations_delegate_base.dart | 1 + 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3048a39d..672796a6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -536,4 +536,8 @@ const Map> localizedValues = { 'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس" }, + 'patientNoDetailErrMsg': { + 'en': "There is no detail for this patient", + 'ar': "لا توجد تفاصيل لهذا المريض" + }, }; diff --git a/lib/core/service/base/base_service.dart b/lib/core/service/base/base_service.dart index 32edf34f..6f4c5d1e 100644 --- a/lib/core/service/base/base_service.dart +++ b/lib/core/service/base/base_service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; @@ -12,7 +13,7 @@ class BaseService { DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DoctorProfileModel doctorProfile; - List patientArrivalList = []; + List patientArrivalList = []; //TODO add the user login model when we need it Future getDoctorProfile() async { @@ -50,7 +51,7 @@ class BaseService { patientArrivalList.clear(); response['patientArrivalList']['entityList'].forEach((v) { - PatientArrivalEntity item = PatientArrivalEntity.fromJson(v); + PatiantInformtion item = PatiantInformtion.fromJson(v); patientArrivalList.add(item); }); }, diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 35747c37..028eac0d 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -27,7 +27,7 @@ class PatientReferralViewModel extends BaseViewModel { List get pendingReferral => _referralPatientService.pendingReferralList; - List get patientArrivalList => + List get patientArrivalList => _referralPatientService.patientArrivalList; Future getMasterLookup(MasterKeysService masterKeys) async { diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4f2e7e28..5674030c 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -11,9 +11,6 @@ import '../../locator.dart'; class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); - List get patientArrivalList => - _vitalSignService.patientArrivalList; - VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; Future getPatientVitalSign(PatiantInformtion patient) async { diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 1019ede4..77b17e3d 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -12,6 +12,7 @@ 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/borderedButton.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -39,7 +40,7 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: Column( + body: model.patientArrivalList != null ? Column( children: [ Expanded( child: SingleChildScrollView( @@ -110,7 +111,7 @@ class MyReferralDetailScreen extends StatelessWidget { icon: 'lab.png'), PatientProfileButton( key: key, - // patient: patient, + patient: model.patientArrivalList[0], route: PATIENT_VITAL_SIGN, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, @@ -160,6 +161,15 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), ], + ) : Container( + child: Center( + child: AppText( + TranslationBase.of(context).patientNoDetailErrMsg, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b167b48e..8ee0dc7d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -553,6 +553,7 @@ class TranslationBase { String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 4f1a892be4cfb7c6918481bea998ffc3df0bb143 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 7 Jan 2021 14:37:26 +0200 Subject: [PATCH 153/421] first step form create episode --- lib/config/config.dart | 3 + lib/config/localized_values.dart | 2 +- lib/core/service/SOAP_service.dart | 13 ++ lib/core/viewModel/SOAP_view_model.dart | 13 ++ lib/models/SOAP/PostEpisodeReqModel.dart | 28 +++ lib/screens/dashboard_screen.dart | 47 +++++ lib/screens/patients/patients_screen.dart | 9 +- .../profile/patient-page-header-widget.dart | 166 ++++++++++-------- .../profile/profile_medical_info_widget.dart | 71 +++++--- 9 files changed, 254 insertions(+), 98 deletions(-) create mode 100644 lib/models/SOAP/PostEpisodeReqModel.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index e3163bb2..e8e0f6ce 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -132,6 +132,9 @@ const GET_PATIENT_ARRIVAL_LIST = const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; const GET_MASTER_LOOKUP_LIST = 'Services/DoctorApplication.svc/REST/GetMasterLookUpList'; + +const POST_EPISODE = 'Services/DoctorApplication.svc/REST/PostEpisode'; + const POST_ALLERGY = 'Services/DoctorApplication.svc/REST/PostAllergies'; const POST_HISTORY = 'Services/DoctorApplication.svc/REST/PostHistory'; const POST_CHIEF_COMPLAINT = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4ad53ebe..e96daef0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -295,7 +295,7 @@ const Map> localizedValues = { }, 'clinicSelect': {'en': "Select Clinic", 'ar': 'اختار عيادة'}, 'doctorSelect': {'en': "Select Doctor", 'ar': 'اختار طبيب'}, - "empty-message": {"en": "Please enter message", "ar": "يرجى ادخال الموضوع"}, + "empty-message": {"en": "Please enter this field", "ar": "يرجى ادخال هذا الحقل"}, 'no-sickleve-applied': { 'en': "No sick leave applied", 'ar': 'لم تطبق إجازة مرضية' diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index d1fff03b..9707dc53 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -48,6 +49,18 @@ class SOAPService extends LookupService { ); } + Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { + hasError = false; + + await baseAppClient.post(POST_EPISODE, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: postEpisodeReqModel.toJson()); + } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { hasError = false; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index fff7a239..31764c45 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetHistoryReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetHistoryResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamListResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/get_Allergies_request_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/post_allergy_request_model.dart'; @@ -99,6 +100,17 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + + Future postEpisode(PostEpisodeReqModel postEpisodeReqModel) async { + setState(ViewState.BusyLocal); + await _SOAPService.postEpisode(postEpisodeReqModel); + if (_SOAPService.hasError) { + error = _SOAPService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future postAllergy(PostAllergyRequestModel postAllergyRequestModel) async { setState(ViewState.BusyLocal); await _SOAPService.postAllergy(postAllergyRequestModel); @@ -222,6 +234,7 @@ class SOAPViewModel extends BaseViewModel { Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { + setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { diff --git a/lib/models/SOAP/PostEpisodeReqModel.dart b/lib/models/SOAP/PostEpisodeReqModel.dart new file mode 100644 index 00000000..6d3ee45a --- /dev/null +++ b/lib/models/SOAP/PostEpisodeReqModel.dart @@ -0,0 +1,28 @@ +class PostEpisodeReqModel { + int appointmentNo; + int patientMRN; + int doctorID; + String vidaAuthTokenID; + + PostEpisodeReqModel( + {this.appointmentNo, + this.patientMRN, + this.doctorID, + this.vidaAuthTokenID}); + + PostEpisodeReqModel.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + patientMRN = json['PatientMRN']; + doctorID = json['DoctorID']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['PatientMRN'] = this.patientMRN; + data['DoctorID'] = this.doctorID; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 20f22382..dd07f6d7 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -9,9 +9,11 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -77,6 +79,25 @@ class _DashboardScreenState extends State { if (!currentFocus.hasPrimaryFocus) { currentFocus.unfocus(); } + + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), + To: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); return BaseView( onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( @@ -957,6 +978,8 @@ class _DashboardScreenState extends State { height: 20, ), Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, children: [ DashboardItem( child: Column( @@ -984,6 +1007,30 @@ class _DashboardScreenState extends State { ), ); }, + ), + SizedBox(width: 8,), + DashboardItem( + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Icon( + DoctorApp.patient, + size: 50, + ), + AppText( + TranslationBase.of(context).arrived, + color: Colors.black, + textAlign: TextAlign.center, + ) + ], + ), + hasBorder: true, + onTap: () { + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7" + }); + }, ) ], ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 602bd180..0c2a53d4 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -274,7 +274,8 @@ class _PatientsScreenState extends State { .then((res) { setState(() { _isLoading = false; - if (res['MessageStatus'] == 1) { + + if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { if (res[SERVICES_PATIANT2[val2]] == null) { _isError = true; @@ -282,6 +283,9 @@ class _PatientsScreenState extends State { this.error = error.toString(); } else { var localList = []; + if(res["patientArrivalList"]["entityList"] == null){ + res["patientArrivalList"]["entityList"] = []; + } res["patientArrivalList"]["entityList"].forEach((v) { Map mergedPatient = { ...v, @@ -289,7 +293,6 @@ class _PatientsScreenState extends State { }; localList.add(mergedPatient); }); - print(localList.toString()); lItems = localList; } } else { @@ -301,7 +304,7 @@ class _PatientsScreenState extends State { _isError = false; } else { _isError = true; - error = res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } }); }).catchError((error) { diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 3e870be5..f4de0615 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,92 +1,112 @@ +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; class PatientPageHeaderWidget extends StatelessWidget { final PatiantInformtion patient; - + String allergiesString=''; PatientPageHeaderWidget(this.patient); @override Widget build(BuildContext context) { - return Container( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisSize: MainAxisSize.min, - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 20, + return BaseView( + onModelReady: (model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: patient.patientMRN, + episodeId: patient.episodeNo, + appointmentNo: patient.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + model.patientAllergiesList.forEach((element) { + allergiesString += element.allergyDiseaseName+' , '; + }); + }, + builder: (_, model, w) => Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, + ), + SizedBox( + width: 20, + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 5, + ), + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 20, + ), + AppText( + patient.age.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + NetworkBaseView( + baseViewModel: model, + child: AppText( + "ALLERGIC TO: $allergiesString", + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ), + ], ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN, EGG WHITE", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + SizedBox( + width: 20, ), - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - SizedBox( - width: 20, - ), - ], - ), - ); + ], + ), + )); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 8860a7dc..34433fa7 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,7 +1,13 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -22,26 +28,42 @@ class ProfileMedicalInfoWidget extends StatelessWidget { String patientType; @override Widget build(BuildContext context) { - return SliverGrid.count( + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => SliverGrid.count( crossAxisSpacing: 10, mainAxisSpacing: 20, crossAxisCount: 2, childAspectRatio: 1.5, children: [ + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + onTap: () async { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + await model.postEpisode(postEpisodeReqModel); + }, + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png' + ), if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - icon: 'create-episod.png'), - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase + .of(context) + .update, + nameLine2: TranslationBase + .of(context) + .episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), if(selectedPatientType == 6 || selectedPatientType == 7) @@ -146,7 +168,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { .of(context) .ucaf, icon: 'lab.png'), - ]); + ],),); } } @@ -206,20 +228,25 @@ class PatientProfileButton extends StatelessWidget { final dynamic route; final PatiantInformtion patient; final String url = "assets/images/"; - PatientProfileButton( - {Key key, - this.patient, - this.nameLine1, - this.nameLine2, - this.icon, - this.route}) + final bool isDisable; + final bool isLoading; + final Function onTap; + + + PatientProfileButton({Key key, + this.patient, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, this.isDisable = false, this.onTap, this.isLoading = false}) : super(key: key); + @override Widget build(BuildContext context) { return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), child: InkWell( - onTap: () { + onTap: isDisable?null:onTap != null ? onTap : () { navigator(context, this.route); }, child: Column(children: [ @@ -243,6 +270,8 @@ class PatientProfileButton extends StatelessWidget { textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 2, ), + if(isLoading) + DrAppCircularProgressIndeicator() ], ), ), @@ -261,7 +290,7 @@ class PatientProfileButton extends StatelessWidget { ), decoration: BoxDecoration( // border: Border.all(), - color: Colors.white, + color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), border: Border.fromBorderSide(BorderSide( color: Color(0xffBBBBBB), From 5253c28469338cf777cdc5bfbb8a9f197e5c1d42 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 8 Jan 2021 00:43:45 +0200 Subject: [PATCH 154/421] prescription form fix --- .../medical-file/medical_file_details.dart | 1336 +++++++++-------- .../prescription/add_prescription_form.dart | 938 ++++++------ .../prescription/prescription_screen.dart | 25 +- 3 files changed, 1181 insertions(+), 1118 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 3823a88e..e11201e5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -124,79 +124,142 @@ class _MedicalFileDetailsState extends State { thickness: 1.0, color: Colors.grey, ), - Padding( - padding: EdgeInsets.all(10.0), - child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Visit Date : ', - 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( - 'Doctor : '.toUpperCase(), - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + 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( + 'Visit Date : ', + 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) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], ), - ], - ), - if (model.medicalFileList.length != 0) - Row( - children: [ - AppText( - 'Clinic : ', - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + 'Doctor : '.toUpperCase(), + 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] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ], + ), + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + 'Clinic : ', + 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] + .clinicName, + ), + ], + ), + Row( + children: [ + AppText( + 'Episode Number : ', + 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] @@ -206,111 +269,237 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .clinicName, + HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Texts( + 'History of present illness' + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstMedicalHistory + .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] + .lstMedicalHistory[ + index] + .history + .trim(), + ), + ), + SizedBox(width: 35.0), + ], + ), + ], + ), + ), + ); + }), + isExpand: isHistoryExpand, ), - ], - ), - Row( - children: [ - AppText( - 'Episode Number : ', - 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: 30, ), - ], - ), - 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( - 'History of present illness' - .toUpperCase(), - variant: - isHistoryExpand ? "bodyText" : '', - bold: isHistoryExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isHistoryExpand = !isHistoryExpand; - }); - }, - child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstMedicalHistory - .length, - itemBuilder: (BuildContext ctxt, int index) { - return Padding( - padding: EdgeInsets.all(8.0), - child: Container( - child: Column( - mainAxisAlignment: - MainAxisAlignment.center, + 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: [ - Row( - children: [ - Expanded( - child: AppText( + Texts('assessment'.toUpperCase(), + variant: isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : false, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + 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 + .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[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstAssessments[index] + .type), + ], + ), + SizedBox( + height: 15.0, + ), + AppText( model .medicalFileList[0] .entityList[0] @@ -318,494 +507,355 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory[ - index] - .history + .lstAssessments[index] + .remarks .trim(), ), - ), - SizedBox(width: 35.0), - ], + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.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('assessment'.toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: - isAssessmentExpand ? true : false, - color: Colors.black), - ], + ); + }), + isExpand: isAssessmentExpand, ), - InkWell( - onTap: () { - setState(() { - isAssessmentExpand = - !isAssessmentExpand; - }); - }, - child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - 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, + 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: [ - 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 - .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[encounterNumber] - .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, - ), + Texts( + 'Test / procedures' + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : false, + color: Colors.black), ], ), - ), - ); - }), - 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('Test / procedures'.toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: - isProcedureExpand ? true : false, - color: Colors.black), - ], - ), - InkWell( - onTap: () { - setState(() { - isProcedureExpand = - !isProcedureExpand; - }); - }, - child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - 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, - ), - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[0] - // .timeLineEvents[0] - // .consulations[0] - // .lstProcedure[index] - // .orderDate - // .trim(), - // ), - ], - ), - Row( - children: [ - 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, + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + 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, + ), + // AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[0] + // .timeLineEvents[0] + // .consulations[0] + // .lstProcedure[index] + // .orderDate + // .trim(), + // ), + ], + ), + Row( + children: [ + 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('physical exam'.toUpperCase(), - variant: - isPhysicalExam ? "bodyText" : '', - bold: isPhysicalExam ? true : false, - color: Colors.black), - ], + ); + }), + isExpand: isProcedureExpand, ), - InkWell( - onTap: () { - setState(() { - isPhysicalExam = !isPhysicalExam; - }); - }, - child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) - ], - ), - bodyWidget: ListView.builder( - //physics: , - 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( + 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: [ - Row( - children: [ - AppText( - 'Exam Type: ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .examType), - ], - ), - Row( - children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[index] - .examDesc, - fontWeight: FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: FontWeight.w700, - ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .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, - ), + Texts('physical exam'.toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : false, + color: Colors.black), ], ), - ), - ); - }), - isExpand: isPhysicalExam, + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.minus + : EvaIcons.plus)) + ], + ), + bodyWidget: ListView.builder( + //physics: , + 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] + .examType), + ], + ), + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstPhysicalExam[ + index] + .examDesc, + fontWeight: + FontWeight.w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: + FontWeight.w700, + ), + AppText(model + .medicalFileList[0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .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, + ), + ], + ), + ), + ); + }), + isExpand: isPhysicalExam, + ), + SizedBox( + height: 30, + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ], ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), ), - ], - ), - ), - ), + ) + : Text("There's no medical file for this patient") ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 18208c7c..10b779e6 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -60,15 +60,15 @@ postProcedure( sss.add(PrescriptionRequestModel( covered: true, dose: 1, - itemId: int.parse(drugId), + itemId: drugId.isEmpty ? 1 : int.parse(drugId), doseUnitId: 1, - route: int.parse(route), - frequency: int.parse(frequency), + route: route.isEmpty ? 1 : int.parse(route), + frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, icdcode10Id: "test2", - doseTime: int.parse(doseTimeIn), - duration: int.parse(duration), + doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), + duration: duration.isEmpty ? 1 : int.parse(duration), doseStartDate: doseTime.toIso8601String())); postProcedureReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; @@ -120,10 +120,9 @@ class _PrescriptionFormWidgetState extends State { List durationList; List doseTimeList; List indicationList; + String routeInatial = 'By Mouth'; //PatiantInformtion patient; - dynamic _strength; - dynamic _selectedBranch; @override void initState() { super.initState(); @@ -260,487 +259,500 @@ class _PrescriptionFormWidgetState extends State { return BaseView( onModelReady: (model) => model.getDrugs(), - builder: (BuildContext context, PrescriptionViewModel model, - Widget child) => - DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: - (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 980, - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.drugsList != null && - model.drugsList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.drugsList, - attributeName: 'GenericName', - attributeValueId: 'ItemId', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - selectedDrug = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).search, - selectedDrug != null - ? selectedDrug['GenericName'] - : null, - true), - enabled: false, - ), + builder: + (BuildContext context, PrescriptionViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 980, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.drugsList != null && + model.drugsList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.drugsList, + attributeName: 'GenericName', + attributeValueId: 'ItemId', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + selectedDrug = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicine, + selectedDrug != null + ? selectedDrug['GenericName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: referToList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: referToList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - type = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .orderType, - type != null ? type['name'] : null, - true), - enabled: false, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Row( + children: [ + AppText('Order Type'), + Radio(), + Text('Regular'), + Radio( + value: 1, ), - ), + Text('Urgent'), + ], ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: strengthList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: strengthList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - strength = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .strength, - strength != null - ? strength['name'] - : null, - true), - enabled: false, - ), + ), + // Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: referToList != null + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: referToList, + // attributeName: 'name', + // attributeValueId: 'id', + // okText: + // TranslationBase.of(context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // type = selectedValue; + // _selectedBranch = null; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: + // (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // child: TextField( + // decoration: textFieldSelectorDecoration( + // TranslationBase.of(context) + // .orderType, + // type != null ? type['name'] : null, + // true), + // enabled: false, + // ), + // ), + // ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: strengthList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: strengthList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + strength = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).strength, + strength != null + ? strength['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: routeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: routeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, - route != null - ? route['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + helpers.showErrorToast( + 'plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).route, + route != null ? route['name'] : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: frequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: frequencyList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequency != null - ? frequency['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequency != null + ? frequency['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: doseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: doseTimeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - indicationList = - selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .indication, - indication != null - ? indication['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indication = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .indication, + indication != null + ? indication['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .date, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: durationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: durationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - _selectedBranch = null; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - duration != null - ? duration['name'] - : null, - true), - enabled: false, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: durationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: durationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + duration != null + ? duration['name'] + : null, + true), + enabled: false, ), ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - maxLines: 6, - minLines: 4, - hintText: TranslationBase.of(context) - .instruction, - controller: instructionController, - //keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, - ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + maxLines: 6, + minLines: 4, + hintText: + TranslationBase.of(context).instruction, + controller: instructionController, + //keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - formKey.currentState.save(); + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + formKey.currentState.save(); - if (formKey.currentState - .validate()) { - postProcedure( - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: frequency['id'] - .toString(), - route: route['id'].toString(), - drugId: selectedDrug['ItemId'] - .toString(), - strength: - strength['id'].toString(), - indication: - indicationController.text, - instruction: - instructionController - .text, - doseTime: selectedDate); - Navigator.pop(context); - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], - ), + if (strength == null || + route == null || + frequency == null || + indication == null || + doseTime == null || + duration == null || + selectedDrug == null || + selectedDate == null) { + DrAppToastMsg.showErrorToast( + "Please Fill All Fields"); + return; + } + + if (formKey.currentState.validate()) { + postProcedure( + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: + frequency['id'].toString(), + route: route['id'].toString(), + drugId: selectedDrug['ItemId'] + .toString(), + strength: + strength['id'].toString(), + indication: + indicationController.text, + instruction: + instructionController.text, + doseTime: selectedDate); + Navigator.pop(context); + } + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], ), - ], - ), + ), + ], ), ), - ], - ), + ), + ], ), ), - ); - }), + ), + ); + }), + ), ); } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index aa2de753..45e5173f 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -679,6 +679,7 @@ class _NewPrescriptionScreenState extends State { title: 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( + patient: patient, model: model, drugId: drugId, remarks: remarksController.text, @@ -700,23 +701,23 @@ class _NewPrescriptionScreenState extends State { }); } - updatePrescription({ - PrescriptionViewModel model, - int drugId, - String remarks, - String dose, - String frequency, - String route, - }) async { + updatePrescription( + {PrescriptionViewModel model, + int drugId, + String remarks, + String dose, + String frequency, + String route, + PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = new PostPrescriptionReqModel(); List sss = List(); - updatePrescriptionReqModel.appointmentNo = 2016055159; - updatePrescriptionReqModel.clinicID = 17; - updatePrescriptionReqModel.episodeID = 200012330; - updatePrescriptionReqModel.patientMRN = 3120877; + updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; + updatePrescriptionReqModel.clinicID = patient.clinicId; + updatePrescriptionReqModel.episodeID = patient.episodeNo; + updatePrescriptionReqModel.patientMRN = patient.patientMRN; updatePrescriptionReqModel.vidaAuthTokenID = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( From 175ba545e7cdd622af9590bbb7ef38255625073d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 12:14:25 +0200 Subject: [PATCH 155/421] finish create episode --- lib/core/service/SOAP_service.dart | 3 +++ lib/core/viewModel/SOAP_view_model.dart | 2 ++ lib/widgets/patients/profile/profile_medical_info_widget.dart | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index 9707dc53..e3ab61b2 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -32,6 +32,7 @@ class SOAPService extends LookupService { List patientProgressNoteList = []; List patientAssessmentList = []; + int episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { await baseAppClient.post( GET_ALLERGIES, @@ -54,7 +55,9 @@ class SOAPService extends LookupService { await baseAppClient.post(POST_EPISODE, onSuccess: (dynamic response, int statusCode) { + print("Success"); + episodeID = response['EpisodeID']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 31764c45..ebb282ef 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -79,6 +79,8 @@ class SOAPViewModel extends BaseViewModel { List get patientAssessmentList => _SOAPService.patientAssessmentList; + int get episodeID => + _SOAPService.episodeID; Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 34433fa7..a614ddb4 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -49,6 +49,10 @@ class ProfileMedicalInfoWidget extends StatelessWidget { appointmentNo: patient.appointmentNo, patientMRN: patient.patientMRN); await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + + }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png' From 0147e7e49b5016fd6f51b05a71238864e741783f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 15:15:42 +0200 Subject: [PATCH 156/421] do translation, fix some bugs --- lib/config/localized_values.dart | 1 + lib/core/viewModel/SOAP_view_model.dart | 8 ++++++++ lib/util/translations_delegate_base.dart | 1 + .../patients/profile/patient-page-header-widget.dart | 11 ++++------- .../profile/profile_medical_info_widget.dart | 2 +- .../profile/soap_update/update_assessment_page.dart | 11 ++++------- .../profile/soap_update/update_objective_page.dart | 6 +++--- .../profile/soap_update/update_plan_page.dart | 12 +++++------- 8 files changed, 27 insertions(+), 25 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index e96daef0..d1c52f7a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -541,4 +541,5 @@ const Map> localizedValues = { 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, + 'doc': {'en': "Doc :", 'ar':" د: " }, }; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index ebb282ef..e3daf6e9 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -246,6 +246,14 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + String getAllergicNames(){ + String allergiesString=''; + patientAllergiesList.forEach((element) { + allergiesString += element.allergyDiseaseName+' , '; + }); + return allergiesString; + } + Future getPatientHistories(GetHistoryReqModel getHistoryReqModel, {bool isFirst = false}) async { setState(ViewState.Busy); await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: isFirst); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e6b5dbd5..0cfd0b6f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -558,6 +558,7 @@ class TranslationBase { String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get doc => localizedValues['doc'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index f4de0615..a6c47a7f 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -12,7 +12,6 @@ import 'package:flutter/material.dart'; class PatientPageHeaderWidget extends StatelessWidget { final PatiantInformtion patient; - String allergiesString=''; PatientPageHeaderWidget(this.patient); @override @@ -26,9 +25,7 @@ class PatientPageHeaderWidget extends StatelessWidget { doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); - model.patientAllergiesList.forEach((element) { - allergiesString += element.allergyDiseaseName+' , '; - }); + }, builder: (_, model, w) => Container( child: Column( @@ -85,11 +82,11 @@ class PatientPageHeaderWidget extends StatelessWidget { ), NetworkBaseView( baseViewModel: model, - child: AppText( - "ALLERGIC TO: $allergiesString", + child: model.patientAllergiesList.isNotEmpty ?AppText( + "ALLERGIC TO: "+model.getAllergicNames(), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, - ), + ) : AppText(''), ), ], ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a614ddb4..d3ea6048 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -94,7 +94,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 10bfc120..0cec0609 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -41,7 +41,6 @@ class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; return BaseView( onModelReady: (model) async{ @@ -152,12 +151,10 @@ class _UpdateAssessmentPageState extends State { model: model); }, readOnly: true, - // hintColor: Colors.black, suffixIcon: EvaIcons.plusCircleOutline, suffixIconColor: AppGlobal .appPrimaryColor, fontWeight: FontWeight.w600, - // controller: messageController, validator: (value) { if (value == null) return TranslationBase @@ -217,7 +214,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Appointment #: ", + TranslationBase.of(context).appointmentNo, fontWeight: FontWeight .bold, fontSize: 16, @@ -250,7 +247,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Type : ", + TranslationBase.of(context).type +':', fontWeight: FontWeight .bold, fontSize: 16, @@ -270,7 +267,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Doc : ", + TranslationBase.of(context).doc, fontWeight: FontWeight .bold, fontSize: 16, @@ -671,7 +668,7 @@ class _AddAssessmentDetailsState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(), loading: model.state == ViewState.BusyLocal, onPressed: () async { widget.mySelectedAssessment.remark = diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 0c8bece6..550a36ca 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -397,10 +397,10 @@ class _UpdateObjectivePageState extends State { widget.changePageViewIndex(2); } } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); - } + widget.changePageViewIndex(2); - widget.changePageViewIndex(2); + // helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + } } removeExamination(MasterKeyModel masterKey) { diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index a91447d6..b8ceea79 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -51,8 +51,6 @@ class _UpdatePlanPageState extends State { @override Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( onModelReady: (model) async { GetGetProgressNoteReqModel getGetProgressNoteReqModel = @@ -287,13 +285,13 @@ class _UpdatePlanPageState extends State { appointmentNo: widget.patientInfo.appointmentNo, planNote: progressNoteController.text, doctorID: '', editedBy: ''); - // if(model.patientProgressNoteList.isEmpty){ + if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); - // }else { - // await model.patchProgressNote(postProgressNoteRequestModel); - // - // } + }else { + await model.patchProgressNote(postProgressNoteRequestModel); + + } if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); From fb035cd4c9e385325357b11def3eb2279bc19ba8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 10 Jan 2021 17:35:40 +0200 Subject: [PATCH 157/421] fix patient_search_screen.dart --- .../patients/patient_search_screen.dart | 12 ------ lib/widgets/patients/dynamic_elements.dart | 39 ++++++++++++++++--- lib/widgets/shared/app_text_form_field.dart | 5 +-- 3 files changed, 35 insertions(+), 21 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 61eb5fcf..94102b1b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -68,21 +68,9 @@ class _PatientSearchScreenState extends State { try { - - /* Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - DoctorProfileModel doctorProfile = - new DoctorProfileModel.fromJson(profile)*/; if (_formKey.currentState.validate()) { _formKey.currentState.save(); - /* sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); - String token = await sharedPref.getString(TOKEN); - - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = doctorProfile.projectID; //15 - _patientSearchFormValues.DoctorID = doctorProfile.doctorID; - _patientSearchFormValues.ClinicID = doctorProfile.clinicID;*/ - if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && _selectedType == "7") { diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index 25d196d0..e6688397 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -59,22 +59,49 @@ 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}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ) + ; + } return LayoutBuilder( builder: (ctx, constraints) { return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox( + height: 10, + ), SizedBox( height: 10, ), AppTextFormField( - textInputType: TextInputType.number, + onTap: ()=> _presentDatePicker('_selectedFromDate'), hintText: TranslationBase.of(context).fromDate, controller: _fromDateController, inputFormatter: ONLY_DATE, - onTap: () { - _presentDatePicker('_selectedFromDate'); - }, onSaved: (value) { if (_fromDateController.text.toString().trim().isEmpty) { widget._patientSearchFormValues.From = "0"; @@ -82,12 +109,14 @@ class _DynamicElementsState extends State { widget._patientSearchFormValues.From = _fromDateController.text.replaceAll("/", "-"); } }, + readOnly: true, + ), SizedBox( height: 10, ), AppTextFormField( - textInputType: TextInputType.number, + readOnly: true, hintText: TranslationBase .of(context) .toDate, diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 4c2573cd..82a273bb 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -4,10 +4,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; -// OWNER : Ibrahim albitar -// DATE : 19-04-2020 -// DESCRIPTION : Custom Text Form Field for app. - class AppTextFormField extends FormField { AppTextFormField( {FormFieldSetter onSaved, @@ -41,6 +37,7 @@ class AppTextFormField extends FormField { obscureText: obscureText, focusNode: focusNode, keyboardType: textInputType, + readOnly: readOnly, inputFormatters: [ FilteringTextInputFormatter.allow( RegExp(inputFormatter)), From 90a16676db8fe07d6bc14f51a8de3ca1f47e3342 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 11 Jan 2021 13:54:57 +0200 Subject: [PATCH 158/421] fix issue related to SOAP --- .../soap_update/custom_validation_error.dart | 33 +++++ .../subjective/update_allergies_widget.dart | 42 ++++-- .../subjective/update_history_widget.dart | 121 +++++++++-------- .../soap_update/update_assessment_page.dart | 24 +++- .../soap_update/update_objective_page.dart | 2 +- .../profile/soap_update/update_plan_page.dart | 7 +- .../master_key_checkbox_search_widget.dart | 125 +++++++++--------- 7 files changed, 215 insertions(+), 139 deletions(-) create mode 100644 lib/widgets/patients/profile/soap_update/custom_validation_error.dart diff --git a/lib/widgets/patients/profile/soap_update/custom_validation_error.dart b/lib/widgets/patients/profile/soap_update/custom_validation_error.dart new file mode 100644 index 00000000..a05d52a2 --- /dev/null +++ b/lib/widgets/patients/profile/soap_update/custom_validation_error.dart @@ -0,0 +1,33 @@ + +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +// ignore: must_be_immutable +class CustomValidationError extends StatelessWidget { + String error; + CustomValidationError({ + Key key, this.error, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + if(error == null ) + error = TranslationBase + .of(context) + .emptyMessage; + return Column( + children: [ + SizedBox( + height: 2, + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 3), + child: AppText(error, color: Theme + .of(context) + .errorColor, fontSize: 14,), + ), + ], + ); + } +} \ No newline at end of file diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 6de9e031..38a0896b 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -19,6 +19,8 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; +import '../custom_validation_error.dart'; + class UpdateAllergiesWidget extends StatefulWidget { final List myAllergiesList; @@ -226,10 +228,11 @@ class _AddAllergiesState extends State { MasterKeyModel _selectedAllergy; TextEditingController remarkController = TextEditingController(); GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; - - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown,{IconData icon}) { + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), @@ -328,18 +331,24 @@ class _AddAllergiesState extends State { input.toLowerCase()) || suggestion.nameEn.toLowerCase() .startsWith(input.toLowerCase()), - ):TextField( + ) : TextField( decoration: textFieldSelectorDecoration( TranslationBase .of(context) .selectAllergy, _selectedAllergy != null - ? projectViewModel.isArabic?_selectedAllergy.nameAr: _selectedAllergy.nameEn - : null, true, icon: EvaIcons.search), + ? projectViewModel.isArabic + ? _selectedAllergy.nameAr + : _selectedAllergy.nameEn + : null, + true, + icon: EvaIcons.search), enabled: false, ), ), ), + if(isFormSubmitted && _selectedAllergy == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -382,6 +391,8 @@ class _AddAllergiesState extends State { ), ), ), + if(isFormSubmitted && _selectedAllergySeverity == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -410,12 +421,18 @@ class _AddAllergiesState extends State { AppButton( title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - isChecked: true, - selectedAllergySeverity: _selectedAllergySeverity,); - widget.addAllergiesFun(mySelectedAllergy); + setState(() { + isFormSubmitted = true; + }); + if(_selectedAllergy !=null && _selectedAllergySeverity !=null) { + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + isChecked: true, + selectedAllergySeverity: _selectedAllergySeverity,); + widget.addAllergiesFun(mySelectedAllergy); + } + }, ), ] @@ -433,3 +450,4 @@ class _AddAllergiesState extends State { + diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 9a7cba01..28f9f466 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -271,6 +272,9 @@ class _AddHistoryDialogState extends State { onModelReady: (model) async { if (model.historyFamilyList.length == 0) { await model.getMasterLookup(MasterKeysService.HistoryFamily); + setState(() { + + }); } }, builder: (_, model, w) => AppScaffold( @@ -313,62 +317,71 @@ class _AddHistoryDialogState extends State { }, scrollDirection: Axis.horizontal, children: [ - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyFamilyList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyFamilyList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.mergeHistorySurgicalWithHistorySportList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.mergeHistorySurgicalWithHistorySportList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), - MasterKeyCheckboxSearchWidget( - model: model, - masterList: model.historyMedicalList, - removeHistory: (history){ - setState(() { - widget.removeHistory(history); - }); - }, - addHistory: (history){ - setState(() { - createAndAddHistory( - history); - }); - }, - addSelectedHistories: (){ - widget.addSelectedHistories(); - }, - isServiceSelected: (master) =>isServiceSelected(master), + NetworkBaseView( + baseViewModel: model, + child: MasterKeyCheckboxSearchWidget( + model: model, + masterList: model.historyMedicalList, + removeHistory: (history){ + setState(() { + widget.removeHistory(history); + }); + }, + addHistory: (history){ + setState(() { + createAndAddHistory( + history); + }); + }, + addSelectedHistories: (){ + widget.addSelectedHistories(); + }, + isServiceSelected: (master) =>isServiceSelected(master), + ), ), ], ), diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 0cec0609..93d56af2 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -23,6 +23,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'custom_validation_error.dart'; + class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; List mySelectedAssessmentList; @@ -399,6 +401,7 @@ class _UpdateAssessmentPageState extends State { addSelectedAssessment: (MySelectedAssessment mySelectedAssessment, bool isUpdate) async { setState(() { + widget.mySelectedAssessmentList.add(mySelectedAssessment); }); }); @@ -413,7 +416,6 @@ class AddAssessmentDetails extends StatefulWidget { final Function(MySelectedAssessment mySelectedAssessment, bool isUpdate) addSelectedAssessment; final PatiantInformtion patientInfo; final bool isUpdate; - AddAssessmentDetails( {Key key, this.mySelectedAssessment, this.addSelectedAssessment, this.patientInfo, this.isUpdate = false, this.mySelectedAssessmentList}); @@ -426,6 +428,7 @@ class _AddAssessmentDetailsState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController(); GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; @override Widget build(BuildContext context) { @@ -549,6 +552,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedICD == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -595,6 +601,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedDiagnosisCondition == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -641,6 +650,9 @@ class _AddAssessmentDetailsState extends State { ), ), ), + if(isFormSubmitted && widget.mySelectedAssessment + .selectedDiagnosisType == null) + CustomValidationError(), SizedBox( height: 10, ), @@ -671,6 +683,9 @@ class _AddAssessmentDetailsState extends State { title: (widget.isUpdate?TranslationBase.of(context).update:TranslationBase.of(context).add).toUpperCase(), loading: model.state == ViewState.BusyLocal, onPressed: () async { + setState(() { + isFormSubmitted = true; + }); widget.mySelectedAssessment.remark = remarkController.text; widget.mySelectedAssessment @@ -692,10 +707,6 @@ class _AddAssessmentDetailsState extends State { model: model, mySelectedAssessment: widget .mySelectedAssessment); - } else { - helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); } }, ), @@ -752,7 +763,8 @@ class _AddAssessmentDetailsState extends State { mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; if (!isUpdate) { - widget.mySelectedAssessmentList.add(mySelectedAssessment); + // widget.mySelectedAssessmentList.add(mySelectedAssessment); + widget.addSelectedAssessment(mySelectedAssessment,isUpdate); } Navigator.of(context).pop(); } diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 550a36ca..9bd38666 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -315,7 +315,7 @@ class _UpdateObjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 4, - controller: remarksController, + // controller: remarksController, validator: (value) { if (value == null) return TranslationBase.of(context) diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index b8ceea79..a3c2cdd2 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -113,7 +113,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty) + if(model.patientProgressNoteList.isEmpty || progressNoteController.text !='') Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -140,7 +140,7 @@ class _UpdatePlanPageState extends State { SizedBox( height: 20, ), - if (progressNoteController.text.isNotEmpty) + if (progressNoteController.text !='') Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -350,6 +350,9 @@ class _UpdatePlanPageState extends State { AppButton( title: "Add".toUpperCase(), onPressed: () { + setState(() { + print(progressNoteController.text); + }); Navigator.of(context).pop(); }, ), diff --git a/lib/widgets/shared/master_key_checkbox_search_widget.dart b/lib/widgets/shared/master_key_checkbox_search_widget.dart index aafb8adc..dd9e2f3d 100644 --- a/lib/widgets/shared/master_key_checkbox_search_widget.dart +++ b/lib/widgets/shared/master_key_checkbox_search_widget.dart @@ -53,71 +53,68 @@ class _MasterKeyCheckboxSearchWidgetState extends State Date: Mon, 11 Jan 2021 14:45:09 +0200 Subject: [PATCH 159/421] fix issue related to landing page --- lib/landing_page.dart | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index edfc496c..c5494acf 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -64,10 +64,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - MessagesScreen(), - //MyScheduleScreen(), - NewPrescriptionScreen(), - ServicesScreen() + // MessagesScreen(), + MyScheduleScreen(), + // ServicesScreen() ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), From 2f17167e2f1025ab271ebe87b4389e9399d85a3c Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 11 Jan 2021 18:33:12 +0200 Subject: [PATCH 160/421] some design enhancments --- .../patients/profile/UCAF/UCAF-detail-screen.dart | 8 ++++---- .../profile/referral/refer-patient-screen.dart | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 0a655231..83f2d68b 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -72,11 +72,11 @@ class _UcafDetailScreenState extends State { ), Container( margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: BorderedButton( TranslationBase.of(context).save, hasBorder: true, - vPadding: 16, + vPadding: 8, hPadding: 8, borderColor: HexColor("#B8382B"), backgroundColor: HexColor("#B8382B"), @@ -87,11 +87,11 @@ class _UcafDetailScreenState extends State { ), Container( margin: - EdgeInsets.only(left: 16, right: 16, top: 0, bottom: 16), + EdgeInsets.only(left: 16, right: 16, top: 0.0, bottom: 8), child: BorderedButton( TranslationBase.of(context).cancel, hasBorder: true, - vPadding: 16, + vPadding: 8, hPadding: 8, borderColor: Colors.white, backgroundColor: Colors.white, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index e46ab6d5..62952108 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -40,11 +40,7 @@ class _PatientMakeReferralScreenState extends State { @override void initState() { super.initState(); - referToList = List(); - dynamic sameBranch = {"id": 1, "name": "Same Branch"}; - dynamic otherBranch = {"id": 2, "name": "Other Branch"}; - referToList.add(sameBranch); - referToList.add(otherBranch); + appointmentDate = DateTime.now(); } @@ -53,6 +49,12 @@ class _PatientMakeReferralScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; + referToList = List(); + dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; + dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; + referToList.add(sameBranch); + referToList.add(otherBranch); + final screenSize = MediaQuery.of(context).size; return BaseView( From 40e9ab864a2dc371dd588c7ae78a0bd731d155b3 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 12 Jan 2021 11:36:42 +0300 Subject: [PATCH 161/421] login changes --- android/app/build.gradle | 4 +- android/app/google-services.json | 39 + android/build.gradle | 1 + android/google-services.json | 39 + android/gradle.properties | 3 +- assets/images/login/101.png | Bin 0 -> 3484 bytes assets/images/login/102.png | Bin 0 -> 3991 bytes assets/images/login/103.png | Bin 0 -> 2377 bytes assets/images/login/104.png | Bin 0 -> 4981 bytes assets/images/login/fileNum.png | Bin 0 -> 1515 bytes assets/images/login/forget.png | Bin 0 -> 1980 bytes assets/images/login/id.png | Bin 0 -> 1308 bytes assets/images/login/more_icon.png | Bin 0 -> 488 bytes assets/images/login/nationalID.png | Bin 0 -> 2834 bytes lib/client/base_app_client.dart | 24 +- lib/config/config.dart | 10 +- lib/config/localized_values.dart | 35 + lib/config/shared_pref_kay.dart | 2 + lib/core/model/imei_details.dart | 88 ++ lib/core/model/insert_imei_model.dart | 92 ++ lib/core/service/auth_service.dart | 29 + lib/core/service/medicine_service.dart | 1 - lib/core/viewModel/auth_view_model.dart | 76 +- lib/core/viewModel/imei_view_model.dart | 21 + lib/core/viewModel/project_view_model.dart | 7 +- lib/locator.dart | 5 + lib/main.dart | 51 +- .../auth/activation_Code_req_model.dart | 21 +- .../check_activation_code_request_model.dart | 29 +- lib/screens/auth/login_screen.dart | 149 +-- .../auth/verification_methods_screen.dart | 2 +- lib/screens/dashboard_screen.dart | 9 + .../reschedule-leaves/reschedule_leave.dart | 4 +- lib/util/helpers.dart | 17 +- lib/util/translations_delegate_base.dart | 53 +- lib/widgets/auth/known_user_login.dart | 4 +- lib/widgets/auth/login_form.dart | 35 +- lib/widgets/auth/verification_methods.dart | 861 ++++++++++++++---- lib/widgets/otp/sms-popup.dart | 346 +++++++ pubspec.lock | 28 + pubspec.yaml | 4 +- 41 files changed, 1702 insertions(+), 387 deletions(-) create mode 100644 android/app/google-services.json create mode 100644 android/google-services.json create mode 100644 assets/images/login/101.png create mode 100644 assets/images/login/102.png create mode 100644 assets/images/login/103.png create mode 100644 assets/images/login/104.png create mode 100644 assets/images/login/fileNum.png create mode 100644 assets/images/login/forget.png create mode 100644 assets/images/login/id.png create mode 100644 assets/images/login/more_icon.png create mode 100644 assets/images/login/nationalID.png create mode 100644 lib/core/model/imei_details.dart create mode 100644 lib/core/model/insert_imei_model.dart create mode 100644 lib/core/service/auth_service.dart create mode 100644 lib/core/viewModel/imei_view_model.dart create mode 100644 lib/widgets/otp/sms-popup.dart diff --git a/android/app/build.gradle b/android/app/build.gradle index ae87782e..da345fc2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -44,6 +44,7 @@ android { versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true } buildTypes { @@ -72,9 +73,10 @@ dependencies { implementation 'com.opentok.android:opentok-android-sdk:2.16.5' //permissions implementation 'pub.devrel:easypermissions:0.4.0' - +implementation 'com.google.firebase:firebase-core:9.6.1' //retrofit implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1' + apply plugin: 'com.google.gms.google-services' } diff --git a/android/app/google-services.json b/android/app/google-services.json new file mode 100644 index 00000000..3c00f05c --- /dev/null +++ b/android/app/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "1008895414777", + "project_id": "doctorapp-9f172", + "storage_bucket": "doctorapp-9f172.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", + "android_client_info": { + "package_name": "com.example.doctor_app_flutter" + } + }, + "oauth_client": [ + { + "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/build.gradle b/android/build.gradle index 357c6a1a..ea0f0026 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -8,6 +8,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:3.5.0' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'com.google.gms:google-services:4.3.2' } } diff --git a/android/google-services.json b/android/google-services.json new file mode 100644 index 00000000..3c00f05c --- /dev/null +++ b/android/google-services.json @@ -0,0 +1,39 @@ +{ + "project_info": { + "project_number": "1008895414777", + "project_id": "doctorapp-9f172", + "storage_bucket": "doctorapp-9f172.appspot.com" + }, + "client": [ + { + "client_info": { + "mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", + "android_client_info": { + "package_name": "com.example.doctor_app_flutter" + } + }, + "oauth_client": [ + { + "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } + } + ], + "configuration_version": "1" +} \ No newline at end of file diff --git a/android/gradle.properties b/android/gradle.properties index 38c8d454..9c0729c9 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,4 +1,5 @@ -org.gradle.jvmargs=-Xmx1536M + android.enableR8=true android.useAndroidX=true android.enableJetifier=true +org.gradle.jvmargs=-Xmx4608m diff --git a/assets/images/login/101.png b/assets/images/login/101.png new file mode 100644 index 0000000000000000000000000000000000000000..90c1c575a19e47ad913fbe1e2be3f9182be3f826 GIT binary patch literal 3484 zcmaJ^c|4SR`yND=7K&n0#&9&Y*=$)GW`-doWEn|g3?^nVGxjBsu`_w?9eatglr2)^ zt&@q6QlxWoI1^Ju;b17<(K(&>_s6gI`8?0_T|U=!-PiZN@8^#v)ydIjw=_^1008W^ z#bKOCl4+kd@n#Lf344{U(M1(#PWMm9Q7{ZN_`Z^#a9AN~58^I8Ix^RRE+|WeN81(lA z7Di+E`I|UntpAQBT$zIdSuDB<3>F?94h`3X(ij0Sgt4(P432~$k-9>JE;EwKB1Gs? znQGq^FeE0CL8i0FG%9FYk>E=UWtoG8PX9Urh5nB$mHBs?gb9O15a=)j6uy0=??4BK z{|%*3{y{TY&ZPhP{eOj-u90*S%$dZbg))f3!uhLhhoYOH86*OW#&D(4g1=|cDUimZ zF#~CI5E{LmwPPTNJDKW73ukJ6<2X2&*ixA+0+mRz#h8PIDo`@n&&1dYX@D@s9>XH7 zjv)|OV@m_Hv85r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pZ4|glVH=2b(?+#`$R*ZC&0t;C9^W zdD@S74Y|7-Y5;OLV1&wwNPA`2q%Yq&{Ao^4$vM2;W2LH0OzQck{F4#lG1n_8r*7XF zm`@vUS3M)?R@{b)DB6;T1xM*_Ytr1`Z^5!?$J=FvY;=pWw4FI~dF&yr$wD!#B=i7m zelh*n>7Rq~AOUJpbVZTQaL+;2{NeL4B9ngBv$OBzO<9fcvI+gq=O5hSk!r%cdJmi# zgC7B)ZE>p}No?jGy7`dr;l>WQ@h!nMkJ3-11pEe2$hDa2==ms;a%Z#8;zMQ1_^han z{=rCD$+yD@TU25lMA`ZM=xyxJ>xv4+>T&B9#s;DoaOe6xr&BE#VF{I10{ArN=BI&{ zPX>tc*2rwKnX{JPqHmWv@o;2Yp!(XW^bz3I?HdT(^kU4Uc)3D|`OLF~bFXsm?WwCu zn#=&rEaXZ2sQ$>jmH38lvuT&T)s|W~3v|K^#;U++bGl6am1%By0g7yBeg_j;EmNTT zI9VA~Xx2>;9xOzs&eg^qIeTULg{_v!WSUr($H{wP5Qh?M_;dLs&1*F=qHoq@ms}%C zmQH91Qk*T^yr2j})lCisb@N`eZbKS9Lcb^{{tOZU51=bxuQ5&_~ zm@dpD44DI`=By?PTvrr$Jd``49mE|AZ@rNvGv4U-(*_x14c+p^(j_J3VeWwaS|i3J zZfcJDyA?3dk(AgGU8t0DFc#VoYLqzhBx<;EJ6q|7L8=#py7J{Z!`AY8T8pCA>MFkF zOX64L&@|fIe)?3QY ZIgsNVRcpaEn4PP#nej=?ebiaz{{cCP0nY#c literal 0 HcmV?d00001 diff --git a/assets/images/login/103.png b/assets/images/login/103.png new file mode 100644 index 0000000000000000000000000000000000000000..3326814bc80e6682a73f4a36f62f4cbd5b15f36d GIT binary patch literal 2377 zcmaJ@cT`hZ9)1bvMh9FeHrhNAR9qlU2qYMRkkBNE5Rj2(Ade72ib;?FYQV7(P{9$g zuF4=55QgT`22>Df!wf3oAO{uO*Fr4%_8{fU!T52S?aRlY}z1+)gO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S+mp4EZ#o*WEPuUT?(DRuuO0TYexZ>P0ul6YpA8A-ySE)mMf&b~% zv@vM3@?K`39mUM*W?N`&@R>UHM^ZNR*jUBGNlwPg{?zeboDT%&s)Li$;`Y50_yvxy z>E==!gQ&SCk0c|eRWt5UryZRp&Z_*g@vZC}lxwFB$Y;#F^>4v-N?vj?q^$4JDR-Z( zOOVvAF1<5~P&=vy7^K5Dj0$rSTp#;rd=62m6SS_Ff=LOt>%^eZLB-mh6|f8Wz8w+R zUc%{{Je~4*ouN);%EiKV%^@KNTHkG_;IXY&Z`DWfd;CczyXsPGc zyVD%+N}8Xgptkwvkq?%pLFGI9d-f00J*_Kd>w`Z~eGgbp8Q5INFHw$dD&%4+%bL^X z0y)!3Co{&FH~t(=)pbm<)Wag-JM!~Q2_P9y6i7Xw3VFkY99pw DG{ouR literal 0 HcmV?d00001 diff --git a/assets/images/login/104.png b/assets/images/login/104.png new file mode 100644 index 0000000000000000000000000000000000000000..ad55ff74ccab0ca8b0e74beefb641f0d55274f09 GIT binary patch literal 4981 zcmaJ_XH-*L)23JHNRtu*QWOXw5E7bn=^#aVClnzGB%yZ+CDH|?N|h!}L{N%=bi}KG zigX19>Agww#e1*!eSduSJ7=BU);!P5o|(PZnnN%$xJgIDMMFeHM5nE#ZhXR6K)(#-R!$lEjE~780@2!S#_s|N$ zAWVV`Or3)~o#8IP8%h9$0J#eSBm(CM2tazFuyO&4z(0BAF2=u>K|sKtA~;V);9o{r z=o?jMgl7C43?Gx$igMSP)WFyv=~525-banlm&qy;*wxFNvIqI4*2^4UTDL( zxXKx;YyPe4Vx|am$Kkx?Kp=mAe+hqx1RCQ80>j~OkfanyN=p1fLL3{2!Z`+rqp$+M z8PpM2XN-q8&I64C{9<%;Li^$rffttkwFRX2KeQ<9-)_2a7%0He8w8e+{I#Xug8KUZ zzbF#U#M}erg7(LX{)y4om(xaJagHcwgtodO@Pb9c!^1^R6D|!^)0C0X zkWz(#!5VNCRj9P4suV;OtO`TOj|+_czw%-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%$S$kXJ~xjEzXr?|Xl^v&t{9GIZ_Kx(_DCX3YS+ zrpFrh?TPj|kJ9peM;^x!m zoR*0gh`ReE;g;;1f9FNgPjw zaO%n82llP_>>EyDH(vq1F9odC_m3qtamSEqMXdV^SiNrz7%5I47#OJZau~DL|B%8e zJ_!{PVoGyJeaw5ugxLiwn35(*1ZUuhW_3TGdCK9LvExO29sW#i-ODkP5&uB>5gmYt1N zFd}>#9?W9Ox!cUd8JCgReV)URV*QiJB=<582YECs3%tUX$y(YdJNyX9LsM3$L*~?% zJDGDH`o`3N)cqErv4K<8YkX^XFip4)OV)?!>JU&MNcvupePwljwINf(-uPfty!Ew% zxcGjvYgt?IyoC;C=lgQuXnmgvY$SvxIdvfT_7P5t)Fyr-SvIe)eNs(iqvhU}GvA(+ zLp1hWU(1%!o#gU^oltE8l)+<&y-Qp$(zn=uP%Gp+s|;a@rKO~Cy4Uf6^JD)T(G$g;sQ!-2+S;oBx+!fmJoww)i z{BJ3!08rSD_+1~qe@PYhTn<1B(oA;YeXKx98z);7AK1)b2~`TOz1x0o@O=n@ylq-> zl$BvhrkzCfGhv~UE3fQxL*T?`%~q=9!zb^)-h{*&e^aiy+7t{=Na8ENH%=p7yd|k| zEllh6Fw<=1!#AZ%K1@bM9Nrpvb)PuN5s7XHaARt2EeMywGw7CehV$7!!ZJC*DZZK| zyp6rO`*JX}qQLHq^Ym0hFUfsFB+{{de}L%>w(T>0!Y6#bEfQJ3V36YhYstSIoVOhn zw)yo5GJL$;dYK(>--?X@pE68iYudxQioD$~tCti6X@KSsQ5mguEPg;Q6ex7i=a~sW zdU|Qb4$?w57GxnoXnC}EmIUzvk7)&1`l*Z*BdxBVLaXgnWtvG{#!(={5KQWy)!+Y= ggC1nd;Ut%c4vU;dXpup4zkY;iYZ$24syf{L4`*Tdl>h($ literal 0 HcmV?d00001 diff --git a/assets/images/login/fileNum.png b/assets/images/login/fileNum.png new file mode 100644 index 0000000000000000000000000000000000000000..386299b71c8891a99fa03ee33616a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AX(zG{Q6U zQu51-HNkp(eXTt6ic1pnl2bihY?Xkf=w)W6SeY0Z8=JbAy1E)!8XFqAT3Q-g8aNv} zS~xj6IXPNdy213iEv!_1oxXPkT zDaO(tEs6~a3{4IK42}vM4GID*9%_$1)!wgt7akkI`KiVyDk5-(+Q}Vj>v(qCN_INU zcx&GFFMb-c(Bec%j}L6Sdsbx@+*rR{WlQv?4kKpGIFCp+HMNgUDi%6jgJ$rOxZilDsn=b#%Wm_aNYgar+ zlMc6o00)x-2MePBOA`afrKc9VT4(#HY0mWv))C|0a(QV`XVK0%|0K+0LSJ3Yn)>Va z)f>yhR)%C06l|!D6+6!tdL*G@+Nvw_9nw73hAqx8S>nY15*%(~o`_+S%#lHoW?}Yf4peUS8j`=g%`UGFB}8Jb(WD%<@4Zj& zRyLa1BgSHGZa&LHt>*UEjhi<=-j#p-`t@5!juhR!2W(`sxLGo1LCrWwdYF)gf(SYWlV6OyrcwDXu#-tSl`r8gF2m zJ$v>%mY?hH?91$B&s&%GS|?HbM&ABin+%?;{{8OVyRSO}G%g%G*!XyVadmaK*IjNs zef`q!TefXmc3t@S^XDtBgeD{=HeS1aJu@NUz}4S(_wgGZVSl{q@ynMlV|gA)-N z+xd4)*s9bsx4R$`m^&sE9N1n}>8@;liX}T-_f6W9WY65>4=2->UhlhlHT3@Nw$qyw zCwko2XJ=;CCb3AUzrSBVh2sqC!kLQ~E3b)*t;^jX&3dhO0Os)=Qv18 z1m!&tt4451Ut&O;y^e?6;{`nJHO*c2NmK0aKGi;^eB-8~j+`N%RJ{INlX=XQAGRmR gbDjS5c|Q{mgUjL{4U(<*w}a|aPgg&ebxsLQ02Xi>SO5S3 literal 0 HcmV?d00001 diff --git a/assets/images/login/id.png b/assets/images/login/id.png new file mode 100644 index 0000000000000000000000000000000000000000..9260cf11180d8e60b98b933e0fc6841698ddac67 GIT binary patch literal 1308 zcmeAS@N?(olHy`uVBq!ia0vp^k|4~%1|*NXY)uAnN?apKg7ec#$`gxH85~pclTsBt za}(23gHjVyDhp4h+AuIMt7V2nltlRYSS9D@>Lr5I=vCwv0Ch7k*w|MTBqnF4mMA2p zrf25aD!t#mUr8Y|#a1cY)Yrhbz&SM|)1#^=HMq(zB)KX(*)m1R-cG@$!U||WZfZ%Q zLPc&)Ua?h$trFN=Dz9|8 z>y;bpKhp88yV>WRp=I1=9MH?=;jqG!%T2VElw`VEGWs$&r<-In3$Ab zT4JjNbScCOxdm`z^NOLt1Pn0!io^naLp=kKmtYEgeeo;J&4sHjE(uCSxEHIz#UYgi zsro^w#rdU0$-sz9QwCX8VC7ttnpl!w6q28x0}I7~jQo=P;*9(P1!reas97jzglFcZ z12bv3duGcJdP9C8bQHoK%2WtOF;xE1B+DuBIhm5JLe z&N$73>P^Az78jg)^?{Dj2SqMYWW$7jDG0=bCtV;1p7>MqfGNHRn6zK^f9z&pVC?a9 zaSW-rmGtNTe|zS&jKa*a46!O=R0koXr7Mcj2q1a^w}S&Whkv=Oj0#rwr5&dwIEf#U`A^ar%?vmqXdoJf*s$P zK2~c;OIz?A(JuHYHeGd6MvdeOM+I+@3r`%Tydo{-?$a-u^su}u!CQO zH{uF6b91k>M2ddL*`6kcJN-wdGdxmK5MzDh?ocDoUdOjZqc_6as4;@ocMVrZWy6e_ z0ngOTc3j!ev60bmh04@pf-wpoxFurFdvprtG)T^Bxms|do}DdR`NAUUDG^Lwp-Wk= zG(1`}N5cCX!$!HNn!U|xi2*AW+LtHH@zU5)vEYl4#xb^E9hzYi&NM|A$wnP(=$h#1 z@TYysCT$KJp00i_>zopr04ad7(EtDd literal 0 HcmV?d00001 diff --git a/assets/images/login/more_icon.png b/assets/images/login/more_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..b696d345a329b1fc4d647bf3802be648ecea8b66 GIT binary patch literal 488 zcmVP)XtjE*#J+IBZn#6oSKE^a6??=qm0McP_G#2%;2L zYonbQQ-x{Y4}s8~`ulr-!b?|mQ$F8CidujveT@UXz%y_MTmpx{u^#)TQt2`6aH=X? zK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zwR{n2}wKl zhOSsUsi%6egVXWw(UTQkx6B6-G%UXuRdk0dsP&5tiVp6N8j89bxNYU98`=p49( zG(DZ1>fqWucpcvT`2o@Qno1)DC;`$!mXkD zhvgO+5aQ$m!s9OK!~L>VE|VFRTzH;B`Wd8efQcSr> localizedValues = { 'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس" }, + "more-verify": { + "en": "More Verification Options", + "ar": "المزيد من خيارات التحقق" + }, + "welcome-back": {"en": "Welcome back!", "ar": "مرحبا بعودتك!"}, + "account-info": { + "en": "Would you like to login with current username?", + "ar": "هل ترغب في تسجيل الدخول باسم المستخدم الحالي؟" + }, + "another-acc": {"en": "Use Another Account", "ar": "استخدم حسابا آخر"}, + "verify-login-with": { + "en": "Please choose one of the following options to verify", + "ar": "الرجاء اختيار احدى الخيارات التالية للتحقق من البيانات" + }, + "register-user": {"en": "Register", "ar": "تسجيل"}, + "verify-with-fingerprint": {"en": "Fingerprint", "ar": "بصمة"}, + "verify-with-faceid": {"en": "Face ID", "ar": "معرف الوجه"}, + "verify-with-sms": {"en": "SMS", "ar": "الرسائل القصيرة"}, + "verify-with-whatsapp": {"en": "Whatsapp", "ar": " الواتس اب"}, + "last-login": {"en": "LAST LOGIN AT:", "ar": "آخر تسجيل دخول"}, + "last-login-with": {"en": "VERIFICATION TYPE:", "ar": "نوع التحقق:"}, + "verify-fingerprint": { + "en": + "To activate the fingerprint login service, please verify data by using one of the following options.", + "ar": + "لتفعيل خدمة الدخول بالبصمة، يرجى اختيار احدى القنوات التالية للتحقق من البيانات" + }, + "verification_message": { + "en": "Please enter the Verification Code sent to", + "ar": "الرجاء ادخال رمز التحقق الذي تم إرساله إلى" + }, + "validation_message": { + "en": "The verification code expires in", + "ar": "تنتهي صلاحية رمز التحقق خلال" + }, }; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index e483c7d1..1520207f 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -10,3 +10,5 @@ final DOCTOR_PROFILE = 'doctorProfile'; final LIVE_CARE_PATIENT = 'livecare-patient-profile'; final LOGGED_IN_USER = 'loggedUser'; final DASHBOARD_DATA = 'dashboard-data'; +final OTP_TYPE = 'otp-type'; +final LAST_LOGIN_USER = 'last-login-user'; diff --git a/lib/core/model/imei_details.dart b/lib/core/model/imei_details.dart new file mode 100644 index 00000000..2cb0cd97 --- /dev/null +++ b/lib/core/model/imei_details.dart @@ -0,0 +1,88 @@ +class GetIMEIDetailsModel { + String iMEI; + int logInTypeID; + bool outSA; + String mobile; + String identificationNo; + int doctorID; + String doctorName; + String doctorNameN; + int clinicID; + String clinicDescription; + String clnicDescriptionN; + String projectName; + String genderDescription; + String genderDescriptionN; + String titleDescription; + String titleDescriptionN; + bool biometricEnabled; + int preferredLanguage; + bool isActive; + + GetIMEIDetailsModel( + {this.iMEI, + this.logInTypeID, + this.outSA, + this.mobile, + this.identificationNo, + this.doctorID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clnicDescriptionN, + this.projectName, + this.genderDescription, + this.genderDescriptionN, + this.titleDescription, + this.titleDescriptionN, + this.biometricEnabled, + this.preferredLanguage, + this.isActive}); + + GetIMEIDetailsModel.fromJson(Map json) { + iMEI = json['IMEI']; + logInTypeID = json['LogInTypeID']; + outSA = json['OutSA']; + mobile = json['Mobile']; + identificationNo = json['IdentificationNo']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clnicDescriptionN = json['ClnicDescriptionN']; + projectName = json['ProjectName']; + genderDescription = json['Gender_Description']; + genderDescriptionN = json['Gender_DescriptionN']; + titleDescription = json['Title_Description']; + titleDescriptionN = json['Title_DescriptionN']; + biometricEnabled = json['BiometricEnabled']; + preferredLanguage = json['PreferredLanguage']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['IMEI'] = this.iMEI; + data['LogInTypeID'] = this.logInTypeID; + data['OutSA'] = this.outSA; + data['Mobile'] = this.mobile; + data['IdentificationNo'] = this.identificationNo; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClnicDescriptionN'] = this.clnicDescriptionN; + data['ProjectName'] = this.projectName; + data['Gender_Description'] = this.genderDescription; + data['Gender_DescriptionN'] = this.genderDescriptionN; + data['Title_Description'] = this.titleDescription; + data['Title_DescriptionN'] = this.titleDescriptionN; + data['BiometricEnabled'] = this.biometricEnabled; + data['PreferredLanguage'] = this.preferredLanguage; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/core/model/insert_imei_model.dart b/lib/core/model/insert_imei_model.dart new file mode 100644 index 00000000..c2285d92 --- /dev/null +++ b/lib/core/model/insert_imei_model.dart @@ -0,0 +1,92 @@ +class InsertIMEIDetailsModel { + String iMEI; + int logInTypeID; + bool outSA; + String mobileNo; + String identificationNo; + int doctorID; + String doctorName; + String doctorNameN; + int clinicID; + String clinicDescription; + String clinicDescriptionN; + String projectName; + int projectID; + String genderDescription; + String genderDescriptionN; + String titleDescription; + String titleDescriptionN; + bool bioMetricEnabled; + int preferredLanguage; + bool isActive; + + InsertIMEIDetailsModel( + {this.iMEI, + this.logInTypeID, + this.outSA, + this.mobileNo, + this.identificationNo, + this.doctorID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.projectName, + this.projectID, + this.genderDescription, + this.genderDescriptionN, + this.titleDescription, + this.titleDescriptionN, + this.bioMetricEnabled, + this.preferredLanguage, + this.isActive}); + + InsertIMEIDetailsModel.fromJson(Map json) { + iMEI = json['IMEI']; + logInTypeID = json['LogInTypeID']; + outSA = json['OutSA']; + mobileNo = json['MobileNo']; + identificationNo = json['IdentificationNo']; + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + projectName = json['ProjectName']; + projectID = json['ProjectID']; + genderDescription = json['GenderDescription']; + genderDescriptionN = json['GenderDescriptionN']; + titleDescription = json['TitleDescription']; + titleDescriptionN = json['TitleDescriptionN']; + bioMetricEnabled = json['BioMetricEnabled']; + preferredLanguage = json['PreferredLanguage']; + isActive = json['IsActive']; + } + + Map toJson() { + final Map data = new Map(); + data['IMEI'] = this.iMEI; + data['LogInTypeID'] = this.logInTypeID; + data['OutSA'] = this.outSA; + data['MobileNo'] = this.mobileNo; + data['IdentificationNo'] = this.identificationNo; + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ProjectName'] = this.projectName; + data['ProjectID'] = this.projectID; + data['GenderDescription'] = this.genderDescription; + data['GenderDescriptionN'] = this.genderDescriptionN; + data['TitleDescription'] = this.titleDescription; + data['TitleDescriptionN'] = this.titleDescriptionN; + data['BioMetricEnabled'] = this.bioMetricEnabled; + data['PreferredLanguage'] = this.preferredLanguage; + data['IsActive'] = this.isActive; + return data; + } +} diff --git a/lib/core/service/auth_service.dart b/lib/core/service/auth_service.dart new file mode 100644 index 00000000..e116ccdd --- /dev/null +++ b/lib/core/service/auth_service.dart @@ -0,0 +1,29 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; + +class AuthService extends BaseService { + List _imeiDetails = []; + List get dashboardItemsList => _imeiDetails; + + Future selectDeviceImei(imei) async { + try { + // dynamic localRes; + await baseAppClient.post(SELECT_DEVICE_IMEI, + onSuccess: (dynamic response, int statusCode) { + _imeiDetails = []; + response['List_DoctorDeviceDetails'].forEach((v) { + _imeiDetails.add(GetIMEIDetailsModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: {"IMEI": imei, "TokenID": "@dm!n"}); + //return Future.value(localRes); + } catch (error) { + hasError = true; + super.error = error; + } + } +} diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index df23172f..f205dab1 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -14,7 +14,6 @@ class MedicineService extends BaseService { PharmaciesItemsRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); - Future getMedicineItem(String itemName) async { _itemsRequestModel.pHRItemName = itemName; await baseAppClient.post( diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 47ffe730..00089ef9 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -1,4 +1,10 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'package:doctor_app_flutter/core/model/insert_imei_model.dart'; +import 'package:doctor_app_flutter/core/service/auth_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; @@ -12,8 +18,9 @@ import '../../models/doctor/user_model.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } -class AuthViewModel with ChangeNotifier { +class AuthViewModel extends BaseViewModel { List doctorsClinicList = []; + String selectedClinicName; bool isLogin = false; bool isLoading = true; @@ -71,35 +78,29 @@ class AuthViewModel with ChangeNotifier { } } - Future insertDeviceImei(imei) async { - try { - dynamic localRes; - - await baseAppClient.post(INSERT_DEVICE_IMEI, - onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: imei); - return Future.value(localRes); - } catch (error) { - print(error); - throw error; - } - } + Future insertDeviceImei(request) async { + var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); + + request['IMEI'] = DEVICE_TOKEN; + request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); + request['BioMetricEnabled'] = true; + request['MobileNo'] = loggedIn['MobileNumber']; + InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request); + nRequest.genderDescription = request['Gender_Description']; + nRequest.genderDescriptionN = request['Gender_DescriptionN']; + nRequest.genderDescriptionN = request['Gender_DescriptionN']; + nRequest.titleDescription = request['Title_Description']; + nRequest.titleDescriptionN = request['Title_DescriptionN']; + nRequest.projectID = await sharedPref.getInt(PROJECT_ID); - Future selectDeviceImei(imei) async { try { - dynamic localRes; - await baseAppClient.post(SELECT_DEVICE_IMEI, + var localRes; + await baseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: imei); + }, onFailure: (String error, int statusCode) {}, body: nRequest.toJson()); return Future.value(localRes); } catch (error) { - print(error); throw error; } } @@ -120,7 +121,8 @@ class AuthViewModel with ChangeNotifier { } } - Future sendActivationCodeForDoctorApp(ActivationCodeModel activationCodeModel) async { + Future sendActivationCodeForDoctorApp( + ActivationCodeModel activationCodeModel) async { try { var localRes; await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_DOCTOR_APP, @@ -158,22 +160,22 @@ class AuthViewModel with ChangeNotifier { } } - - Future checkActivationCodeForDoctorApp(CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { + Future checkActivationCodeForDoctorApp( + CheckActivationCodeRequestModel checkActivationCodeRequestModel) async { try { dynamic localRes; await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_DOCTOR_APP, onSuccess: (dynamic response, int statusCode) { - localRes = response; - selectedClinicName = - ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; - - response['List_DoctorsClinic'].forEach((v) { - doctorsClinicList.add(new ClinicModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - throw error; - }, body: checkActivationCodeRequestModel.toJson()); + localRes = response; + selectedClinicName = + ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; + + response['List_DoctorsClinic'].forEach((v) { + doctorsClinicList.add(new ClinicModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: checkActivationCodeRequestModel.toJson()); return Future.value(localRes); } catch (error) { print(error); diff --git a/lib/core/viewModel/imei_view_model.dart b/lib/core/viewModel/imei_view_model.dart new file mode 100644 index 00000000..29253b1d --- /dev/null +++ b/lib/core/viewModel/imei_view_model.dart @@ -0,0 +1,21 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'package:doctor_app_flutter/core/service/auth_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/locator.dart'; + +class IMEIViewModel extends BaseViewModel { + AuthService _authService = locator(); + List get imeiDetails => _authService.dashboardItemsList; + + Future selectDeviceImei(imei) async { + setState(ViewState.Busy); + await _authService.selectDeviceImei(imei); + if (_authService.hasError) { + error = _authService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } +} diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index 1448fb47..aed67d83 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -24,6 +24,7 @@ class ProjectViewModel with ChangeNotifier { List doctorClinicsList = []; bool isLoading = false; bool isError = false; + bool isLogin = false; String error = ''; BaseAppClient baseAppClient = BaseAppClient(); @@ -56,7 +57,9 @@ class ProjectViewModel with ChangeNotifier { currentLanguage = await sharedPref.getString(APP_Language); _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null - ? currentLanguage == 'ar' ? true : false + ? currentLanguage == 'ar' + ? true + : false : false; notifyListeners(); } @@ -69,7 +72,7 @@ class ProjectViewModel with ChangeNotifier { sharedPref.setString(APP_Language, 'ar'); } else if (lan != "ar" && currentLanguage != lan) { _appLocale = Locale("en"); - _isArabic = false; + _isArabic = false; currentLanguage = 'en'; sharedPref.setString(APP_Language, 'en'); } diff --git a/lib/locator.dart b/lib/locator.dart index a4ca7289..f939effc 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -1,10 +1,13 @@ +import 'package:doctor_app_flutter/core/service/auth_service.dart'; import 'package:doctor_app_flutter/core/service/dasboard_service.dart'; import 'package:doctor_app_flutter/core/service/medical_file_service.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/service/sickleave_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; @@ -54,9 +57,11 @@ void setupLocator() { locator.registerLazySingleton(() => MedicalFileService()); locator.registerLazySingleton(() => AdmissionRequestService()); locator.registerLazySingleton(() => UcafService()); + locator.registerLazySingleton(() => AuthService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); + locator.registerFactory(() => IMEIViewModel()); locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ReferralPatientViewModel()); locator.registerFactory(() => ReferredPatientViewModel()); diff --git a/lib/main.dart b/lib/main.dart index 3df44a70..1283da1e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -41,32 +41,31 @@ class MyApp extends StatelessWidget { ), ], child: Consumer( - builder: (context,projectProvider,child) => MaterialApp( - showSemanticsDebugger: false, - title: 'Flutter Demo', - locale: projectProvider.appLocal, - localizationsDelegates: [ - TranslationBaseDelegate(), - GlobalMaterialLocalizations.delegate, - GlobalWidgetsLocalizations.delegate, - ], - supportedLocales: [ - const Locale('ar', ''), // Arabic - const Locale('en', ''), // English - ], - theme: ThemeData( - primarySwatch: Colors.grey, - primaryColor: Colors.grey, - buttonColor: HexColor('#B8382C'), - fontFamily: 'WorkSans', - dividerColor: Colors.grey[350], - backgroundColor: Color.fromRGBO(255,255,255, 1), - ), - initialRoute: INIT_ROUTE, - routes: routes, - debugShowCheckedModeBanner: false, - ) - ), + builder: (context, projectProvider, child) => MaterialApp( + showSemanticsDebugger: false, + title: 'Flutter Demo', + locale: projectProvider.appLocal, + localizationsDelegates: [ + TranslationBaseDelegate(), + GlobalMaterialLocalizations.delegate, + GlobalWidgetsLocalizations.delegate, + ], + supportedLocales: [ + const Locale('ar', ''), // Arabic + const Locale('en', ''), // English + ], + theme: ThemeData( + primarySwatch: Colors.grey, + primaryColor: Colors.grey, + buttonColor: HexColor('#B8382C'), + fontFamily: 'WorkSans', + dividerColor: Colors.grey[350], + backgroundColor: Color.fromRGBO(255, 255, 255, 1), + ), + initialRoute: INIT_ROUTE, + routes: routes, + debugShowCheckedModeBanner: false, + )), ); }); }, diff --git a/lib/models/auth/activation_Code_req_model.dart b/lib/models/auth/activation_Code_req_model.dart index f8f48cd8..1a9510e8 100644 --- a/lib/models/auth/activation_Code_req_model.dart +++ b/lib/models/auth/activation_Code_req_model.dart @@ -8,17 +8,18 @@ class ActivationCodeModel { String password; int facilityId; String generalid; - + String otpSendType; ActivationCodeModel( {this.mobileNumber, - this.zipCode, - this.channel, - this.languageID, - this.versionID, - this.memberID, - this.password, - this.facilityId, - this.generalid}); + this.zipCode, + this.channel, + this.languageID, + this.versionID, + this.memberID, + this.password, + this.facilityId, + this.otpSendType, + this.generalid}); ActivationCodeModel.fromJson(Map json) { mobileNumber = json['MobileNumber']; @@ -29,6 +30,7 @@ class ActivationCodeModel { memberID = json['MemberID']; password = json['Password']; facilityId = json['facilityId']; + otpSendType = json['OTP_SendType']; generalid = json['generalid']; } @@ -42,6 +44,7 @@ class ActivationCodeModel { data['MemberID'] = this.memberID; data['Password'] = this.password; data['facilityId'] = this.facilityId; + data['OTP_SendType'] = otpSendType; data['generalid'] = this.generalid; return data; } diff --git a/lib/models/auth/check_activation_code_request_model.dart b/lib/models/auth/check_activation_code_request_model.dart index 856f1c43..9bb3d4f6 100644 --- a/lib/models/auth/check_activation_code_request_model.dart +++ b/lib/models/auth/check_activation_code_request_model.dart @@ -12,21 +12,22 @@ class CheckActivationCodeRequestModel { String activationCode; String vidaAuthTokenID; String vidaRefreshTokenID; - + int oTPSendType; CheckActivationCodeRequestModel( {this.mobileNumber, - this.zipCode, - this.doctorID, - this.iPAdress, - this.channel, - this.languageID, - this.projectID, - this.versionID, - this.generalid, - this.logInTokenID, - this.activationCode, - this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + this.zipCode, + this.doctorID, + this.iPAdress, + this.channel, + this.languageID, + this.projectID, + this.versionID, + this.generalid, + this.logInTokenID, + this.activationCode, + this.vidaAuthTokenID, + this.vidaRefreshTokenID, + this.oTPSendType}); CheckActivationCodeRequestModel.fromJson(Map json) { mobileNumber = json['MobileNumber']; @@ -42,6 +43,7 @@ class CheckActivationCodeRequestModel { activationCode = json['activationCode']; vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; + oTPSendType = json['OTP_SendType']; } Map toJson() { @@ -59,6 +61,7 @@ class CheckActivationCodeRequestModel { data['activationCode'] = this.activationCode; data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + data['OTP_SendType'] = this.oTPSendType; return data; } } diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 5b495abb..1ed441e4 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -1,7 +1,17 @@ import 'dart:async'; +import 'dart:io'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/service/auth_service.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; import '../../lookups/auth_lookup.dart'; @@ -23,21 +33,48 @@ class _LoginsreenState extends State { Future _prefs = SharedPreferences.getInstance(); String platformImei; - Future platformImeiFuture; - - bool _isLoading = false; - - Future getSharedPref() async { - sharedPref.getString('platformImei').then((imei) { - platformImei = imei; - }); - } - + // Future platformImeiFuture; + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); + bool _isLoading = true; + ProjectViewModel projectViewModel; + AuthService authService = AuthService(); @override void initState() { super.initState(); - platformImeiFuture = _prefs.then((SharedPreferences prefs) { - return (prefs.getString('platformImei')); + + _firebaseMessaging.setAutoInitEnabled(true); + if (Platform.isIOS) { + _firebaseMessaging.requestNotificationPermissions(); + } + + _firebaseMessaging.getToken().then((String token) async { + if (DEVICE_TOKEN == "" && projectViewModel.isLogin == false) { + DEVICE_TOKEN = token; + changeLoadingStata(true); + authService.selectDeviceImei(DEVICE_TOKEN).then((value) { + print(authService.dashboardItemsList); + + if (authService.dashboardItemsList.length > 0) { + sharedPref.setObj( + LAST_LOGIN_USER, authService.dashboardItemsList[0]); + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => VerificationMethodsScreen( + password: null, + ))); + } else { + changeLoadingStata(false); + } + //changeLoadingStata(false); + }); + } else { + changeLoadingStata(false); + } + + // else if (projectViewModel.isLogin) { + // getNotificationCount(token); + // } + }).catchError((err) { + print(err); }); } @@ -56,54 +93,46 @@ class _LoginsreenState extends State { @override Widget build(BuildContext context) { - getSharedPref(); - return AppScaffold( - isLoading: _isLoading, - isShowAppBar: false, - body: SafeArea( - child: ListView(children: [ - FutureBuilder( - future: platformImeiFuture, - builder: (BuildContext context, AsyncSnapshot snapshot) { - switch (snapshot.connectionState) { - case ConnectionState.waiting: - return DrAppCircularProgressIndeicator(); - default: - if (snapshot.hasError) { - return Text('Error: ${snapshot.error}'); - } else { - return Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), - alignment: Alignment.topLeft, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - (platformImei == null) - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.knownUser), - LoginForm( - changeLoadingStata: - changeLoadingStata, - ), - ], - ) - : Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AuthHeader(loginType.unknownUser), - KnownUserLogin(), - ], + projectViewModel = Provider.of(context); + + return BaseView( + onModelReady: (model) => {}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SafeArea( + child: (_isLoading == false) + ? ListView(children: [ + Container( + margin: + EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), + alignment: Alignment.topLeft, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AuthHeader(loginType.knownUser), + LoginForm( + changeLoadingStata: changeLoadingStata, ), - ])); - } - } - }), - ]), - ), - ); + ], + ) + + // : Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // AuthHeader(loginType.unknownUser), + // KnownUserLogin(), + // ], + // ), + ])) + ]) + : Center(child: CircularProgressIndicator()), + ), + )); } } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 2b411dc0..0045f032 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -42,7 +42,7 @@ class _VerificationMethodsScreenState extends State { Widget build(BuildContext context) { return AppScaffold( isLoading: _isLoading, - isShowAppBar: false, + isShowAppBar: false, body: ListView(children: [ Container( margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 20f22382..adc912d6 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; @@ -58,6 +59,14 @@ class _DashboardScreenState extends State { if (_isInit) { projectsProvider = Provider.of(context); projectsProvider.getDoctorClinicsList(); + + if (DEVICE_TOKEN != '') { + var request = await sharedPref.getObj(DOCTOR_PROFILE); + authProvider.insertDeviceImei(request).then((value) { + print(value['ReturnValue']); + changeIsLoading(false); + }); + } } _isInit = false; } diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 6f3299d1..5d546c04 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -792,7 +792,7 @@ class _RescheduleLeaveScreen extends State { "doctorId": this.profile['DoctorID'], "dateTimeFrom": fromDate, "dateTimeTo": toDate, - "date": df.format(DateTime.now()), + "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, @@ -846,7 +846,7 @@ class _RescheduleLeaveScreen extends State { "doctorId": this.profile['DoctorID'], "dateTimeFrom": fromDate, "dateTimeTo": toDate, - "date": df.format(DateTime.now()), + "date": offTime == '1' ? fromDate : df.format(DateTime.now()), "reasonId": reason == null ? model.allOffTime[0]['code'] : reason, "coveringDoctorId": doctorID == null ? model.coveringDoctors[0]['doctorID'] : doctorID, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 9a398949..a7229ca2 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -346,15 +346,17 @@ class Helpers { } logout() async { + DEVICE_TOKEN = ""; String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); Navigator.of(AppGlobal.CONTEX).pushReplacementNamed(LOGIN); + // TODO Fix it // Navigator.of(AppGlobal.CONTEX).popUntil((ModalRoute.withName(LOGIN))); } - String parseHtmlString(String htmlString) { + String parseHtmlString(String htmlString) { final document = parse(htmlString); final String parsedString = parse(document.body.text).documentElement.text; @@ -380,11 +382,11 @@ class Helpers { hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: dropDownColor != null ? dropDownColor : Colors.black, - ) + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: dropDownColor != null ? dropDownColor : Colors.black, + ) : null, hintStyle: TextStyle( fontSize: 14, @@ -394,7 +396,8 @@ class Helpers { } static BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor, {double borderWidth = -1}) { + Color containerColor, Color borderColor, + {double borderWidth = -1}) { return BoxDecoration( color: containerColor, shape: BoxShape.rectangle, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b167b48e..600b5f33 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -544,15 +544,60 @@ class TranslationBase { localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; String get id => localizedValues['id'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode]; String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + + String get moreVerification => + localizedValues['more-verify'][locale.languageCode]; + + String get welcomeBack => + localizedValues['welcome-back'][locale.languageCode]; + + String get accountInfo => + localizedValues['account-info'][locale.languageCode]; + + String get useAnotherAccount => + localizedValues['another-acc'][locale.languageCode]; + + String get verifyLoginWith => + localizedValues['verify-login-with'][locale.languageCode]; + + String get register => localizedValues['register-user'][locale.languageCode]; + + String get verifyFingerprint => + localizedValues['verify-with-fingerprint'][locale.languageCode]; + + String get verifyFaceID => + localizedValues['verify-with-faceid'][locale.languageCode]; + + String get verifySMS => + localizedValues['verify-with-sms'][locale.languageCode]; + + String get verifyWhatsApp => + localizedValues['verify-with-whatsapp'][locale.languageCode]; + + String get lastLoginAt => localizedValues['last-login'][locale.languageCode]; + + String get lastLoginWith => + localizedValues['last-login-with'][locale.languageCode]; + + String get verifyFingerprint2 => + localizedValues['verify-fingerprint'][locale.languageCode]; + String get verificationMessage => + localizedValues['verification_message'][locale.languageCode]; + String get validationMessage => + localizedValues['validation_message'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/known_user_login.dart b/lib/widgets/auth/known_user_login.dart index 4df37d66..b181aed8 100644 --- a/lib/widgets/auth/known_user_login.dart +++ b/lib/widgets/auth/known_user_login.dart @@ -70,8 +70,8 @@ class _KnownUserLoginState extends State { @override Widget build(BuildContext context) { AuthViewModel authProv = Provider.of(context); - var imeiModel = {'IMEI': _platformImei}; - _loginTypeFuture = authProv.selectDeviceImei(imeiModel); + // var imeiModel = {'IMEI': _platformImei}; + // _loginTypeFuture = authProv.selectDeviceImei(imeiModel); return FutureBuilder( future: Future.wait([_loggedUserFuture, _loginTypeFuture]), builder: (BuildContext context, AsyncSnapshot snapshot) { diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 808b1763..3aac5cdd 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -224,26 +224,29 @@ class _LoginFormState extends State { } login(context, AuthViewModel authProv, Function changeLoadingStata) { - FocusScopeNode currentFocus = FocusScope.of(context); - changeLoadingStata(true); + showLoading(); if (loginFormKey.currentState.validate()) { loginFormKey.currentState.save(); sharedPref.setInt(PROJECT_ID, userInfo.projectID); authProv.login(userInfo).then((res) { - changeLoadingStata(false); - + //changeLoadingStata(false); + hideLoading(); if (res['MessageStatus'] == 1) { // insertDeviceImei(res, authProv); saveObjToString(LOGGED_IN_USER, res); + sharedPref.remove(LAST_LOGIN_USER); sharedPref.setString(TOKEN, res['LogInTokenID']); print("token" + res['LogInTokenID']); - Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => VerificationMethodsScreen( + password: userInfo.password, + ))); } else { // handel error helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { - print('$err'); + hideLoading(); changeLoadingStata(false); helpers.showErrorToast(err); }); @@ -273,7 +276,11 @@ class _LoginFormState extends State { if (res['MessageStatus'] == 1) { setSharedPref('platformImei', _platformImei); saveObjToString(LOGGED_IN_USER, preRes); - Navigator.of(context).pushReplacement(MaterialPageRoute(builder: (BuildContext context) => VerificationMethodsScreen(password: userInfo.password,))); + + Navigator.of(context).pushReplacement(MaterialPageRoute( + builder: (BuildContext context) => VerificationMethodsScreen( + password: userInfo.password, + ))); // save imei on shared preferance } else { @@ -350,4 +357,18 @@ class _LoginFormState extends State { primaryFocus.unfocus(); } + + showLoading() { + showDialog( + context: context, + builder: (BuildContext context) { + return Center( + child: CircularProgressIndicator(), + ); + }); + } + + hideLoading() { + Navigator.pop(context); + } } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 32c541a3..0de81fdf 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -1,11 +1,22 @@ import 'dart:io' show Platform; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/model/imei_details.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; -import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; +import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; +import 'package:flutter/services.dart'; +import 'package:intl/intl.dart'; +import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; @@ -40,6 +51,17 @@ class _VerificationMethodsState extends State { Future _loggedUserFuture; var _loggedUser; var verificationMethod; + GetIMEIDetailsModel user; + final LocalAuthentication auth = LocalAuthentication(); + var _availableBiometrics; + ProjectViewModel projectsProvider; + var isMoreOption = false; + var onlySMSBox = false; + static BuildContext _context; + var loginTokenID; + + bool authenticated; + @override void initState() { super.initState(); @@ -50,6 +72,13 @@ class _VerificationMethodsState extends State { sharedPref.getObj(LOGGED_IN_USER).then((userInfo) { _loggedUser = userInfo; }); + sharedPref.getObj(LAST_LOGIN_USER).then((lastLogin) { + if (lastLogin != null) { + user = GetIMEIDetailsModel.fromJson(lastLogin); + } + }); + + print(user); } @override @@ -63,6 +92,7 @@ class _VerificationMethodsState extends State { @override Widget build(BuildContext context) { AuthViewModel authProv = Provider.of(context); + projectsProvider = Provider.of(context); return FutureBuilder( future: Future.wait([_loggedUserFuture]), builder: (BuildContext context, AsyncSnapshot snapshot) { @@ -75,66 +105,205 @@ class _VerificationMethodsState extends State { return Text('Error: ${snapshot.error}'); } else { return Container( - width: SizeConfig.realScreenWidth * 0.80, + width: SizeConfig.realScreenWidth, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - hideSilentMethods() - ? TranslationBase.of(context).firstStep - : TranslationBase.of(context).pleaseChoose, - style: TextStyle( - fontSize: 3.5 * SizeConfig.textMultiplier, - ), - ), - SizedBox( - height: 20, - ), Container( - height: SizeConfig.realScreenHeight * 0.6, - child: CustomScrollView( - primary: false, - slivers: [ - SliverPadding( - padding: const EdgeInsets.all(0), - sliver: SliverGrid.count( - // childAspectRatio: 0.7, - crossAxisSpacing: 0, - mainAxisSpacing: 5, - crossAxisCount: 2, - children: [ - Visibility( - visible: hideSilentMethods() ? false : true, - child: buildFingerprintMethod( - context, authProv), - replacement: - buildWhatsAppMethod(context, authProv), - ), - Visibility( - visible: hideSilentMethods() ? false : true, - child: buildFaceIDMethod(context, authProv), - replacement: - buildSMSMethod(context, authProv), - ), - Visibility( - visible: - hideSilentMethods() ? false : true, - child: buildWhatsAppMethod( - context, authProv)), - Visibility( - visible: hideSilentMethods() ? false : true, - child: buildSMSMethod(context, authProv), - ), - ], - ), - ), - ], - ), - // height: 500, - ), - SizedBox( - // height: 20, - ) + height: SizeConfig.realScreenHeight * 0.6, + child: Column( + children: [ + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .welcomeBack + + ' ' + + user.doctorName, + fontSize: + SizeConfig.textMultiplier * 3.5, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context) + .accountInfo, + fontSize: + SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 20, + ), + Card( + color: Colors.grey[300], + child: Row( + children: [ + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context) + .lastLoginAt, + textAlign: TextAlign.center, + overflow: + TextOverflow.ellipsis, + ), + subtitle: Text( + // user. != null + // ? formatDate(Helpers + // .convertStringToDate( + // user + // .)) + // : user != + // null + // ? formatDate(Helpers + // .convertStringToDate(user + // .createdOn)) + //: + '--', + overflow: + TextOverflow.ellipsis, + textAlign: + TextAlign.center), + )), + Flexible( + child: ListTile( + title: Text( + TranslationBase.of( + context) + .lastLoginWith, + overflow: + TextOverflow.ellipsis, + textAlign: + TextAlign.center), + subtitle: Text( + getType(user.logInTypeID, + context), + overflow: + TextOverflow.ellipsis, + textAlign: + TextAlign.center), + )) + ], + )), + ], + ) + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + this.onlySMSBox == false + ? AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: SizeConfig + .textMultiplier * + 3.5, + textAlign: TextAlign.left, + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: SizeConfig + .textMultiplier * + 2.5, + textAlign: TextAlign.start, + ), + ]), + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: InkWell( + onTap: () => { + authenticateUser( + 3, + BiometricType + .face + .index, + authProv) + }, + child: getButton( + user.logInTypeID, + authProv))), + Expanded( + child: + getButton(5, authProv)) + ]) + ]) + : Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: getButton( + 3, authProv)), + Expanded( + child: getButton( + 2, authProv)) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: + getButton(1, authProv)), + Expanded( + child: getButton(4, authProv)) + ], + ), + ]), + Expanded( + flex: 1, + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + user != null + ? Row( + children: [ + Expanded( + child: Button( + title: + TranslationBase.of(context) + .useAnotherAccount, + onTap: () { + Navigator.of(context) + .pushNamed(LOGIN); + }, + )), + ], + ) + : SizedBox(), + ], + ), + ) + ], + )) ], ), ); @@ -143,119 +312,6 @@ class _VerificationMethodsState extends State { }); } - /* - *@author: Elham Rababah - *@Date:28/5/2020 - *@param: BuildContext context, AuthProvider authProv - *@return: Center widget - *@desc: buildSMSMethod Methods widget - */ - Center buildSMSMethod(BuildContext context, AuthViewModel authProv) { - return buildVerificationMethod( - context, - 'assets/images/verification_sms_icon.png', - TranslationBase.of(context).sms, () { - sendActivationCodeByOtpNotificationType(1, authProv); - }); - } - - /* - *@author: Elham Rababah - *@Date:28/5/2020 - *@param: BuildContext context, AuthProvider authProv - *@return: Center widget - *@desc: build WhatsApp Methods widget - */ - Center buildWhatsAppMethod(BuildContext context, AuthViewModel authProv) { - return buildVerificationMethod( - context, - 'assets/images/verification_whatsapp_icon.png', - TranslationBase.of(context).whatsApp, () { - sendActivationCodeByOtpNotificationType(2, authProv); - }); - } - -/* - *@author: Elham Rababah - *@Date:28/5/2020 - *@param: BuildContext context, AuthProvider authProv - *@return: Center widget - *@desc: build FaceID Methods widget - */ - Center buildFaceIDMethod(BuildContext context, AuthViewModel authProv) { - return buildVerificationMethod( - context, - 'assets/images/verification_faceid_icon.png', - TranslationBase.of(context).faceId, () { - sendActivationCodeByOtpNotificationType(3, authProv); - }); - } - -/* - *@author: Elham Rababah - *@Date:28/5/2020 - *@param: BuildContext context, AuthProvider authProv - *@return: Center widget - *@desc: build Fingerprint Methods widget - */ - Center buildFingerprintMethod(BuildContext context, AuthViewModel authProv) { - return buildVerificationMethod( - context, - 'assets/images/verification_fingerprint_icon.png', - TranslationBase.of(context).fingerprint, () { - sendActivationCodeByOtpNotificationType(4, authProv); - }); - } - - /* - *@author: Elham Rababah - *@Date:28/5/2020 - *@param: BuildContext context, AuthProvider authProv - *@return: Center widget - *@desc: build Verification Methods widget - */ - Center buildVerificationMethod(context, url, dec, Function fun) { - return Center( - child: InkWell( - onTap: fun, - child: Container( - // height: SizeConfig.heightMultiplier *2, - height: SizeConfig.heightMultiplier * 19, - width: SizeConfig.widthMultiplier * 37, - - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 1, - color: HexColor( - '#CCCCCC') // <--- border width here - ), - borderRadius: BorderRadius.all(Radius.circular(10))), - child: Column( - children: [ - Container( - margin: EdgeInsetsDirectional.only( - top: SizeConfig.heightMultiplier * 0.5), - child: Image.asset( - url, - height: SizeConfig.heightMultiplier * 10, - fit: BoxFit.cover, - ), - ), - SizedBox( - height: 10, - ), - Text( - dec, - style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), - ) - ], - ), - ), - ), - ); - } - bool hideSilentMethods() { return verificationMethod == 4 || verificationMethod == 3 ? true : false; } @@ -267,64 +323,473 @@ class _VerificationMethodsState extends State { *@return: *@desc: send Activation Code By Otp Notification Type */ - sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) async { + sendActivationCodeByOtpNotificationType( + oTPSendType, AuthViewModel authProv) async { // TODO : build enum for verfication method if (oTPSendType == 1 || oTPSendType == 2) { widget.changeLoadingStata(true); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( + // facilityId: projectID != null ? projectID : 15, //user.projectID, + // generalid: "Cs2020@2016\$2958", + // memberID: _loggedUser != null + // ? _loggedUser['List_MemberInformation'][0]['MemberID'] + // : user.doctorID, + // zipCode: _loggedUser != null + // ? _loggedUser['ZipCode'] + // : user.outSA == true + // ? '966' + // : '971', + // mobileNumber: + // _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile, facilityId: projectID, generalid: "Cs2020@2016\$2958", memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], - + otpSendType: oTPSendType.toString(), password: widget.password); - Map model = { - - "OTP_SendType": oTPSendType - }; - try { authProv .sendActivationCodeForDoctorApp(activationCodeModel) .then((res) { - widget.changeLoadingStata(false); - - if (res['MessageStatus'] == 1) { - print("VerificationCode : "+ res["VerificationCode"]); - sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); - sharedPref.setString(VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); - sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); - Navigator.of(context).pushReplacementNamed(VERIFY_ACCOUNT, - arguments: {'model': model}); - } else { - print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); - } - }) - .catchError((err) { + widget.changeLoadingStata(false); + + if (res['MessageStatus'] == 1) { + print("VerificationCode : " + res["VerificationCode"]); + sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); + sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); + sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); + this.startSMSService(oTPSendType, authProv); + } else { + print(res['ErrorEndUserMessage']); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { print('$err'); widget.changeLoadingStata(false); helpers.showErrorToast(); }); } catch (e) {} - - } else { // TODO route to this page with parameters to inicate we should present 2 option if (Platform.isAndroid && oTPSendType == 3) { helpers.showErrorToast('Your device not support this feature'); } else { - Navigator.of(context).push(MaterialPageRoute( - builder: (BuildContext context) => - VerificationMethodsScreen(password: widget.password,))); + // Navigator.of(context).push(MaterialPageRoute( + // builder: (BuildContext context) => + // VerificationMethodsScreen(password: widget.password,))); // Navigator.of(context).pushNamed(VERIFICATION_METHODS, // arguments: {'verificationMethod': oTPSendType}); } } } + + Widget getButton(flag, authProv) { + switch (flag) { + case 2: + return InkWell( + onTap: () => {authenticateUser(2, true, authProv)}, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(30, 15, 30, 15), + child: Column( + children: [ + Image.asset( + 'assets/images/login/104.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyWhatsApp, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + break; + case 1: + return InkWell( + onTap: () => {authenticateUser(1, true, authProv)}, + child: RoundedContainer( + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/login/103.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + projectsProvider.isArabic + ? SizedBox( + height: 20, + ) + : SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifySMS, + fontSize: projectsProvider.isArabic + ? SizeConfig.textMultiplier * 1.8 + : SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + break; + case 3: + return InkWell( + onTap: () => { + authenticateUser(3, BiometricType.fingerprint.index, authProv) + }, + child: RoundedContainer( + backgroundColor: BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + children: [ + Image.asset( + 'assets/images/login/102.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyFingerprint, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + break; + case 4: + return InkWell( + onTap: () => + {authenticateUser(4, BiometricType.face.index, authProv)}, + child: RoundedContainer( + backgroundColor: checkIfBiometricAvailable(BiometricType.face) + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 15, 5, 15), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/login/101.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).verifyFaceID, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + break; + + default: + return InkWell( + onTap: () => { + setState(() { + isMoreOption = true; + }) + }, + child: RoundedContainer( + backgroundColor: BiometricType.fingerprint.index == 1 + ? Colors.white + : Colors.white.withOpacity(.7), + borderColor: Colors.grey, + showBorder: true, + child: Padding( + padding: EdgeInsets.fromLTRB(5, 0, 5, 5), + child: Column( + children: [ + Image.asset( + 'assets/images/login/more_icon.png', + height: SizeConfig.imageSizeMultiplier * 13, + width: SizeConfig.imageSizeMultiplier * 16, + ), + projectsProvider.isArabic + ? SizedBox( + height: 15, + ) + : SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).moreVerification, + fontSize: SizeConfig.textMultiplier * 2, + textAlign: TextAlign.center, + ) + ], + ), + ))); + } + } + + getType(type, context) { + switch (type) { + case 1: + return TranslationBase.of(context).verifySMS; + break; + case 3: + return TranslationBase.of(context).verifyFingerprint; + break; + case 4: + return TranslationBase.of(context).verifyFaceID; + break; + case 2: + return TranslationBase.of(context).verifyWhatsApp; + break; + default: + return TranslationBase.of(context).verifySMS; + break; + } + } + + bool checkIfBiometricAvailable(BiometricType biometricType) { + bool isAvailable = false; + if (_availableBiometrics != null) { + for (var i = 0; i < _availableBiometrics.length; i++) { + if (biometricType == _availableBiometrics[i]) isAvailable = true; + } + } + return isAvailable; + } + + formatDate(date) { + return DateFormat('MMM dd, yyy, kk:mm').format(date); + } + + authenticateUser(type, isActive, authProv) { + //GifLoaderDialogUtils.showMyDialog(context); + // if (type == 2 || type == 3) { + // fingrePrintBefore = type; + // } + //this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; + + switch (type) { + case 1: + this.loginWithSMS(1, isActive, authProv); + break; + case 2: + this.loginWithSMS(2, isActive, authProv); + + break; + case 3: + this.loginWithFingurePrintFace(3, isActive, authProv); + break; + case 4: + this.loginWithFingurePrintFace(4, isActive, authProv); + break; + default: + break; + } + // sharedPref.setInt(LAST_LOGIN, + // this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); + } + + loginWithSMS(type, isActive, authProv) { + this.sendActivationCode(type, authProv); + // //if (!el.disabled) { + // if (this.user != null) { + // this.checkUserAuthentication(type); + // } else { + // // if (this.loginTokenID != null) { + // this.sendActivationCode(type, authProv); + // // } else { + // //this.checkUserAuthentication(type); + // // } + // } + } + + // checkUserAuthentication(type) { + // // showLoader(true); + // // var req = getCommonRequest(type: type); + // // req.logInTokenID = ""; + + // // var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); + + // // sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); + // // authService + // // .checkPatientAuthentication(request) + // // .then((value) => { + // // GifLoaderDialogUtils.hideDialog(context), + // // if (value['isSMSSent']) + // // { + // // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), + // // this.loginTokenID = value['LogInTokenID'], + // // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), + // // // Future.delayed(Duration(seconds: 1), () { + // // this.sendActivationCode(type) + // // // }) + // // } + // // else + // // { + // // if (value['IsAuthenticated']) {this.checkActivationCode()} + // // } + // // }) + // // .catchError((err) { + // // print(err); + // // GifLoaderDialogUtils.hideDialog(context); + // // }); + // } + Future _getAvailableBiometrics() async { + var availableBiometrics; + try { + availableBiometrics = await auth.getAvailableBiometrics(); + } on PlatformException catch (e) { + print(e); + } + if (!mounted) return; + + setState(() { + _availableBiometrics = availableBiometrics; + }); + } + + sendActivationCode(type, authProv) async { + sendActivationCodeByOtpNotificationType(type, authProv); + } + + startSMSService(type, authProv) { + sharedPref.setInt(OTP_TYPE, type); + new SMSOTP( + context, + type, + _loggedUser['MobileNumber'], + (value) { + showDialog( + context: context, + builder: (BuildContext context) { + return Center( + child: CircularProgressIndicator(), + ); + }); + + this.checkActivationCode(authProv, value: value); + }, + () => { + Navigator.pop(context), + print('Faild..'), + }, + ).displayDialog(context); + } + + loginWithFingurePrintFace(type, isActive, authProv) async { + if (isActive == 1) { + // this.startBiometricLoginIfAvailable(); + authenticated = await auth.authenticateWithBiometrics( + localizedReason: 'Scan your fingerprint to authenticate', + useErrorDialogs: true, + stickyAuth: true); + if (user.logInTypeID == 1 || user.logInTypeID == 2) { + this.onlySMSBox = true; + } else { + this.checkActivationCode(authProv); + } + + // if (authenticated == true) { + // if (user != null && (user.logInTypeID == 4 || user.logInTypeID == 3)) { + // //this.checkActivationCode(); + // } else { + // // var request = this.getCommonRequest(type: type); + // // this.getMobileInfo(request); + // } + // } + } + } + + checkActivationCode(AuthViewModel authProv, {value}) async { + CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = + new CheckActivationCodeRequestModel( + zipCode: _loggedUser['ZipCode'], + mobileNumber: _loggedUser['MobileNumber'], + projectID: await sharedPref.getInt(PROJECT_ID), + logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), + activationCode: value, + oTPSendType: await sharedPref.getInt(OTP_TYPE), + generalid: "Cs2020@2016\$2958"); + + authProv + .checkActivationCodeForDoctorApp(checkActivationCodeForDoctorApp) + .then((res) async { + widget.changeLoadingStata(false); + if (res['MessageStatus'] == 1) { + sharedPref.setString(TOKEN, res['AuthenticationTokenID']); + if (res['List_DoctorProfile'] != null) { + loginProcessCompleted(res['List_DoctorProfile'][0], authProv); + } else { + ClinicModel clinic = + ClinicModel.fromJson(res['List_DoctorsClinic'][0]); + getDocProfiles(clinic, authProv); + } + } else { + //changeLoadingStata(false); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + //changeLoadingStata(false); + helpers.showErrorToast(err); + }); + } + + loginProcessCompleted(Map profile, authProv) { + var doctor = DoctorProfileModel.fromJson(profile); + authProv.setDoctorProfile(doctor); + sharedPref.setObj(DOCTOR_PROFILE, profile); + projectsProvider.isLogin = true; + Navigator.of(context).pushReplacementNamed(HOME); + } + + getDocProfiles(ClinicModel clinicInfo, authProv) { + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: clinicInfo.doctorID, + clinicID: clinicInfo.clinicID, + license: true, + projectID: clinicInfo.projectID, + tokenID: '', + languageID: 2); + authProv.getDocProfiles(docInfo.toJson()).then((res) { + if (res['MessageStatus'] == 1) { + loginProcessCompleted(res['DoctorProfileList'][0], authProv); + } else { + // changeLoadingStata(false); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + // changeLoadingStata(false); + helpers.showErrorToast(err); + }); + } } diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart new file mode 100644 index 00000000..dfcb33cd --- /dev/null +++ b/lib/widgets/otp/sms-popup.dart @@ -0,0 +1,346 @@ +import 'dart:async'; + +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'dart:math'; + +import 'package:provider/provider.dart'; + +class SMSOTP { + final type; + final mobileNo; + final Function onSuccess; + final Function onFailure; + final context; + + int remainingTime = 600; + + Future timer; + + static BuildContext _context; + + static bool _loading; + + SMSOTP( + this.context, + this.type, + this.mobileNo, + this.onSuccess, + this.onFailure, + ); + + final verifyAccountForm = GlobalKey(); + + TextEditingController digit1 = TextEditingController(text: ""); + TextEditingController digit2 = TextEditingController(text: ""); + TextEditingController digit3 = TextEditingController(text: ""); + TextEditingController digit4 = TextEditingController(text: ""); + + Map verifyAccountFormValue = { + 'digit1': '', + 'digit2': '', + 'digit3': '', + 'digit4': '', + }; + final focusD1 = FocusNode(); + final focusD2 = FocusNode(); + final focusD3 = FocusNode(); + final focusD4 = FocusNode(); + String errorMsg; + ProjectViewModel projectProvider; + String displayTime = ''; + + displayDialog(BuildContext context) async { + return showDialog( + context: context, + builder: (context) { + projectProvider = Provider.of(context); + return AlertDialog( + title: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + IconButton( + icon: Icon(Icons.close), + onPressed: () { + Navigator.pop(context); + this.onFailure(); + }, + ) + ], + ), + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0))), + content: StatefulBuilder(builder: (context, setState) { + if (displayTime == '') { + startTimer(setState); + } + return Container( + color: Colors.white, + height: SizeConfig.realScreenHeight * 0.5, + width: SizeConfig.realScreenWidth * 0.8, + child: Center( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + type == 1 + ? Image.asset('assets/images/login/103.png') + : Image.asset('assets/images/login/104.png'), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + TranslationBase.of(context).verificationMessage + + ' XXXXXX' + + mobileNo + .toString() + .substring(mobileNo.toString().length - 3), + textAlign: TextAlign.center, + )), + Form( + key: verifyAccountForm, + child: Padding( + padding: EdgeInsets.only(top: 20), + child: Directionality( + textDirection: TextDirection.ltr, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + textInputAction: TextInputAction.next, + style: buildTextStyle(), + autofocus: true, + maxLength: 1, + controller: digit1, + textAlign: TextAlign.center, + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) {}, + validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD2); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD2); + verifyAccountFormValue['digit1'] = + val.trim(); + checkValue(); + } + }, + ), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit2, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD3); + verifyAccountFormValue['digit2'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit), + ), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction.next, + maxLength: 1, + controller: digit3, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) {}, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + FocusScope.of(context) + .requestFocus(focusD4); + verifyAccountFormValue['digit3'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + Container( + width: SizeConfig.realScreenWidth * 0.15, + child: TextFormField( + focusNode: focusD4, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + controller: digit4, + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, + onChanged: (val) { + if (val.length == 1) { + verifyAccountFormValue['digit4'] = + val.trim(); + checkValue(); + } + }, + validator: validateCodeDigit)), + ], + )), + ), + ), + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + TranslationBase.of(context).validationMessage + + ' ' + + displayTime, + color: Colors.red, + textAlign: TextAlign.center, + )) + ], + ))), + ); + }), + ); + }); + } + + TextStyle buildTextStyle() { + return TextStyle( + fontSize: SizeConfig.textMultiplier * 3, + ); + } + + InputDecoration buildInputDecoration(BuildContext context) { + return InputDecoration( + counterText: " ", + // ts/images/password_icon.png + // contentPadding: EdgeInsets.only(top: 20, bottom: 20), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10)), + borderSide: BorderSide(color: Colors.black), + ), + focusedBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).primaryColor), + ), + errorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + focusedErrorBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(10.0)), + borderSide: BorderSide(color: Theme.of(context).errorColor), + ), + ); + } + + String validateCodeDigit(value) { + if (value.isEmpty) { + return ' '; + } else if (value.length == 3) { + print(value); + } else { + return null; + } + } + + checkValue() { + //print(verifyAccountFormValue); + if (verifyAccountForm.currentState.validate()) { + onSuccess(digit1.text.toString() + + digit2.text.toString() + + digit3.text.toString() + + digit4.text.toString()); + } + } + + getSecondsAsDigitalClock(int inputSeconds) { + var sec_num = + int.parse(inputSeconds.toString()); // don't forget the second param + var hours = (sec_num / 3600).floor(); + var minutes = ((sec_num - hours * 3600) / 60).floor(); + var seconds = sec_num - hours * 3600 - minutes * 60; + var minutesString = ""; + var secondsString = ""; + minutesString = + minutes < 10 ? "0" + minutes.toString() : minutes.toString(); + secondsString = + seconds < 10 ? "0" + seconds.toString() : seconds.toString(); + return minutesString + ":" + secondsString; + } + + startTimer(setState) { + this.remainingTime--; + setState(() { + displayTime = this.getSecondsAsDigitalClock(this.remainingTime); + }); + + timer = Future.delayed(Duration(seconds: 1), () { + if (this.remainingTime > 0) { + startTimer(setState); + } else { + Navigator.pop(context); + } + }); + } + + static void showLoadingDialog(BuildContext context, bool _loading) async { + _context = context; + + if (_loading == false) { + Navigator.of(context).pop(); + return; + } + _loading = true; + await showDialog( + context: _context, + barrierDismissible: false, + builder: (BuildContext context) { + return SimpleDialog( + elevation: 0.0, + backgroundColor: Colors.transparent, + children: [ + Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation(Colors.black), + ), + ) + ], + ); + }); + } + + static void hideSMSBox(context) { + Navigator.pop(context); + } +} diff --git a/pubspec.lock b/pubspec.lock index 7f1d8c1d..4d8e049b 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -316,6 +316,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.2.1" + firebase_core: + dependency: transitive + description: + name: firebase_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.3" + firebase_core_platform_interface: + dependency: transitive + description: + name: firebase_core_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + firebase_core_web: + dependency: transitive + description: + name: firebase_core_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1+1" + firebase_messaging: + dependency: "direct main" + description: + name: firebase_messaging + url: "https://pub.dartlang.org" + source: hosted + version: "7.0.3" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 57ed4cbb..e0e4ce33 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,8 @@ dependencies: #Dependency Injection get_it: ^4.0.2 + #firebase + firebase_messaging: ^7.0.0 #Autocomplete TextField autocomplete_textfield: ^1.7.3 @@ -93,7 +95,7 @@ flutter: assets: - assets/images/ - assets/images/dashboard/ - + - assets/images/login/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From 1f2aebde3366698d9629db47ce881a55b0f2d52d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 12 Jan 2021 14:11:51 +0200 Subject: [PATCH 162/421] fix loader in login --- assets/images/progress-loading-red.gif | Bin 0 -> 142880 bytes lib/widgets/shared/app_loader_widget.dart | 16 ++++++- .../shared/loader/gif_loader_container.dart | 43 ++++++++++++++++++ .../loader/gif_loader_dialog_utils.dart | 14 ++++++ pubspec.lock | 7 +++ pubspec.yaml | 2 + 6 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 assets/images/progress-loading-red.gif create mode 100644 lib/widgets/shared/loader/gif_loader_container.dart create mode 100644 lib/widgets/shared/loader/gif_loader_dialog_utils.dart diff --git a/assets/images/progress-loading-red.gif b/assets/images/progress-loading-red.gif new file mode 100644 index 0000000000000000000000000000000000000000..517c3dab1055feb0aac5b16ea0d1dcd886e9bc58 GIT binary patch literal 142880 zcmeEuS6Gu@vu_#+B|rp3K+p(CFF`s220=O)MFhbDDpgA89YXJlpnwR7f)IM|#VEZ; zkd7FN^xi_x;lKC(_Bj{(ITz>ZTzt97`_4PFX4b5kwdTz;zi4Qw%gLKtKoC$e1wc7E zI;w44;}G1jaapBd-&E4xkWx9StUGG_e$?7|keazn&A!elyox~XSUQ~@931!k-17@P zEGXO3H#x}6B`2nB-Fv(j70cJ#gVbY|{!{P*ef%*nve>Du~9|G)~EWsP0nbc(d4 z`CyHOm;51P?TRS*UFs?m_pVpae*A}R6N^n1z0<|zo#*z)oqcPU_|`ZCDEs7fKB-kW z=boGYhK%Ye!PrTD2}Dw-*|_AuNA7zqm@z zb+)^^E+Dgp6x&ZuUl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)kso453;*CF`~3)zVH~2*h+qxM}ARn?R2Gl zC;6xN7NUKg8R^8kF4)vnemlDHFj-0>pAtQ1WNoNSV3QHRJwj>+{#0r!jWo2&&O7!kKD90 z-n|&idw0$1LD4%8j`PVy+=n5duJYVoPn(NDi=M~(HoR{=yv{ukqoj`B*r;I3(17IU zFec;$eD|&PYOXJ=bvuF$KN7II`GsavuTq1t&0Jl8&FEpDmB*T*erWRvpJ7B&SO`kp z?!0g& zy6}C_NTAYcWIWBc&@+8B+hwMCUrCLDm&s<^*3rX8^?Bbpl5U|ej40gIrvgNVqIBQy z%|c!jF2g(8$L|S!(%&2v@Qrgq4Z?yifM5^h_(~?p0U*lB-H0NXSwN@2dgXtQD2B9o zx{}4|9$HMs5V{EDKF^!BI>w;!5bT$97TFn5nGq+h6{SI;f0T1g$GM4n*WL@ z=vHmz9)a$i>KqnJ@2%~qHUo?Ir@~$OX;Bt}uuZZFi zEt{xj7VZG0p?Ck6u~$SwxF#aW>QbTB`=znG{VpbhDQ=&a7B|l=??eE@UdH+Lcmhy1rRLL1p`4W3uo9wDSE=L33{ zmoE^L1g?3zWDjtYkxg9Mr6QS!{OKjv&;k2Y|6hqHa;LcnKO_Xx?{W<5kwOrjyEH|P zVyG&D8c`V8=42+CQ6q|!w#2#2RBA+#i}lO1$<58H`52QO*hY;g+CFCFhjvjTis~kV zd9Ip`4dIf*s~psb0#uWeRmAc1*b}s$=iHM{RjI|hujImxl@HmDkV;29sS$;Z%Wgy= z-1{@4IBfWnrg*hWQ`Ck`Ki#1zHcycM8&Uj&rl1Tb$$USMIxMrs*w1l(eRgHoZhbDy z?b*g6qucok>Ju&d)@=73isje0^^|(ch0m1w8(T0kP}R~KB8|QNEQm}aXX%CXMnjGW tHo$fM8&U9!WgP9a(Rq^8U(0{?Np7dZe { @override Widget build(BuildContext context) { - return Positioned(child: _progressHUD); + return Container( + height: MediaQuery.of(context).size.height, + + child: Stack( + children: [ + Container( + color: Colors.grey.withOpacity(0.6), + ), + Container(child: GifLoaderContainer(), margin: EdgeInsets.only( + bottom: MediaQuery.of(context).size.height * 0.09)) + ], + ), + ); } } diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart new file mode 100644 index 00000000..b7a20339 --- /dev/null +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -0,0 +1,43 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter_gifimage/flutter_gifimage.dart'; + +class GifLoaderContainer extends StatefulWidget { + @override + _GifLoaderContainerState createState() => _GifLoaderContainerState(); +} + +class _GifLoaderContainerState extends State + with TickerProviderStateMixin { + GifController controller1; + + @override + void initState() { + controller1 = GifController(vsync: this); + + WidgetsBinding.instance.addPostFrameCallback((_) { + controller1.repeat( + min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true); + }); + super.initState(); + } + + @override + void dispose() { + controller1.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Center( + //progress-loading.gif + child: Container( + // margin: EdgeInsets.only(bottom: 40), + child: GifImage( + controller: controller1, + image: AssetImage( + "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + )); + } +} \ No newline at end of file diff --git a/lib/widgets/shared/loader/gif_loader_dialog_utils.dart b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart new file mode 100644 index 00000000..9b45bba1 --- /dev/null +++ b/lib/widgets/shared/loader/gif_loader_dialog_utils.dart @@ -0,0 +1,14 @@ +import 'package:flutter/material.dart'; + +import 'gif_loader_container.dart'; + + +class GifLoaderDialogUtils { + static showMyDialog(BuildContext context) { + showDialog(context: context, child: GifLoaderContainer()); + } + + static hideDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} diff --git a/pubspec.lock b/pubspec.lock index 7f1d8c1d..2ad55e08 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -342,6 +342,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.4" + flutter_gifimage: + dependency: "direct main" + description: + name: flutter_gifimage + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" flutter_localizations: dependency: "direct main" description: flutter diff --git a/pubspec.yaml b/pubspec.yaml index 57ed4cbb..2a9f2e73 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,8 @@ dependencies: #Dependency Injection get_it: ^4.0.2 + #GIF image + flutter_gifimage: ^1.0.1 #Autocomplete TextField autocomplete_textfield: ^1.7.3 From 8726653ffbcc6d84a93c224c984f2f1a8d475f9a Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 12 Jan 2021 16:29:26 +0200 Subject: [PATCH 163/421] working on Referral feature --- lib/config/config.dart | 6 + .../patient-doctor-referral-service.dart | 29 + .../viewModel/patient-referral-viewmodel.dart | 20 +- .../referral/refer-patient-screen.dart | 558 +++++++++--------- .../patient-referral-item-widget.dart | 7 +- 5 files changed, 342 insertions(+), 278 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index e6520b1e..743b09ad 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -71,6 +71,12 @@ const CREATE_REFERRAL_PATIENT = const RESPONSE_PENDING_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; +const GET_PATIENT_REFERRAL = + 'Services/DoctorApplication.svc/REST/GetRefferal'; + +const POST_UCAF = + 'Services/DoctorApplication.svc/REST/PostUCAF'; + const GET_DOCTOR_WORKING_HOURS_TABLE = 'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable'; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 7eb8001b..2f18540a 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -18,6 +18,7 @@ class PatientReferralService extends LookupService { List doctorsList = []; List listMyReferredPatientModel = []; List pendingReferralList = []; + List patientReferralList = []; String setupID = "0"; Future getProjectsList() async { @@ -163,6 +164,33 @@ class PatientReferralService extends LookupService { ); } + Future getPatientReferral(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + + await baseAppClient.post( + GET_PATIENT_REFERRAL, + onSuccess: (dynamic response, int statusCode) { + patientReferralList.clear(); + + response['ReferralList']['entityList'].forEach((v) { + PendingReferral item = PendingReferral.fromJson(v); + item.isReferralDoctorSameBranch = + item.targetProjectId == item.sourceProjectId; + patientReferralList.add(item); + }); + }, + onFailure: (String error, int statusCode) { + patientReferralList.clear(); + hasError = true; + super.error = error; + }, + body: body, + ); + } + Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { hasError = false; DoctorProfileModel doctorProfile = await getDoctorProfile(); @@ -221,6 +249,7 @@ class PatientReferralService extends LookupService { CREATE_REFERRAL_PATIENT, onSuccess: (dynamic response, int statusCode) { print(response.toString()); + print("create referral status code = ${statusCode}"); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 028eac0d..a1fc73fb 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -27,9 +27,27 @@ class PatientReferralViewModel extends BaseViewModel { List get pendingReferral => _referralPatientService.pendingReferralList; + List get patientReferral => + _referralPatientService.patientReferralList; + List get patientArrivalList => _referralPatientService.patientArrivalList; + Future getPatientReferral(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _referralPatientService.getPatientReferral(patient); + if (_referralPatientService.hasError) { + error = _referralPatientService.error; + setState(ViewState.Error); + } else { + if(patientReferral.length == 0){ + await getMasterLookup(MasterKeysService.physiotherapyGoals); + } else { + setState(ViewState.Idle); + } + } + } + Future getMasterLookup(MasterKeysService masterKeys) async { setState(ViewState.Busy); await _referralPatientService.getMasterLookup(masterKeys); @@ -37,7 +55,7 @@ class PatientReferralViewModel extends BaseViewModel { error = _referralPatientService.error; setState(ViewState.Error); } else - await getBranches(); + await getBranches(); } Future getBranches() async { diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 62952108..2c5311cc 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -8,6 +8,7 @@ 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/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; @@ -50,16 +51,21 @@ class _PatientMakeReferralScreenState extends State { patient = routeArgs['patient']; referToList = List(); - dynamic sameBranch = {"id": 1, "name": TranslationBase.of(context).sameBranch}; - dynamic otherBranch = {"id": 2, "name": TranslationBase.of(context).otherBranch}; + dynamic sameBranch = { + "id": 1, + "name": TranslationBase.of(context).sameBranch + }; + dynamic otherBranch = { + "id": 2, + "name": TranslationBase.of(context).otherBranch + }; referToList.add(sameBranch); referToList.add(otherBranch); final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => - model.getMasterLookup(MasterKeysService.physiotherapyGoals), + onModelReady: (model) => model.getPatientReferral(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, @@ -86,279 +92,50 @@ class _PatientMakeReferralScreenState extends State { indent: 0, endIndent: 0, ), - Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).referPatient, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - SizedBox( - height: 16, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: referToList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: referToList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _referTo = selectedValue; - _selectedBranch = null; - _selectedClinic = null; - _selectedDoctor = null; - model - .getDoctorBranch() - .then((value) { - _selectedBranch = value; - if (_referTo['id'] == 1) { - model.getClinics( - _selectedBranch['ID']); - } - }); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).referTo, - _referTo != null ? _referTo['name'] : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.branchesList != null && - model.branchesList.length > 0 && - _referTo != null && - _referTo['id'] == 2 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.branchesList, - attributeName: 'Desciption', - attributeValueId: 'ID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedBranch = selectedValue; - _selectedClinic = null; - _selectedDoctor = null; - model.getClinics( - _selectedBranch['ID']); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).branch, - _selectedBranch != null - ? _selectedBranch['Desciption'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: _selectedBranch != null && - model.clinicsList != null && - model.clinicsList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.clinicsList, - attributeName: 'ClinicDescription', - attributeValueId: 'ClinicID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = null; - _selectedClinic = selectedValue; - model.getClinicDoctors( - _selectedClinic['ClinicID'] - .toString()); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).clinic, - _selectedClinic != null - ? _selectedClinic['ClinicDescription'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: _selectedClinic != null && - model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doctor, - _selectedDoctor != null - ? _selectedDoctor['DoctorName'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => _selectDate(context, model), - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .chooseAppointment, - appointmentDate != null - ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).remarks, - null, - false), - enabled: true, - controller: _remarksController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_LETTERS)) - ], - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - ], - ), + model.patientReferral.length == 0 + ? ReferralForm(model, screenSize) + : PatientReferralItemWidget( + patientName: model.patientReferral[0].patientName, + referralStatus: "${model.patientReferral[0].referralStatus}", + isReferredTo: true, + isSameBranch: model.patientReferral[0] + .isReferralDoctorSameBranch, + referralDoctorName: + model.patientReferral[0].referredByDoctorInfo, + clinicDescription: null, + remark: + model.patientReferral[0].remarksFromSource ), ], ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).refer, - color: HexColor("#B8382B"), - onPressed: () { - if (appointmentDate == null || - _selectedBranch == null || - _selectedClinic == null || - _selectedDoctor == null || - _remarksController.text == null) return; - model - .makeReferral( - patient, - appointmentDate.toIso8601String(), - _selectedBranch['ID'], - _selectedClinic['ClinicID'], - _selectedDoctor['DoctorID'], - _remarksController.text) - .then((_) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); - Navigator.pop(context); - }); - }, - ), - ) + if (model.patientReferral.length == 0) + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + color: HexColor("#B8382B"), + onPressed: () { + if (appointmentDate == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null) return; + model + .makeReferral( + patient, + appointmentDate.toIso8601String(), + _selectedBranch['ID'], + _selectedClinic['ClinicID'], + _selectedDoctor['DoctorID'], + _remarksController.text) + .then((_) { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).referralSuccessMsg); + Navigator.pop(context); + }); + }, + ), + ) ], ), ), @@ -367,6 +144,239 @@ class _PatientMakeReferralScreenState extends State { ); } + Widget ReferralForm(PatientReferralViewModel model, Size screenSize) { + return Container( + margin: EdgeInsets.symmetric(vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).referPatient, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: referToList != null + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: referToList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _referTo = selectedValue; + _selectedBranch = null; + _selectedClinic = null; + _selectedDoctor = null; + model.getDoctorBranch().then((value) { + _selectedBranch = value; + if (_referTo['id'] == 1) { + model.getClinics(_selectedBranch['ID']); + } + }); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).referTo, + _referTo != null ? _referTo['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.branchesList != null && + model.branchesList.length > 0 && + _referTo != null && + _referTo['id'] == 2 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.branchesList, + attributeName: 'Desciption', + attributeValueId: 'ID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedBranch = selectedValue; + _selectedClinic = null; + _selectedDoctor = null; + model.getClinics(_selectedBranch['ID']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).branch, + _selectedBranch != null + ? _selectedBranch['Desciption'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedBranch != null && + model.clinicsList != null && + model.clinicsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.clinicsList, + attributeName: 'ClinicDescription', + attributeValueId: 'ClinicID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = null; + _selectedClinic = selectedValue; + model.getClinicDoctors( + _selectedClinic['ClinicID'].toString()); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).clinic, + _selectedClinic != null + ? _selectedClinic['ClinicDescription'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedClinic != null && + model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.doctorsList, + attributeName: 'DoctorName', + attributeValueId: 'DoctorID', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + _selectedDoctor = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doctor, + _selectedDoctor != null + ? _selectedDoctor['DoctorName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => _selectDate(context, model), + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).chooseAppointment, + appointmentDate != null + ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).remarks, null, false), + enabled: true, + controller: _remarksController, + inputFormatters: [ + FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) + ], + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + ], + ), + ); + } + _selectDate(BuildContext context, PatientReferralViewModel model) async { // https://medium.com/flutter-community/a-deep-dive-into-datepicker-in-flutter-37e84f7d8d6c good reference // https://stackoverflow.com/a/63147062/6246772 to customize a date picker diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 662e7fee..17f33793 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -37,7 +37,7 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Center( child: AppText( - patientName, + "${patientName}", color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16, @@ -48,9 +48,10 @@ class PatientReferralItemWidget extends StatelessWidget { color: Color(0xFF4BA821), padding: EdgeInsets.all(4), child: AppText( - referralStatus == "46" + referralStatus + /*referralStatus == "46" ? TranslationBase.of(context).approved - : TranslationBase.of(context).rejected, + : TranslationBase.of(context).rejected*/, color: Colors.white, fontWeight: FontWeight.bold, fontSize: 12, From dd53a9bd4d82097dc6e3106638682eb09d5a2bc5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 13 Jan 2021 01:52:53 +0200 Subject: [PATCH 164/421] post Procedure --- lib/client/base_app_client.dart | 24 +- lib/config/config.dart | 9 +- .../get_ordered_procedure_model.dart | 138 ++++++ .../get_ordered_procedure_request_model.dart | 18 + .../procedure_category_list_model.dart | 48 +++ lib/core/service/prescription_service.dart | 7 +- lib/core/service/procedure_service.dart | 63 ++- lib/core/viewModel/procedure_View_model.dart | 34 +- .../prescription/add_prescription_form.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 393 ++++++++++++------ 10 files changed, 569 insertions(+), 167 deletions(-) create mode 100644 lib/core/model/procedure/get_ordered_procedure_model.dart create mode 100644 lib/core/model/procedure/get_ordered_procedure_request_model.dart create mode 100644 lib/core/model/procedure/procedure_category_list_model.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 6ab902de..e203c142 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -38,22 +38,21 @@ class BaseAppClient { try { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); String token = await sharedPref.getString(TOKEN); - if (profile != null) { + if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); - if (body['DoctorID'] == null) + if (body['DoctorID'] == null) body['DoctorID'] = doctorProfile?.doctorID; - if (body['DoctorID'] == "") - body['DoctorID'] = null; - if( body['EditedBy'] ==null) + if (body['DoctorID'] == "") body['DoctorID'] = null; + if (body['EditedBy'] == null) body['EditedBy'] = doctorProfile?.doctorID; if (body['ProjectID'] == null) { body['ProjectID'] = doctorProfile?.projectID; - } + } if (body['ClinicID'] == null) body['ClinicID'] = doctorProfile?.clinicID; - } + } if (body['DoctorID'] == '') { - body['DoctorID'] =null; + body['DoctorID'] = null; } if (body['EditedBy'] == '') { body.remove("EditedBy"); @@ -73,8 +72,8 @@ class BaseAppClient { body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - body['VidaRefreshTokenID'] = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); - + body['VidaRefreshTokenID'] = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); print("URL : $url"); print("Body : ${json.encode(body)}"); @@ -94,8 +93,7 @@ class BaseAppClient { if (!parsed['IsAuthenticated']) { await helpers.logout(); helpers.showErrorToast('Your session expired Please login agian'); - } else - if (parsed['MessageStatus'] == 1) { + } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); else @@ -130,7 +128,7 @@ class BaseAppClient { } } } - if(error == null || error == "null" || error == "null\n"){ + if (error == null || error == "null" || error == "null\n") { return "This server not work probably in this time"; } return error; diff --git a/lib/config/config.dart b/lib/config/config.dart index 1ac3c517..b07e3341 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -121,7 +121,8 @@ const GET_PRESCRIPTION_LIST = const POST_PRESCRIPTION_LIST = 'Services/DoctorApplication.svc/REST/PostPrescription'; -const GET_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/GetProcedure'; +const GET_PROCEDURE_LIST = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = @@ -160,7 +161,11 @@ const GET_CHIEF_COMPLAINT = const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; + +const GET_LIST_CATEGORISE = + 'Services/DoctorApplication.svc/REST/GetProcedureCategories'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; diff --git a/lib/core/model/procedure/get_ordered_procedure_model.dart b/lib/core/model/procedure/get_ordered_procedure_model.dart new file mode 100644 index 00000000..b7185711 --- /dev/null +++ b/lib/core/model/procedure/get_ordered_procedure_model.dart @@ -0,0 +1,138 @@ +class GetOrderedProcedureModel { + List entityList; + int rowcount; + dynamic statusMessage; + + GetOrderedProcedureModel( + {this.entityList, this.rowcount, this.statusMessage}); + + GetOrderedProcedureModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + String achiCode; + String appointmentDate; + int appointmentNo; + int categoryID; + String clinicDescription; + String cptCode; + int createdBy; + String createdOn; + String doctorName; + bool isApprovalCreated; + bool isApprovalRequired; + bool isCovered; + bool isInvoiced; + bool isReferralInvoiced; + bool isUncoveredByDoctor; + int lineItemNo; + String orderDate; + int orderNo; + int orderType; + String procedureId; + String procedureName; + String remarks; + String status; + String template; + + EntityList( + {this.achiCode, + this.appointmentDate, + this.appointmentNo, + this.categoryID, + this.clinicDescription, + this.cptCode, + this.createdBy, + this.createdOn, + this.doctorName, + this.isApprovalCreated, + this.isApprovalRequired, + this.isCovered, + this.isInvoiced, + this.isReferralInvoiced, + this.isUncoveredByDoctor, + this.lineItemNo, + this.orderDate, + this.orderNo, + this.orderType, + this.procedureId, + this.procedureName, + this.remarks, + this.status, + this.template}); + + EntityList.fromJson(Map json) { + achiCode = json['achiCode']; + appointmentDate = json['appointmentDate']; + appointmentNo = json['appointmentNo']; + categoryID = json['categoryID']; + clinicDescription = json['clinicDescription']; + cptCode = json['cptCode']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + doctorName = json['doctorName']; + isApprovalCreated = json['isApprovalCreated']; + isApprovalRequired = json['isApprovalRequired']; + isCovered = json['isCovered']; + isInvoiced = json['isInvoiced']; + isReferralInvoiced = json['isReferralInvoiced']; + isUncoveredByDoctor = json['isUncoveredByDoctor']; + lineItemNo = json['lineItemNo']; + orderDate = json['orderDate']; + orderNo = json['orderNo']; + orderType = json['orderType']; + procedureId = json['procedureId']; + procedureName = json['procedureName']; + remarks = json['remarks']; + status = json['status']; + template = json['template']; + } + + Map toJson() { + final Map data = new Map(); + data['achiCode'] = this.achiCode; + data['appointmentDate'] = this.appointmentDate; + data['appointmentNo'] = this.appointmentNo; + data['categoryID'] = this.categoryID; + data['clinicDescription'] = this.clinicDescription; + data['cptCode'] = this.cptCode; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['doctorName'] = this.doctorName; + data['isApprovalCreated'] = this.isApprovalCreated; + data['isApprovalRequired'] = this.isApprovalRequired; + data['isCovered'] = this.isCovered; + data['isInvoiced'] = this.isInvoiced; + data['isReferralInvoiced'] = this.isReferralInvoiced; + data['isUncoveredByDoctor'] = this.isUncoveredByDoctor; + data['lineItemNo'] = this.lineItemNo; + data['orderDate'] = this.orderDate; + data['orderNo'] = this.orderNo; + data['orderType'] = this.orderType; + data['procedureId'] = this.procedureId; + data['procedureName'] = this.procedureName; + data['remarks'] = this.remarks; + data['status'] = this.status; + data['template'] = this.template; + return data; + } +} diff --git a/lib/core/model/procedure/get_ordered_procedure_request_model.dart b/lib/core/model/procedure/get_ordered_procedure_request_model.dart new file mode 100644 index 00000000..dfbd444c --- /dev/null +++ b/lib/core/model/procedure/get_ordered_procedure_request_model.dart @@ -0,0 +1,18 @@ +class GetOrderedProcedureRequestModel { + String vidaAuthTokenID; + int patientMRN; + + GetOrderedProcedureRequestModel({this.vidaAuthTokenID, this.patientMRN}); + + GetOrderedProcedureRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientMRN']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + return data; + } +} diff --git a/lib/core/model/procedure/procedure_category_list_model.dart b/lib/core/model/procedure/procedure_category_list_model.dart new file mode 100644 index 00000000..849e84e5 --- /dev/null +++ b/lib/core/model/procedure/procedure_category_list_model.dart @@ -0,0 +1,48 @@ +class ProcedureCategoryListModel { + List entityList; + int rowcount; + dynamic statusMessage; + + ProcedureCategoryListModel( + {this.entityList, this.rowcount, this.statusMessage}); + + ProcedureCategoryListModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + return data; + } +} + +class EntityList { + int categoryId; + String categoryName; + + EntityList({this.categoryId, this.categoryName}); + + EntityList.fromJson(Map json) { + categoryId = json['categoryId']; + categoryName = json['categoryName']; + } + + Map toJson() { + final Map data = new Map(); + data['categoryId'] = this.categoryId; + data['categoryName'] = this.categoryName; + return data; + } +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 25aa98ea..41adcbc0 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -14,12 +14,9 @@ class PrescriptionService extends BaseService { List doctorsList = []; List specialityList = []; - PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( - //patientMRN: 3120877, - - ); + PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( - search: ["Acetaminophen"], + search: ["Amoxicillin"], vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", ); diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 8122f0a7..5836beec 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -1,29 +1,37 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; + import 'package:flutter/foundation.dart'; class ProcedureService extends BaseService { - List _procedureList = List(); - List get procedureList => _procedureList; + List _procedureList = List(); + List get procedureList => _procedureList; List _categoriesList = List(); List get categoriesList => _categoriesList; List procedureslist = List(); + List categoryList = []; + + GetOrderedProcedureRequestModel _getOrderedProcedureRequestModel = + GetOrderedProcedureRequestModel(); GetProcedureReqModel _getProcedureReqModel = GetProcedureReqModel( - clinicId: 17, - pageSize: 10, - pageIndex: 1, - patientMRN: 3120725, - //categoryId: null, - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC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U19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", + // + // search: ["lab"], + ); - search: ["lab"], - ); GetProcedureReqModel _getProcedureCategoriseReqModel = GetProcedureReqModel( clinicId: 0, pageSize: 100, @@ -33,22 +41,45 @@ class ProcedureService extends BaseService { vidaAuthTokenID: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI", - search: ["lab"], + //search: ["DENTAL"], ); - Future getProcedure() async { + Future getProcedure({int mrn}) async { + _getOrderedProcedureRequestModel = + GetOrderedProcedureRequestModel(patientMRN: mrn); hasError = false; _procedureList.clear(); await baseAppClient.post(GET_PROCEDURE_LIST, onSuccess: (dynamic response, int statusCode) { - _procedureList.add(GetProcedureModel.fromJson(response['ProcedureList'])); + _procedureList.add( + GetOrderedProcedureModel.fromJson(response['OrderedProcedureList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _getOrderedProcedureRequestModel.toJson()); + } + + Future getCategory() async { + hasError = false; + + await baseAppClient.post(GET_LIST_CATEGORISE, + onSuccess: (dynamic response, int statusCode) { + categoryList = []; + categoryList = response['listProcedureCategories']['entityList']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _getProcedureReqModel.toJson()); + }, body: Map()); } - Future getCategories() async { + Future getProcedureCategory({String categoryName}) async { + _getProcedureCategoriseReqModel = GetProcedureReqModel( + search: [categoryName], + patientMRN: 0, + pageIndex: 1, + clinicId: 0, + pageSize: 100, + ); hasError = false; _categoriesList.clear(); await baseAppClient.post(GET_CATEGORISE_PROCEDURE, diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index da258e23..5e1d8d0c 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; @@ -9,15 +10,17 @@ import 'package:doctor_app_flutter/locator.dart'; class ProcedureViewModel extends BaseViewModel { bool hasError = false; ProcedureService _procedureService = locator(); - List get procedureList => _procedureService.procedureList; + List get procedureList => + _procedureService.procedureList; List get categoriesList => _procedureService.categoriesList; + List get categoryList => _procedureService.categoryList; - Future getProcedure() async { + Future getProcedure({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getProcedure(); + await _procedureService.getProcedure(mrn: mrn); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -25,11 +28,11 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getCategories() async { + Future getProcedureCategory({String categoryName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.getCategories(); + await _procedureService.getProcedureCategory(categoryName: categoryName); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); @@ -37,7 +40,20 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future postProcedure(PostProcedureReqModel postProcedureReqModel) async { + Future getCategory() async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.getCategory(); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future postProcedure( + PostProcedureReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -46,12 +62,13 @@ class ProcedureViewModel extends BaseViewModel { error = _procedureService.error; setState(ViewState.ErrorLocal); } else { - await getProcedure(); + await getProcedure(mrn: mrn); setState(ViewState.Idle); } } - Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { + Future updateProcedure( + PostProcedureReqModel postProcedureReqModel, int mrn) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); @@ -61,5 +78,6 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); + await getProcedure(mrn: mrn); } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 10b779e6..1b4d7e2d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -300,7 +300,7 @@ class _PrescriptionFormWidgetState extends State { ListSelectDialog dialog = ListSelectDialog( list: model.drugsList, - attributeName: 'GenericName', + attributeName: 'Description', attributeValueId: 'ItemId', okText: TranslationBase.of(context) diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index a6b9791b..60a04480 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -19,6 +19,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; @@ -40,7 +41,7 @@ class _ProcedureScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getProcedure(), + onModelReady: (model) => model.getProcedure(mrn: patient.patientMRN), builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, @@ -122,8 +123,11 @@ class _ProcedureScreenState extends State { children: [ InkWell( onTap: () { - model.getCategories().then((value) { - addSelectedProcedure(context, model); + model + .getProcedureCategory() + .then((value) { + addSelectedProcedure( + context, model, patient); }); //model.postPrescription(); @@ -208,9 +212,11 @@ class _ProcedureScreenState extends State { ), ), onTap: () { - model.getCategories().then((value) { + model + .getProcedureCategory() + .then((value) { addSelectedProcedure( - context, model); + context, model, patient); }); //model.postPrescription(); @@ -299,7 +305,11 @@ class _ProcedureScreenState extends State { 15.0, ), AppText( - 'Urgent', + model.procedureList[0].entityList[index] + .orderType == + 1 + ? 'Regular' + : 'Urgent', fontSize: 13.0, color: Colors @@ -337,18 +347,18 @@ class _ProcedureScreenState extends State { FontWeight .w700, ), - Expanded( - child: AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .price - .toString(), - fontSize: - 13.0), - ) + // Expanded( + // child: AppText( + // model + // .procedureList[ + // 0] + // .entityList[ + // index] + // .price + // .toString(), + // fontSize: + // 13.0), + // ) ], ), SizedBox( @@ -357,10 +367,19 @@ class _ProcedureScreenState extends State { Row( children: [ - AppText( - 'Some short remark about the procedure', - fontSize: - 13.5, + Expanded( + child: + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .remarks + .toString(), + fontSize: + 13.5, + ), ), ], ), @@ -395,7 +414,22 @@ class _ProcedureScreenState extends State { 0] .entityList[ index] - .procedureName); + .procedureName, + patient: + patient, + procedureId: model + .procedureList[ + 0] + .entityList[ + index] + .procedureId, + categoreId: model + .procedureList[ + 0] + .entityList[ + index] + .categoryID + .toString()); }, ) ], @@ -420,26 +454,36 @@ class _ProcedureScreenState extends State { } } -postProcedure({ProcedureViewModel model, String remarks}) async { +postProcedure( + {ProcedureViewModel model, + String remarks, + PatiantInformtion patient, + List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); List controls = List(); List controlsProcedure = List(); - postProcedureReqModel.appointmentNo = 2016054575; + postProcedureReqModel.appointmentNo = patient.appointmentNo; - postProcedureReqModel.episodeID = 200012166; - postProcedureReqModel.patientMRN = 3120725; + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; postProcedureReqModel.vidaAuthTokenID = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; controls.add( - Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'sssssssss'), + Controls( + code: remarks.isEmpty ? 'ssss' : remarks, controlValue: 'sssssssss'), ); - controlsProcedure.add( - Procedures(category: "02", procedure: "02011009", controls: controls)); + + entityList.forEach((element) { + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); postProcedureReqModel.procedures = controlsProcedure; - await model.postProcedure(postProcedureReqModel); + await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); @@ -449,15 +493,19 @@ postProcedure({ProcedureViewModel model, String remarks}) async { } updateProcedure( - {ProcedureViewModel model, String remarks, String procedureId}) async { + {ProcedureViewModel model, + String remarks, + String procedureId, + PatiantInformtion patient, + String categorieId}) async { PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); List controls = List(); List controlsProcedure = List(); - updateProcedureReqModel.appointmentNo = 2016054575; + updateProcedureReqModel.appointmentNo = patient.appointmentNo; - updateProcedureReqModel.episodeID = 200012166; - updateProcedureReqModel.patientMRN = 3120725; + updateProcedureReqModel.episodeID = patient.episodeNo; + updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.vidaAuthTokenID = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; @@ -467,11 +515,11 @@ updateProcedure( controlValue: 'Testing', ), ); - controlsProcedure.add( - Procedures(category: "02", procedure: "02011002", controls: controls)); + controlsProcedure.add(Procedures( + category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedures = controlsProcedure; - await model.updateProcedure(updateProcedureReqModel); + await model.updateProcedure(updateProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); @@ -480,114 +528,176 @@ updateProcedure( } } -void addSelectedProcedure(context, ProcedureViewModel model) { +void addSelectedProcedure( + context, ProcedureViewModel model, PatiantInformtion patient) { showModalBottomSheet( context: context, isScrollControlled: true, builder: (BuildContext bc) { return AddSelectedProcedure( model: model, + patient: patient, ); }); } class AddSelectedProcedure extends StatefulWidget { final ProcedureViewModel model; + final PatiantInformtion patient; - const AddSelectedProcedure({Key key, this.model}) : super(key: key); + const AddSelectedProcedure({Key key, this.model, this.patient}) + : super(key: key); @override - _AddSelectedProcedureState createState() => _AddSelectedProcedureState(); + _AddSelectedProcedureState createState() => + _AddSelectedProcedureState(patient: patient, model: model); } class _AddSelectedProcedureState extends State { + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedProcedureState({this.patient, this.model}); TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); List entityList = List(); + dynamic selectedCategory; @override Widget build(BuildContext context) { - return NetworkBaseView( - baseViewModel: widget.model, - child: SingleChildScrollView( - child: Container( - height: 810, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Select Procedure'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - if (widget.model.categoriesList.length != 0) - EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getCategory(), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + height: 810, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Select Procedure'.toUpperCase(), + fontWeight: FontWeight.w900, ), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order Type'.toUpperCase(), - controller: procedureController, + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + model.categoryList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.categoryList, + attributeName: 'categoryName', + attributeValueId: 'categoryId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + selectedCategory = selectedValue; + model.getProcedureCategory( + categoryName: + selectedCategory['categoryName']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + //model.getProcedureCategory(); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + 'Procedure Categorey', + selectedCategory != null + ? selectedCategory['categoryName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, ), ), - SizedBox( - height: 15.0, - ), - TextFields( - hintText: 'Remarks', - controller: remarksController, - minLines: 3, - maxLines: 5, - ), - SizedBox( - height: 50.0, + ), + if (widget.model.categoriesList.length != 0) + EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'add Selected Procedures'.toUpperCase(), - onPressed: () { - Navigator.pop(context); - postProcedure( - model: widget.model, - remarks: remarksController.text); - }, - ), - ], + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'Order Type'.toUpperCase(), + controller: procedureController, + ), ), - ), - ], - ) - ], + SizedBox( + height: 15.0, + ), + TextFields( + hintText: 'Remarks', + controller: remarksController, + minLines: 3, + maxLines: 5, + ), + SizedBox( + height: 50.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'add Selected Procedures'.toUpperCase(), + onPressed: () { + Navigator.pop(context); + postProcedure( + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), ), ), ), @@ -603,10 +713,46 @@ class _AddSelectedProcedureState extends State { } return false; } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } } -void updateProcedureForm(context, {String procedureName}) { - ProcedureViewModel procedureViewModel = ProcedureViewModel(); +void updateProcedureForm(context, + {String procedureName, + PatiantInformtion patient, + String procedureId, + String categoreId}) { + ProcedureViewModel model = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); showModalBottomSheet( @@ -666,7 +812,10 @@ void updateProcedureForm(context, {String procedureName}) { onPressed: () { Navigator.pop(context); updateProcedure( - model: procedureViewModel, + categorieId: categoreId, + procedureId: procedureId, + patient: patient, + model: model, remarks: remarksController.text); // authorizationForm(context); }, From ad99cebf0245db324f38428b80a6ed772de12cfd Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 14 Jan 2021 16:25:11 +0300 Subject: [PATCH 165/421] login and drug to drug --- lib/client/base_app_client.dart | 11 ++- lib/config/config.dart | 8 +- lib/core/model/imei_details.dart | 56 +++++++++--- lib/core/model/insert_imei_model.dart | 82 +++++++++++++---- .../service/patient-vital-signs-service.dart | 20 ++--- lib/core/service/prescription_service.dart | 22 ++++- lib/core/viewModel/auth_view_model.dart | 22 ++++- .../viewModel/prescription_view_model.dart | 15 ++++ .../auth/send_activation_code_model2.dart | 60 +++++++++++++ lib/screens/dashboard_screen.dart | 37 +++++--- .../prescription/add_prescription_form.dart | 64 ++++++++----- lib/screens/prescription/drugtodrug.dart | 89 +++++++++++++++++++ lib/widgets/auth/verification_methods.dart | 74 ++++++++++++--- 13 files changed, 468 insertions(+), 92 deletions(-) create mode 100644 lib/models/auth/send_activation_code_model2.dart create mode 100644 lib/screens/prescription/drugtodrug.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e203c142..c1438159 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -71,9 +71,14 @@ class BaseAppClient { body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; body['PatientOutSA'] = 0; // PATIENT_OUT_SA; - body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); - body['VidaRefreshTokenID'] = - await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + if (body['VidaAuthTokenID'] == null) { + body['VidaAuthTokenID'] = + await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + } + if (body['VidaRefreshTokenID'] == null) { + body['VidaRefreshTokenID'] = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + } print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/config/config.dart b/lib/config/config.dart index 29ddfed6..1a25afa0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -92,6 +92,8 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = const SEND_ACTIVATION_CODE_FOR_DOCTOR_APP = 'Services/DoctorApplication.svc/REST/SendActivationCodeForDoctorApp'; +const SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN = + 'Services/DoctorApplication.svc/REST/SendVerificationCode'; const MEMBER_CHECK_ACTIVATION_CODE_NEW = 'Services/Sentry.svc/REST/MemberCheckActivationCode_New'; @@ -167,7 +169,8 @@ const GET_CHIEF_COMPLAINT = const GET_PHYSICAL_EXAM = 'Services/DoctorApplication.svc/REST/GetPhysicalExam'; const GET_PROGRESS_NOTE = 'Services/DoctorApplication.svc/REST/GetProgressNote'; const GET_ASSESSMENT = 'Services/DoctorApplication.svc/REST/GetAssessment'; -const GET_ORDER_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; +const GET_ORDER_PROCEDURE = + 'Services/DoctorApplication.svc/REST/GetOrderedProcedure'; const GET_CATEGORISE_PROCEDURE = 'Services/DoctorApplication.svc/REST/GetProcedure'; @@ -175,7 +178,8 @@ const UPDATE_PROCEDURE = 'Services/DoctorApplication.svc/REST/PatchProcedure'; const UPDATE_PRESCRIPTION = 'Services/DoctorApplication.svc/REST/PatchPrescription'; const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; - +const DRUG_TO_DRUG = + 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; var selectedPatientType = 1; diff --git a/lib/core/model/imei_details.dart b/lib/core/model/imei_details.dart index 2cb0cd97..614ce67a 100644 --- a/lib/core/model/imei_details.dart +++ b/lib/core/model/imei_details.dart @@ -1,26 +1,36 @@ class GetIMEIDetailsModel { + int iD; String iMEI; int logInTypeID; bool outSA; String mobile; - String identificationNo; + Null identificationNo; int doctorID; String doctorName; String doctorNameN; int clinicID; String clinicDescription; - String clnicDescriptionN; + Null clinicDescriptionN; + int projectID; String projectName; String genderDescription; - String genderDescriptionN; + Null genderDescriptionN; String titleDescription; - String titleDescriptionN; + Null titleDescriptionN; + Null zipCode; + String createdOn; + Null createdBy; + String editedOn; + int editedBy; bool biometricEnabled; - int preferredLanguage; + Null preferredLanguage; bool isActive; + String vidaAuthTokenID; + String vidaRefreshTokenID; GetIMEIDetailsModel( - {this.iMEI, + {this.iD, + this.iMEI, this.logInTypeID, this.outSA, this.mobile, @@ -30,17 +40,26 @@ class GetIMEIDetailsModel { this.doctorNameN, this.clinicID, this.clinicDescription, - this.clnicDescriptionN, + this.clinicDescriptionN, + this.projectID, this.projectName, this.genderDescription, this.genderDescriptionN, this.titleDescription, this.titleDescriptionN, + this.zipCode, + this.createdOn, + this.createdBy, + this.editedOn, + this.editedBy, this.biometricEnabled, this.preferredLanguage, - this.isActive}); + this.isActive, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); GetIMEIDetailsModel.fromJson(Map json) { + iD = json['ID']; iMEI = json['IMEI']; logInTypeID = json['LogInTypeID']; outSA = json['OutSA']; @@ -51,19 +70,28 @@ class GetIMEIDetailsModel { doctorNameN = json['DoctorNameN']; clinicID = json['ClinicID']; clinicDescription = json['ClinicDescription']; - clnicDescriptionN = json['ClnicDescriptionN']; + clinicDescriptionN = json['ClinicDescriptionN']; + projectID = json['ProjectID']; projectName = json['ProjectName']; genderDescription = json['Gender_Description']; genderDescriptionN = json['Gender_DescriptionN']; titleDescription = json['Title_Description']; titleDescriptionN = json['Title_DescriptionN']; + zipCode = json['ZipCode']; + createdOn = json['CreatedOn']; + createdBy = json['CreatedBy']; + editedOn = json['EditedOn']; + editedBy = json['EditedBy']; biometricEnabled = json['BiometricEnabled']; preferredLanguage = json['PreferredLanguage']; isActive = json['IsActive']; + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; } Map toJson() { final Map data = new Map(); + data['ID'] = this.iD; data['IMEI'] = this.iMEI; data['LogInTypeID'] = this.logInTypeID; data['OutSA'] = this.outSA; @@ -74,15 +102,23 @@ class GetIMEIDetailsModel { data['DoctorNameN'] = this.doctorNameN; data['ClinicID'] = this.clinicID; data['ClinicDescription'] = this.clinicDescription; - data['ClnicDescriptionN'] = this.clnicDescriptionN; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ProjectID'] = this.projectID; data['ProjectName'] = this.projectName; data['Gender_Description'] = this.genderDescription; data['Gender_DescriptionN'] = this.genderDescriptionN; data['Title_Description'] = this.titleDescription; data['Title_DescriptionN'] = this.titleDescriptionN; + data['ZipCode'] = this.zipCode; + data['CreatedOn'] = this.createdOn; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; data['BiometricEnabled'] = this.biometricEnabled; data['PreferredLanguage'] = this.preferredLanguage; data['IsActive'] = this.isActive; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; return data; } } diff --git a/lib/core/model/insert_imei_model.dart b/lib/core/model/insert_imei_model.dart index c2285d92..40668dba 100644 --- a/lib/core/model/insert_imei_model.dart +++ b/lib/core/model/insert_imei_model.dart @@ -1,30 +1,42 @@ class InsertIMEIDetailsModel { String iMEI; int logInTypeID; - bool outSA; - String mobileNo; - String identificationNo; + Null outSA; + Null mobile; + Null identificationNo; int doctorID; String doctorName; String doctorNameN; int clinicID; String clinicDescription; - String clinicDescriptionN; + Null clinicDescriptionN; String projectName; - int projectID; String genderDescription; - String genderDescriptionN; + Null genderDescriptionN; String titleDescription; - String titleDescriptionN; + Null titleDescriptionN; bool bioMetricEnabled; - int preferredLanguage; + Null preferredLanguage; bool isActive; + int editedBy; + int projectID; + String tokenID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String sessionID; + bool isLoginForDoctorApp; + int patientOutSA; + String vidaAuthTokenID; + String vidaRefreshTokenID; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, this.outSA, - this.mobileNo, + this.mobile, this.identificationNo, this.doctorID, this.doctorName, @@ -33,20 +45,32 @@ class InsertIMEIDetailsModel { this.clinicDescription, this.clinicDescriptionN, this.projectName, - this.projectID, this.genderDescription, this.genderDescriptionN, this.titleDescription, this.titleDescriptionN, this.bioMetricEnabled, this.preferredLanguage, - this.isActive}); + this.isActive, + this.editedBy, + this.projectID, + this.tokenID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); InsertIMEIDetailsModel.fromJson(Map json) { iMEI = json['IMEI']; logInTypeID = json['LogInTypeID']; outSA = json['OutSA']; - mobileNo = json['MobileNo']; + mobile = json['Mobile']; identificationNo = json['IdentificationNo']; doctorID = json['DoctorID']; doctorName = json['DoctorName']; @@ -55,14 +79,26 @@ class InsertIMEIDetailsModel { clinicDescription = json['ClinicDescription']; clinicDescriptionN = json['ClinicDescriptionN']; projectName = json['ProjectName']; - projectID = json['ProjectID']; genderDescription = json['GenderDescription']; genderDescriptionN = json['GenderDescriptionN']; titleDescription = json['TitleDescription']; - titleDescriptionN = json['TitleDescriptionN']; + titleDescriptionN = json['Title_DescriptionN']; bioMetricEnabled = json['BioMetricEnabled']; preferredLanguage = json['PreferredLanguage']; isActive = json['IsActive']; + editedBy = json['EditedBy']; + projectID = json['ProjectID']; + tokenID = json['TokenID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; } Map toJson() { @@ -70,7 +106,7 @@ class InsertIMEIDetailsModel { data['IMEI'] = this.iMEI; data['LogInTypeID'] = this.logInTypeID; data['OutSA'] = this.outSA; - data['MobileNo'] = this.mobileNo; + data['Mobile'] = this.mobile; data['IdentificationNo'] = this.identificationNo; data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; @@ -79,14 +115,26 @@ class InsertIMEIDetailsModel { data['ClinicDescription'] = this.clinicDescription; data['ClinicDescriptionN'] = this.clinicDescriptionN; data['ProjectName'] = this.projectName; - data['ProjectID'] = this.projectID; data['GenderDescription'] = this.genderDescription; data['GenderDescriptionN'] = this.genderDescriptionN; data['TitleDescription'] = this.titleDescription; - data['TitleDescriptionN'] = this.titleDescriptionN; + data['Title_DescriptionN'] = this.titleDescriptionN; data['BioMetricEnabled'] = this.bioMetricEnabled; data['PreferredLanguage'] = this.preferredLanguage; data['IsActive'] = this.isActive; + data['EditedBy'] = this.editedBy; + data['ProjectID'] = this.projectID; + data['TokenID'] = this.tokenID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; return data; } } diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 8d0cfc31..a5e3a107 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -5,8 +5,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; -class VitalSignsService extends BaseService{ - +class VitalSignsService extends BaseService { List patientVitalSignList = []; List patientVitalSignOrderdSubList = []; VitalSignData patientVitalSigns; @@ -15,16 +14,17 @@ class VitalSignsService extends BaseService{ patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN; - body['AppointmentNo'] = patient.appointmentNo; - body['EpisodeID'] = patient.episodeNo; - + body['PatientMRN'] = 2954208; //patient.patientMRN; + body['AppointmentNo'] = "2016055308"; //patient.appointmentNo; + body['EpisodeID'] = 210011002; //patient.episodeNo; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, onSuccess: (dynamic response, int statusCode) { - if(response['VitalSignsList'] != null){ - if(response['VitalSignsList']['entityList'] != null && (response['VitalSignsList']['entityList'] as List).length > 0){ - patientVitalSigns = VitalSignData.fromJson(response['VitalSignsList']['entityList'][0]); + if (response['VitalSignsList'] != null) { + if (response['VitalSignsList']['entityList'] != null && + (response['VitalSignsList']['entityList'] as List).length > 0) { + patientVitalSigns = VitalSignData.fromJson( + response['VitalSignsList']['entityList'][0]); } } }, @@ -35,4 +35,4 @@ class VitalSignsService extends BaseService{ body: body, ); } -} \ No newline at end of file +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 25aa98ea..14ae072d 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -5,6 +5,9 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; class PrescriptionService extends BaseService { List _prescriptionList = List(); @@ -13,6 +16,7 @@ class PrescriptionService extends BaseService { List get drugsList => _drugsList; List doctorsList = []; List specialityList = []; + List drugToDrug = []; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel( //patientMRN: 3120877, @@ -20,8 +24,8 @@ class PrescriptionService extends BaseService { ); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( search: ["Acetaminophen"], - vidaAuthTokenID: - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiY2QwOWU3MTEtZDEwYy00NjZhLWEwNDctMjc4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYx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uZpdmHVoLfXDyP6e9mBpuOPSlzuio", ); PostPrescriptionReqModel _postPrescriptionReqModel = @@ -87,4 +91,18 @@ class PrescriptionService extends BaseService { body: updatePrescriptionReqModel.toJson(), ); } + + Future getDrugToDrug( + VitalSignData vital, List allergy) async { + hasError = false; + var request = {}; + await baseAppClient.post(DRUG_TO_DRUG, + onSuccess: (dynamic response, int statusCode) { + drugToDrug = []; + //drugToDrug = //response['MedicationList']['entityList']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _drugRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 00089ef9..960462cd 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; +import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -92,7 +93,9 @@ class AuthViewModel extends BaseViewModel { nRequest.titleDescription = request['Title_Description']; nRequest.titleDescriptionN = request['Title_DescriptionN']; nRequest.projectID = await sharedPref.getInt(PROJECT_ID); - + nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); + nRequest.vidaRefreshTokenID = + await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); try { var localRes; await baseAppClient.post(INSERT_DEVICE_IMEI, @@ -210,4 +213,21 @@ class AuthViewModel extends BaseViewModel { throw error; } } + + Future sendActivationCodeVerificationScreen( + ActivationCodeModel2 activationCodeModel) async { + try { + var localRes; + await baseAppClient.post(SEND_ACTIVATION_CODE_FOR_VERIFICATION_SCREEN, + onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel.toJson()); + return Future.value(localRes); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 3380d8c2..d7b8f409 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -5,6 +5,9 @@ import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; class PrescriptionViewModel extends BaseViewModel { bool hasError = false; @@ -67,4 +70,16 @@ class PrescriptionViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + Future getDrugToDrug( + VitalSignData vital, List allergy) async { + hasError = false; + setState(ViewState.Busy); + await _prescriptionService.getDrugToDrug(vital, allergy); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } } diff --git a/lib/models/auth/send_activation_code_model2.dart b/lib/models/auth/send_activation_code_model2.dart new file mode 100644 index 00000000..794887b3 --- /dev/null +++ b/lib/models/auth/send_activation_code_model2.dart @@ -0,0 +1,60 @@ +class ActivationCodeModel2 { + int oTPSendType; + String mobileNumber; + String zipCode; + int channel; + int languageID; + double versionID; + int memberID; + int facilityId; + String generalid; + int isMobileFingerPrint; + String vidaAuthTokenID; + String vidaRefreshTokenID; + + ActivationCodeModel2( + {this.oTPSendType, + this.mobileNumber, + this.zipCode, + this.channel, + this.languageID, + this.versionID, + this.memberID, + this.facilityId, + this.generalid, + this.isMobileFingerPrint, + this.vidaAuthTokenID, + this.vidaRefreshTokenID}); + + ActivationCodeModel2.fromJson(Map json) { + oTPSendType = json['OTP_SendType']; + mobileNumber = json['MobileNumber']; + zipCode = json['ZipCode']; + channel = json['Channel']; + languageID = json['LanguageID']; + versionID = json['VersionID']; + memberID = json['MemberID']; + facilityId = json['facilityId']; + generalid = json['generalid']; + isMobileFingerPrint = json['IsMobileFingerPrint']; + vidaAuthTokenID = json['VidaAuthTokenID']; + vidaRefreshTokenID = json['VidaRefreshTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['OTP_SendType'] = this.oTPSendType; + data['MobileNumber'] = this.mobileNumber; + data['ZipCode'] = this.zipCode; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['VersionID'] = this.versionID; + data['MemberID'] = this.memberID; + data['facilityId'] = this.facilityId; + data['generalid'] = this.generalid; + data['IsMobileFingerPrint'] = this.isMobileFingerPrint; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + return data; + } +} diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 7b105148..8787eb42 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -20,6 +20,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -48,6 +49,7 @@ class DashboardScreen extends StatefulWidget { } class _DashboardScreenState extends State { + final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); HospitalViewModel hospitalProvider; AuthViewModel authProvider; bool isLoading = false; @@ -62,13 +64,17 @@ class _DashboardScreenState extends State { projectsProvider = Provider.of(context); projectsProvider.getDoctorClinicsList(); - if (DEVICE_TOKEN != '') { - var request = await sharedPref.getObj(DOCTOR_PROFILE); - authProvider.insertDeviceImei(request).then((value) { - print(value['ReturnValue']); - changeIsLoading(false); - }); - } + _firebaseMessaging.setAutoInitEnabled(true); + _firebaseMessaging.getToken().then((String token) async { + if (token != '') { + DEVICE_TOKEN = token; + var request = await sharedPref.getObj(DOCTOR_PROFILE); + authProvider.insertDeviceImei(request).then((value) { + print(value['ReturnValue']); + changeIsLoading(false); + }); + } + }); } _isInit = false; } @@ -96,8 +102,10 @@ class _DashboardScreenState extends State { PatientMobileNumber: "0", PatientIdentificationID: "0", PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), - To: DateUtils.convertDateToFormat(DateTime. now(), 'yyyy-MM-dd').toString(), + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), LanguageID: 2, stamp: "2020-03-02T13:56:39.170Z", IPAdress: "11.11.11.11", @@ -679,7 +687,7 @@ class _DashboardScreenState extends State { AppText( model.dashboardItemsList.length > 0 ? getPatientCount( - model.dashboardItemsList[7]) + model.dashboardItemsList[5]) : "", fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, @@ -723,7 +731,7 @@ class _DashboardScreenState extends State { color: Colors.white, ), AppText( - TranslationBase.of(context).radiology, + TranslationBase.of(context).clinic, color: Colors.white, ) ], @@ -1017,7 +1025,9 @@ class _DashboardScreenState extends State { ); }, ), - SizedBox(width: 8,), + SizedBox( + width: 8, + ), DashboardItem( child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -1035,7 +1045,8 @@ class _DashboardScreenState extends State { ), hasBorder: true, onTap: () { - Navigator.of(context).pushNamed(PATIENTS, arguments: { + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, "selectedType": "7" }); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 10b779e6..afd4136d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.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/screens/prescription/drugtodrug.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -693,7 +694,8 @@ class _PrescriptionFormWidgetState extends State { .addMedication, onPressed: () { formKey.currentState.save(); - + // Navigator.pop(context); + // openDrugToDrug(); if (strength == null || route == null || frequency == null || @@ -708,26 +710,8 @@ class _PrescriptionFormWidgetState extends State { } if (formKey.currentState.validate()) { - postProcedure( - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: - frequency['id'].toString(), - route: route['id'].toString(), - drugId: selectedDrug['ItemId'] - .toString(), - strength: - strength['id'].toString(), - indication: - indicationController.text, - instruction: - instructionController.text, - doseTime: selectedDate); Navigator.pop(context); + openDrugToDrug(); } { // Navigator.push( @@ -804,4 +788,44 @@ class _PrescriptionFormWidgetState extends State { ), ); } + + openDrugToDrug() { + showModalBottomSheet( + context: context, + builder: (context) { + return Container( + height: SizeConfig.realScreenHeight * .5, + width: SizeConfig.realScreenWidth, + child: SingleChildScrollView( + child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + DrugToDrug(widget.patient), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: AppButton( + title: TranslationBase.of(context).addMedication, + onPressed: () { + postProcedure( + patient: widget.patient, + doseTimeIn: doseTime['id'].toString(), + model: widget.model, + duration: duration['id'].toString(), + frequency: frequency['id'].toString(), + route: route['id'].toString(), + drugId: selectedDrug['ItemId'].toString(), + strength: strength['id'].toString(), + indication: indicationController.text, + instruction: instructionController.text, + doseTime: selectedDate); + }, + )) + ], + )), + + //], + //) + ); + }); + } } diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart new file mode 100644 index 00000000..8f51da80 --- /dev/null +++ b/lib/screens/prescription/drugtodrug.dart @@ -0,0 +1,89 @@ +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +class DrugToDrug extends StatefulWidget { + final PatiantInformtion patient; + DrugToDrug(this.patient); + @override + _DrugToDrug createState() => _DrugToDrug(); +} + +class _DrugToDrug extends State { + int typeID = 1; + List> expandableList = [ + {'name': 'CRITICAL'}, + {'name': 'HIGH'}, + {'name': 'MODERATE'}, + {'name': 'LOW'}, + {'name': 'INFO'}, + ]; + + @override + void initState() { + getTypeID(); + super.initState(); + } + + @override + Widget build(BuildContext context) { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: 2954208, //widget.patient.patientMRN, + episodeId: 210011002, //widget.patient.episodeNo, + appointmentNo: 2016055308, //widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); + + return BaseView( + onModelReady: (model) => model.getPatientVitalSign(widget.patient), + builder: (BuildContext context, model, Widget child) { + return BaseView( + onModelReady: (model2) => + model2.getPatientAllergy(generalGetReqForSOAP), + builder: (BuildContext context, model2, Widget child) { + return BaseView( + onModelReady: (model3) => model3.getDrugToDrug( + model.patientVitalSigns, model2.patientAllergiesList), + builder: (BuildContext context, + PrescriptionViewModel model3, Widget child) => + NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .45, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new Text( + expandableList[i]['name'], + style: new TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic), + ), + children: [Text('Hi')], + ); + })))); + }); + }); + } + + getTypeID() async { + var type = await sharedPref.getString(SLECTED_PATIENT_TYPE) == '0' ? 2 : 1; + setState(() { + typeID = type; + }); + } +} diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 0de81fdf..caee190d 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/model/imei_details.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/auth/activation_Code_req_model.dart'; import 'package:doctor_app_flutter/models/auth/check_activation_code_request_model.dart'; +import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; @@ -330,20 +331,7 @@ class _VerificationMethodsState extends State { widget.changeLoadingStata(true); int projectID = await sharedPref.getInt(PROJECT_ID); ActivationCodeModel activationCodeModel = ActivationCodeModel( - // facilityId: projectID != null ? projectID : 15, //user.projectID, - // generalid: "Cs2020@2016\$2958", - // memberID: _loggedUser != null - // ? _loggedUser['List_MemberInformation'][0]['MemberID'] - // : user.doctorID, - // zipCode: _loggedUser != null - // ? _loggedUser['ZipCode'] - // : user.outSA == true - // ? '966' - // : '971', - // mobileNumber: - // _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile, facilityId: projectID, - generalid: "Cs2020@2016\$2958", memberID: _loggedUser['List_MemberInformation'][0]['MemberID'], zipCode: _loggedUser['ZipCode'], mobileNumber: _loggedUser['MobileNumber'], @@ -389,6 +377,60 @@ class _VerificationMethodsState extends State { } } + sendActivationCodeVerificationScreen( + oTPSendType, AuthViewModel authProv) async { + // TODO : build enum for verfication method + if (oTPSendType == 1 || oTPSendType == 2) { + widget.changeLoadingStata(true); + ActivationCodeModel2 activationCodeModel = ActivationCodeModel2( + facilityId: user.projectID, + memberID: user.doctorID, + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: oTPSendType, + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); + + try { + authProv + .sendActivationCodeVerificationScreen(activationCodeModel) + .then((res) { + widget.changeLoadingStata(false); + + if (res['MessageStatus'] == 1) { + print("VerificationCode : " + res["VerificationCode"]); + sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); + sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); + sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); + this.startSMSService(oTPSendType, authProv); + } else { + print(res['ErrorEndUserMessage']); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + print('$err'); + widget.changeLoadingStata(false); + + helpers.showErrorToast(); + }); + } catch (e) {} + } else { + // TODO route to this page with parameters to inicate we should present 2 option + if (Platform.isAndroid && oTPSendType == 3) { + helpers.showErrorToast('Your device not support this feature'); + } else { + // Navigator.of(context).push(MaterialPageRoute( + // builder: (BuildContext context) => + // VerificationMethodsScreen(password: widget.password,))); + + // Navigator.of(context).pushNamed(VERIFICATION_METHODS, + // arguments: {'verificationMethod': oTPSendType}); + } + } + } + Widget getButton(flag, authProv) { switch (flag) { case 2: @@ -679,7 +721,11 @@ class _VerificationMethodsState extends State { } sendActivationCode(type, authProv) async { - sendActivationCodeByOtpNotificationType(type, authProv); + if (user != null) { + sendActivationCodeVerificationScreen(type, authProv); + } else { + sendActivationCodeByOtpNotificationType(type, authProv); + } } startSMSService(type, authProv) { From 8424e92c4b6cc457d8585a562e324730545092ff Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 14 Jan 2021 16:25:00 +0200 Subject: [PATCH 166/421] working on vital Sign feature with Charts --- lib/config/localized_values.dart | 8 + .../patient-vital-sign-viewmodel.dart | 36 -- lib/lookups/patient_lookup.dart | 17 +- .../vital_sign/patient-vital-sign-data.dart | 349 +++++++++----- lib/routes.dart | 2 +- .../profile/vital_sign/LineChartCurved.dart | 217 +++++++++ .../LineChartCurvedBloodPressure.dart | 257 ++++++++++ .../vital_sign/vital-signs-screen.dart | 8 +- ...al_sign_details_blood_pressurewideget.dart | 145 ++++++ .../vital_sign/vital_sign_details_screen.dart | 442 ++++++++---------- .../vital_sign_details_wideget.dart | 121 +++++ .../profile/vital_sign/vital_sign_item.dart | 101 ++-- .../vital_sign_item_details_screen.dart | 196 +++++++- .../vital_sing_chart_and_detials.dart | 51 +- .../vital_sing_chart_blood_pressure.dart | 84 ++++ lib/util/date-utils.dart | 133 ++++++ lib/util/translations_delegate_base.dart | 3 + lib/widgets/charts/app_bar_chart.dart | 43 ++ lib/widgets/charts/app_line_chart.dart | 44 ++ lib/widgets/charts/app_time_series_chart.dart | 71 +++ .../data_display/list/custom_Item.dart | 93 ++++ .../data_display/list/flexible_container.dart | 50 ++ .../profile/profile_medical_info_widget.dart | 3 +- lib/widgets/transitions/fade_page.dart | 32 ++ lib/widgets/transitions/slide_up_page.dart | 43 ++ pubspec.lock | 48 +- pubspec.yaml | 3 + 27 files changed, 2115 insertions(+), 485 deletions(-) create mode 100644 lib/screens/patients/profile/vital_sign/LineChartCurved.dart create mode 100644 lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart create mode 100644 lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart create mode 100644 lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart create mode 100644 lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart create mode 100644 lib/widgets/charts/app_bar_chart.dart create mode 100644 lib/widgets/charts/app_line_chart.dart create mode 100644 lib/widgets/charts/app_time_series_chart.dart create mode 100644 lib/widgets/data_display/list/custom_Item.dart create mode 100644 lib/widgets/data_display/list/flexible_container.dart create mode 100644 lib/widgets/transitions/fade_page.dart create mode 100644 lib/widgets/transitions/slide_up_page.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 030f42cc..9df06621 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -546,4 +546,12 @@ const Map> localizedValues = { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" }, + "systolic-lng": { + "en": "Systolic", + "ar": "الإنقباض" + }, + "diastolic-lng": { + "en": "Diastolic", + "ar": "الإنبساط" + }, }; diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 5674030c..b4a49a86 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -27,42 +27,6 @@ class VitalSignsViewModel extends BaseViewModel { } } - makeVitalSignDemoData(){ - _vitalSignService.patientVitalSigns = VitalSignData( - appointmentNo: 2016053265, - bloodPressureCuffLocation: 0, - bloodPressureCuffSize: 0, - bloodPressureHigher: 38, - bloodPressureLower: 32, - bloodPressurePatientPosition: 1, - bodyMassIndex: 31.11, - fio2: 0, - headCircumCm: 0, - heightCm: 150, - idealBodyWeightLbs: -2, - isPainManagementDone: false, - isVitalsRequired: true, - leanBodyWeightLbs: 0, - painCharacter: null, - painDuration: null, - painFrequency: null, - painLocation: null, - painScore: 0, - patientMRN: 3333274, - patientType: 1, - pulseBeatPerMinute: 0, - pulseRhythm: 0, - respirationBeatPerMinute: 0, - respirationPattern: 0, - sao2: 0, - status: 47, - temperatureCelcius: 40, - temperatureCelciusMethod: 1, - waistSizeInch: 39, - weightKg: 70, - ); - } - String getBMI(var bodyMassIndex) { if (bodyMassIndex <= 18.5) { return "Underweight"; diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index dfcaa305..fa75abaa 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -27,11 +27,14 @@ const LOCATIONS = const [ ]; enum vitalSignDetails { - bodyMeasurements, - temperature, - pulse, - pespiration, - bloodPressure, - oxygenation, - painScale + BodyMeasurements, + Temperature, + Pulse, + Prescriptions, + BloodPressure, + Respiration, + heart, + PainScale, + Weight, + Height } diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index c5e503c2..10259fdc 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -1,136 +1,257 @@ class VitalSignData { - int appointmentNo; - int bloodPressureCuffLocation; - int bloodPressureCuffSize; - int bloodPressureHigher; - int bloodPressureLower; - int bloodPressurePatientPosition; + var transNo; + var projectID; + var weightKg; + var heightCm; + var temperatureCelcius; + var pulseBeatPerMinute; + var respirationBeatPerMinute; + var bloodPressureLower; + var bloodPressureHigher; + var sAO2; + var fIO2; + var painScore; var bodyMassIndex; - int fio2; - int headCircumCm; - int heightCm; - int idealBodyWeightLbs; + var headCircumCm; + var leanBodyWeightLbs; + var idealBodyWeightLbs; + var temperatureCelciusMethod; + var pulseRhythm; + var respirationPattern; + var bloodPressureCuffLocation; + var bloodPressureCuffSize; + var bloodPressurePatientPosition; + var painLocation; + var painDuration; + var painCharacter; + var painFrequency; bool isPainManagementDone; + var status; bool isVitalsRequired; - int leanBodyWeightLbs; - String painCharacter; - String painDuration; - String painFrequency; - String painLocation; - int painScore; - int patientMRN; - int patientType; - int pulseBeatPerMinute; - int pulseRhythm; - int respirationBeatPerMinute; - int respirationPattern; - int sao2; - int status; - int temperatureCelcius; - int temperatureCelciusMethod; - int waistSizeInch; - int weightKg; + var patientID; + var createdOn; + var doctorID; + var clinicID; + var triageCategory; + var gCScore; + var lineItemNo; + DateTime vitalSignDate; + var actualTimeTaken; + var sugarLevel; + var fBS; + var rBS; + var observationType; + var heartRate; + var muscleTone; + var reflexIrritability; + var bodyColor; + var isFirstAssessment; + var dateofBirth; + var timeOfBirth; + var bloodPressure; + var bloodPressureCuffLocationDesc; + var bloodPressureCuffSizeDesc; + var bloodPressurePatientPositionDesc; + var clinicName; + var doctorImageURL; + var doctorName; + var painScoreDesc; + var pulseRhythmDesc; + var respirationPatternDesc; + var temperatureCelciusMethodDesc; + var time; VitalSignData( - {this.appointmentNo, - this.bloodPressureCuffLocation, - this.bloodPressureCuffSize, - this.bloodPressureHigher, + {this.transNo, + this.projectID, + this.weightKg, + this.heightCm, + this.temperatureCelcius, + this.pulseBeatPerMinute, + this.respirationBeatPerMinute, this.bloodPressureLower, - this.bloodPressurePatientPosition, + this.bloodPressureHigher, + this.sAO2, + this.fIO2, + this.painScore, this.bodyMassIndex, - this.fio2, this.headCircumCm, - this.heightCm, - this.idealBodyWeightLbs, - this.isPainManagementDone, - this.isVitalsRequired, this.leanBodyWeightLbs, - this.painCharacter, - this.painDuration, - this.painFrequency, - this.painLocation, - this.painScore, - this.patientMRN, - this.patientType, - this.pulseBeatPerMinute, + this.idealBodyWeightLbs, + this.temperatureCelciusMethod, this.pulseRhythm, - this.respirationBeatPerMinute, this.respirationPattern, - this.sao2, + this.bloodPressureCuffLocation, + this.bloodPressureCuffSize, + this.bloodPressurePatientPosition, + this.painLocation, + this.painDuration, + this.painCharacter, + this.painFrequency, + this.isPainManagementDone, this.status, - this.temperatureCelcius, - this.temperatureCelciusMethod, - this.waistSizeInch, - this.weightKg}); + this.isVitalsRequired, + this.patientID, + this.createdOn, + this.doctorID, + this.clinicID, + this.triageCategory, + this.gCScore, + this.lineItemNo, + this.vitalSignDate, + this.actualTimeTaken, + this.sugarLevel, + this.fBS, + this.rBS, + this.observationType, + this.heartRate, + this.muscleTone, + this.reflexIrritability, + this.bodyColor, + this.isFirstAssessment, + this.dateofBirth, + this.timeOfBirth, + this.bloodPressure, + this.bloodPressureCuffLocationDesc, + this.bloodPressureCuffSizeDesc, + this.bloodPressurePatientPositionDesc, + this.clinicName, + this.doctorImageURL, + this.doctorName, + this.painScoreDesc, + this.pulseRhythmDesc, + this.respirationPatternDesc, + this.temperatureCelciusMethodDesc, + this.time}); VitalSignData.fromJson(Map json) { - appointmentNo = json['appointmentNo']; - bloodPressureCuffLocation = json['bloodPressureCuffLocation']; - bloodPressureCuffSize = json['bloodPressureCuffSize']; - bloodPressureHigher = json['bloodPressureHigher']; - bloodPressureLower = json['bloodPressureLower']; - bloodPressurePatientPosition = json['bloodPressurePatientPosition']; - bodyMassIndex = json['bodyMassIndex']; - fio2 = json['fio2']; - headCircumCm = json['headCircumCm']; - heightCm = json['heightCm']; - idealBodyWeightLbs = json['idealBodyWeightLbs']; - isPainManagementDone = json['isPainManagementDone']; - isVitalsRequired = json['isVitalsRequired']; - leanBodyWeightLbs = json['leanBodyWeightLbs']; - painCharacter = json['painCharacter']; - painDuration = json['painDuration']; - painFrequency = json['painFrequency']; - painLocation = json['painLocation']; - painScore = json['painScore']; - patientMRN = json['patientMRN']; - patientType = json['patientType']; - pulseBeatPerMinute = json['pulseBeatPerMinute']; - pulseRhythm = json['pulseRhythm']; - respirationBeatPerMinute = json['respirationBeatPerMinute']; - respirationPattern = json['respirationPattern']; - sao2 = json['sao2']; - status = json['status']; - temperatureCelcius = json['temperatureCelcius']; - temperatureCelciusMethod = json['temperatureCelciusMethod']; - waistSizeInch = json['waistSizeInch']; - weightKg = json['weightKg']; + transNo = json['TransNo']; + projectID = json['ProjectID']; + weightKg = json['WeightKg']; + heightCm = json['HeightCm']; + temperatureCelcius = json['TemperatureCelcius']; + pulseBeatPerMinute = json['PulseBeatPerMinute']; + respirationBeatPerMinute = json['RespirationBeatPerMinute']; + bloodPressureLower = json['BloodPressureLower']; + bloodPressureHigher = json['BloodPressureHigher']; + sAO2 = json['SAO2']; + fIO2 = json['FIO2']; + painScore = json['PainScore']; + bodyMassIndex = json['BodyMassIndex']; + headCircumCm = json['HeadCircumCm']; + leanBodyWeightLbs = json['LeanBodyWeightLbs']; + idealBodyWeightLbs = json['IdealBodyWeightLbs']; + temperatureCelciusMethod = json['TemperatureCelciusMethod']; + pulseRhythm = json['PulseRhythm']; + respirationPattern = json['RespirationPattern']; + bloodPressureCuffLocation = json['BloodPressureCuffLocation']; + bloodPressureCuffSize = json['BloodPressureCuffSize']; + bloodPressurePatientPosition = json['BloodPressurePatientPosition']; + painLocation = json['PainLocation']; + painDuration = json['PainDuration']; + painCharacter = json['PainCharacter']; + painFrequency = json['PainFrequency']; + isPainManagementDone = json['IsPainManagementDone']; + status = json['Status']; + isVitalsRequired = json['IsVitalsRequired']; + patientID = json['PatientID']; + createdOn = json['CreatedOn']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + triageCategory = json['TriageCategory']; + gCScore = json['GCScore']; + lineItemNo = json['LineItemNo']; + vitalSignDate = json['VitalSignDate']; + actualTimeTaken = json['ActualTimeTaken']; + sugarLevel = json['SugarLevel']; + fBS = json['FBS']; + rBS = json['RBS']; + observationType = json['ObservationType']; + heartRate = json['HeartRate']; + muscleTone = json['MuscleTone']; + reflexIrritability = json['ReflexIrritability']; + bodyColor = json['BodyColor']; + isFirstAssessment = json['IsFirstAssessment']; + dateofBirth = json['DateofBirth']; + timeOfBirth = json['TimeOfBirth']; + bloodPressure = json['BloodPressure']; + bloodPressureCuffLocationDesc = json['BloodPressureCuffLocationDesc']; + bloodPressureCuffSizeDesc = json['BloodPressureCuffSizeDesc']; + bloodPressurePatientPositionDesc = json['BloodPressurePatientPositionDesc']; + clinicName = json['ClinicName']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + painScoreDesc = json['PainScoreDesc']; + pulseRhythmDesc = json['PulseRhythmDesc']; + respirationPatternDesc = json['RespirationPatternDesc']; + temperatureCelciusMethodDesc = json['TemperatureCelciusMethodDesc']; + time = json['Time']; } Map toJson() { final Map data = new Map(); - data['appointmentNo'] = this.appointmentNo; - data['bloodPressureCuffLocation'] = this.bloodPressureCuffLocation; - data['bloodPressureCuffSize'] = this.bloodPressureCuffSize; - data['bloodPressureHigher'] = this.bloodPressureHigher; - data['bloodPressureLower'] = this.bloodPressureLower; - data['bloodPressurePatientPosition'] = this.bloodPressurePatientPosition; - data['bodyMassIndex'] = this.bodyMassIndex; - data['fio2'] = this.fio2; - data['headCircumCm'] = this.headCircumCm; - data['heightCm'] = this.heightCm; - data['idealBodyWeightLbs'] = this.idealBodyWeightLbs; - data['isPainManagementDone'] = this.isPainManagementDone; - data['isVitalsRequired'] = this.isVitalsRequired; - data['leanBodyWeightLbs'] = this.leanBodyWeightLbs; - data['painCharacter'] = this.painCharacter; - data['painDuration'] = this.painDuration; - data['painFrequency'] = this.painFrequency; - data['painLocation'] = this.painLocation; - data['painScore'] = this.painScore; - data['patientMRN'] = this.patientMRN; - data['patientType'] = this.patientType; - data['pulseBeatPerMinute'] = this.pulseBeatPerMinute; - data['pulseRhythm'] = this.pulseRhythm; - data['respirationBeatPerMinute'] = this.respirationBeatPerMinute; - data['respirationPattern'] = this.respirationPattern; - data['sao2'] = this.sao2; - data['status'] = this.status; - data['temperatureCelcius'] = this.temperatureCelcius; - data['temperatureCelciusMethod'] = this.temperatureCelciusMethod; - data['waistSizeInch'] = this.waistSizeInch; - data['weightKg'] = this.weightKg; + data['TransNo'] = this.transNo; + data['ProjectID'] = this.projectID; + data['WeightKg'] = this.weightKg; + data['HeightCm'] = this.heightCm; + data['TemperatureCelcius'] = this.temperatureCelcius; + data['PulseBeatPerMinute'] = this.pulseBeatPerMinute; + data['RespirationBeatPerMinute'] = this.respirationBeatPerMinute; + data['BloodPressureLower'] = this.bloodPressureLower; + data['BloodPressureHigher'] = this.bloodPressureHigher; + data['SAO2'] = this.sAO2; + data['FIO2'] = this.fIO2; + data['PainScore'] = this.painScore; + data['BodyMassIndex'] = this.bodyMassIndex; + data['HeadCircumCm'] = this.headCircumCm; + data['LeanBodyWeightLbs'] = this.leanBodyWeightLbs; + data['IdealBodyWeightLbs'] = this.idealBodyWeightLbs; + data['TemperatureCelciusMethod'] = this.temperatureCelciusMethod; + data['PulseRhythm'] = this.pulseRhythm; + data['RespirationPattern'] = this.respirationPattern; + data['BloodPressureCuffLocation'] = this.bloodPressureCuffLocation; + data['BloodPressureCuffSize'] = this.bloodPressureCuffSize; + data['BloodPressurePatientPosition'] = this.bloodPressurePatientPosition; + data['PainLocation'] = this.painLocation; + data['PainDuration'] = this.painDuration; + data['PainCharacter'] = this.painCharacter; + data['PainFrequency'] = this.painFrequency; + data['IsPainManagementDone'] = this.isPainManagementDone; + data['Status'] = this.status; + data['IsVitalsRequired'] = this.isVitalsRequired; + data['PatientID'] = this.patientID; + data['CreatedOn'] = this.createdOn; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['TriageCategory'] = this.triageCategory; + data['GCScore'] = this.gCScore; + data['LineItemNo'] = this.lineItemNo; + data['VitalSignDate'] = this.vitalSignDate; + data['ActualTimeTaken'] = this.actualTimeTaken; + data['SugarLevel'] = this.sugarLevel; + data['FBS'] = this.fBS; + data['RBS'] = this.rBS; + data['ObservationType'] = this.observationType; + data['HeartRate'] = this.heartRate; + data['MuscleTone'] = this.muscleTone; + data['ReflexIrritability'] = this.reflexIrritability; + data['BodyColor'] = this.bodyColor; + data['IsFirstAssessment'] = this.isFirstAssessment; + data['DateofBirth'] = this.dateofBirth; + data['TimeOfBirth'] = this.timeOfBirth; + data['BloodPressure'] = this.bloodPressure; + data['BloodPressureCuffLocationDesc'] = this.bloodPressureCuffLocationDesc; + data['BloodPressureCuffSizeDesc'] = this.bloodPressureCuffSizeDesc; + data['BloodPressurePatientPositionDesc'] = + this.bloodPressurePatientPositionDesc; + data['ClinicName'] = this.clinicName; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['PainScoreDesc'] = this.painScoreDesc; + data['PulseRhythmDesc'] = this.pulseRhythmDesc; + data['RespirationPatternDesc'] = this.respirationPatternDesc; + data['TemperatureCelciusMethodDesc'] = this.temperatureCelciusMethodDesc; + data['Time'] = this.time; return data; } } diff --git a/lib/routes.dart b/lib/routes.dart index e57b56a7..5dabcba2 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -135,7 +135,7 @@ var routes = { REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), - VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + // VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurved.dart b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart new file mode 100644 index 00000000..2f0eafcb --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/LineChartCurved.dart @@ -0,0 +1,217 @@ +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurved extends StatelessWidget { + final String title; + final List timeSeries; + final int indexes; + + LineChartCurved({this.title, this.timeSeries, this.indexes}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + getYaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + title, + style: TextStyle( + color: Colors.black, + fontSize: 15, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox(height: 10,), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 18.0, left: 16.0), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries.length) { + xAxixs.add(mIndex); + } + } + } + getYaxix() { + int indexess= (timeSeries.length*0.30).toInt(); + for (int index = 0; index < timeSeries.length; index++) { + int mIndex = indexess * index; + if (mIndex < timeSeries.length) { + yAxixs.add(timeSeries[mIndex].sales); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle:-65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries.length < 15) { + if (timeSeries.length > value.toInt()) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (value.toInt() == timeSeries.length - 1) + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries[value.toInt()].time.month}/ ${timeSeries[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + // if (timeSeries.length < 10) { + // return '${value.toInt()}'; + // } else { + // if (value == getMinY()) + // return '${value.toInt()}'; + // if (value == getMaxY()) + // return '${value.toInt()}'; + // if (yAxixs.contains(value)) { + // return '${value.toInt()}'; + // } + // return ''; + // } + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries.length - 1).toDouble(), + maxY: getMaxY()+0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble() ; + } + + double getMinY() { + double min = timeSeries[0].sales; + timeSeries.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart new file mode 100644 index 00000000..e816c145 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/LineChartCurvedBloodPressure.dart @@ -0,0 +1,257 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +class LineChartCurvedBloodPressure extends StatelessWidget { + final String title; + final List timeSeries1; + final List timeSeries2; + final int indexes; + + LineChartCurvedBloodPressure( + {this.title, this.timeSeries1, this.indexes, this.timeSeries2}); + + List xAxixs = List(); + List yAxixs = List(); + + @override + Widget build(BuildContext context) { + getXaxix(); + return AspectRatio( + aspectRatio: 1.1, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 15, + ), + Text( + title, + style: TextStyle( + color: Colors.black, fontSize: 15, letterSpacing: 2), + textAlign: TextAlign.center, + ), + SizedBox( + height: 10, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.only(right: 18.0, left: 16.0, top: 15), + child: LineChart( + sampleData1(context), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + SizedBox( + height: 10, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Theme.of(context).primaryColor), + ), + SizedBox(width: 5,), + AppText(TranslationBase.of(context).systolicLng) + ], + ), + SizedBox(width: 15,), + Row( + children: [ + Container( + width: 20, + height: 20, + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.grey), + ), + SizedBox(width: 5,), + AppText(TranslationBase.of(context).diastolicLng) + ], + ), + ], + ) + ], + ), + ], + ), + ), + ); + } + + getXaxix() { + for (int index = 0; index < timeSeries1.length; index++) { + int mIndex = indexes * index; + if (mIndex < timeSeries1.length) { + xAxixs.add(mIndex); + } + } + } + + LineChartData sampleData1(context) { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 10, + ), + rotateAngle: -65, + //rotateAngle:-65, + margin: 22, + getTitles: (value) { + if (timeSeries1.length < 15) { + if (timeSeries1.length > value.toInt()) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (value.toInt() == timeSeries1.length - 1) + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + if (xAxixs.contains(value.toInt())) { + return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}'; + } + } + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 12, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (timeSeries1.length - 1).toDouble(), + maxY: getMaxY() + 0.3, + minY: getMinY(), + lineBarsData: getData(context), + ); + } + + double getMaxY() { + double max = 0; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble > max) max = resultValueDouble; + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = timeSeries1[0].sales; + timeSeries1.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + timeSeries2.forEach((element) { + double resultValueDouble = element.sales; + if (resultValueDouble < min) min = resultValueDouble; + }); + + int value = min.toInt(); + + return value.toDouble(); + } + + List getData(context) { + List spots = List(); + for (int index = 0; index < timeSeries1.length; index++) { + spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales)); + } + + List spots2 = List(); + for (int index = 0; index < timeSeries2.length; index++) { + spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales)); + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + final LineChartBarData lineChartBarData2 = LineChartBarData( + spots: spots2, + isCurved: true, + colors: [Colors.grey], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [lineChartBarData1, lineChartBarData2]; + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart index a53a3619..185b9374 100644 --- a/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital-signs-screen.dart @@ -115,7 +115,7 @@ class PatientVitalSignScreen extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( + /*Row( children: [ AppText( "${TranslationBase.of(context).waistSize} :", @@ -133,7 +133,7 @@ class PatientVitalSignScreen extends StatelessWidget { fontWeight: FontWeight.normal, ), ], - ), + ),*/ Row( children: [ AppText( @@ -939,7 +939,7 @@ class _OxygenationWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.sao2}", + "${widget.vitalSign.sAO2}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, @@ -958,7 +958,7 @@ class _OxygenationWidgetState extends State { width: 8, ), AppText( - "${widget.vitalSign.fio2}", + "${widget.vitalSign.fIO2}", fontSize: SizeConfig.textMultiplier * 2, color: Colors.grey.shade800, fontWeight: FontWeight.normal, diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart new file mode 100644 index 00000000..09af7991 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -0,0 +1,145 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.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/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class VitalSignBloodPressureWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String title3; + final String viewKey1; + final String viewKey2; + + VitalSignBloodPressureWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: AppText( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + + ), + child: Center( + child: AppText(widget.title2, color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: AppText(widget.title3, color: Colors.white), + ), + height: 60), + ), + ])); + widget.vitalList.forEach((vital) { + var data = vital.toJson()[widget.viewKey1]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${vital.toJson()[widget.viewKey1]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${vital.toJson()[widget.viewKey2]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index cf8ee839..d382ec3f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,246 +1,196 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart'; -import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; -import 'package:flutter/material.dart'; - -import '../../../../config/shared_pref_kay.dart'; -import '../../../../config/size_config.dart'; -import '../../../../lookups/patient_lookup.dart'; -import '../../../../models/patient/patiant_info_model.dart'; -import '../../../../models/patient/vital_sign/vital_sign_res_model.dart'; -import '../../../../routes.dart'; -import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart'; -import '../../../../util/dr_app_shared_pref.dart'; -import '../../../../widgets/shared/app_scaffold_widget.dart'; - -DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - -class VitalSignDetailsScreen extends StatefulWidget { - // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); - @override - _VitalSignDetailsScreenState createState() => _VitalSignDetailsScreenState(); -} - -class _VitalSignDetailsScreenState extends State { - VitalSignResModel vitalSing; - String url = "assets/images/"; - - - /* - *@author: Elham Rababah - *@Date:28/4/2020 - *@param: context - *@return: - *@desc: getVitalSignList Function - */ - getVitalSignList(BuildContext context, PatientViewModel model) async { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - PatiantInformtion patient = routeArgs['patient']; - String token = await sharedPref.getString(TOKEN); - String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - int inOutpatientType = 1; - if (type == '0') { - inOutpatientType = 2; - } - print(type); - VitalSignReqModel vitalSignReqModel = VitalSignReqModel( - patientID: patient.patientId, - projectID: patient.projectId, - tokenID: token, - patientTypeID: patient.patientType, - inOutpatientType: inOutpatientType, - languageID: 2, - transNo: - patient.admissionNo != null ? int.parse(patient.admissionNo) : 0); - model.getPatientVitalSign(vitalSignReqModel.toJson()); - } - - - - final double contWidth = SizeConfig.realScreenWidth * 0.70; - - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - vitalSing = routeArgs['vitalSing']; - return BaseView( - onModelReady: (model) => getVitalSignList(context, model), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).vitalSign, - body: model.patientVitalSignOrderdSubList.length == 0 - ? DrAppEmbeddedError( - error: 'You don\'t have any vital Sings') - : Container( - child: Column( - children: [ - Row( - children: [ - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .bodyMeasurements, - 'key': - vitalSignDetails.bodyMeasurements - }); - }, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context) - .bodyMeasurements, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0] - .heightCm - .toString(), - unit: 'Cm', - ), - ), - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .temperature, - 'key': vitalSignDetails.temperature, - }); - }, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context) - .temperature, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0] - .temperatureCelcius - .toString(), - unit: 'C', - ), - ), - ), - ], - ), - Row( - children: [ - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': - TranslationBase.of(context).pulse, - 'key': vitalSignDetails.pulse - }); - }, - child: VitalSignItem( - des: TranslationBase.of(context).pulse, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0] - .pulseBeatPerMinute - .toString(), - unit: 'M', - ), - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .respiration, - 'key': vitalSignDetails.pespiration - }); - }, - child: VitalSignItem( - des: - TranslationBase.of(context).respiration, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0] - .respirationBeatPerMinute - .toString(), - unit: 'M', - ), - ), - ], - ), - Row( - children: [ - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .bloodPressure, - 'key': vitalSignDetails.bloodPressure - }); - }, - child: VitalSignItem( - des: TranslationBase.of(context) - .bloodPressure, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0] - .bloodPressure - .toString(), - unit: '', - ), - ), - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .oxygenation, - 'key': vitalSignDetails.oxygenation - }); - }, - child: VitalSignItem( - des: - TranslationBase.of(context).oxygenation, - url: url + 'heartbeat.png', - lastVal: model - .patientVitalSignOrderdSubList[0].fIO2 - .toString(), - unit: '', - ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - onTap: () { - Navigator.of(context).pushNamed( - BODY_MEASUREMENTS, - arguments: { - 'title': TranslationBase.of(context) - .painScale, - 'key': vitalSignDetails.painScale - }); - }, - child: VitalSignItem( - des: TranslationBase - .of(context) - .painScale, - url: url + 'heartbeat.png', - ), - ), - ], - ), - ], - ), - ),),); - } -} +// import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; +// import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; +// import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +// import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +// import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +// import 'package:flutter/material.dart'; +// +// class VitalSignDetailsScreen extends StatelessWidget { +// static const String url = "assets/images/"; +// +// int appointmentNo; +// int projectID; +// bool isNotOneAppointment; +// VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); +// List imagesInfo = List(); +// +// +// @override +// Widget build(BuildContext context) { +// imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/0.png')); +// imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-vital-signs/ar/1.png')); +// return BaseView( +// onModelReady: appointmentNo != null && projectID != null +// ? (model) => model.getPatientVitalSign( +// appointmentNo: appointmentNo, projectID: projectID) +// : (model) => model.getPatientVitalSign(), +// builder: (_, mode, widget) => AppScaffold( +// isShowAppBar: true, +// appBarTitle: TranslationBase.of(context).vitalSigns, +// baseViewModel: mode, +// description: TranslationBase.of(context).infoSigns, +// imagesInfo: imagesInfo, +// body: mode.vitalSignResModelList.length > 0 +// ? Container( +// child: ListView( +// children: [ +// Row( +// children: [ +// InkWell( +// onTap: () =>isNotOneAppointment? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.Height, +// pageTitle: TranslationBase.of(context).height, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: Container( +// child: VitalSignItem( +// des: TranslationBase.of(context).height, +// icon: DQIcons.height, +// lastVal: mode.heightCm, +// unit: TranslationBase.of(context).cm, +// ), +// ), +// ), +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.Weight, +// pageTitle: TranslationBase.of(context).weight, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: VitalSignItem( +// des: TranslationBase.of(context).weight, +// icon: DQIcons.weight_scale, +// unit: TranslationBase.of(context).kg, +// lastVal: mode.weightKg, +// ), +// ), +// ], +// ), +// Row( +// children: [ +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: vitalSignDetails.BodyMeasurements, +// pageTitle: TranslationBase.of(context) +// .bodyMeasurements, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ): null, +// child: VitalSignItem( +// des: TranslationBase.of(context).body, +// icon: DQIcons.bmi, +// lastVal: mode.bodyMax, +// unit: TranslationBase.of(context).mass, +// ), +// ), +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.Temperature, +// pageTitle: +// TranslationBase.of(context).temperature, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: Container( +// child: VitalSignItem( +// des: TranslationBase.of(context).temperature, +// icon: DQIcons.thermometer, +// lastVal: mode.temperatureCelcius, +// unit: TranslationBase.of(context).tempC, +// ), +// ), +// ), +// ], +// ), +// Row( +// children: [ +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.heart, +// pageTitle: TranslationBase.of(context).heart, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: VitalSignItem( +// des: TranslationBase.of(context).heart, +// icon: DQIcons.heart, +// lastVal: mode.hartRat, +// unit: TranslationBase.of(context).bpm, +// ), +// ), +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.Respiration, +// pageTitle: +// TranslationBase.of(context).respirationRate, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: VitalSignItem( +// des: TranslationBase.of(context).respirationRate, +// icon: DQIcons.outline, +// lastVal: mode.respirationBeatPerMinute, +// unit: TranslationBase.of(context).respirationSigns, +// ), +// ), +// ], +// ), +// Row( +// mainAxisAlignment: MainAxisAlignment.center, +// children: [ +// InkWell( +// onTap: () => isNotOneAppointment ? Navigator.push( +// context, +// FadePage( +// page: VitalSignItemDetailsScreen( +// pageKey: VitalSignDetails.BloodPressure, +// pageTitle: TranslationBase.of(context).bloodPressure, +// vitalList: mode.vitalSignResModelList, +// ), +// ), +// ):null, +// child: VitalSignItem( +// des: TranslationBase.of(context).bloodPressure, +// icon: DQIcons.blood_pressure, +// lastVal: mode.bloodPressure, +// unit: TranslationBase.of(context).sysDias, +// ), +// ), +// ], +// ), +// ], +// ), +// ) +// : Center( +// child: Texts('No Data'), +// ), +// ), +// ); +// } +// } diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart new file mode 100644 index 00000000..828e320a --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -0,0 +1,121 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.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/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class VitalSignDetailsWidget extends StatefulWidget { + final List vitalList; + final String title1; + final String title2; + final String viewKey; + + VitalSignDetailsWidget( + {Key key, this.vitalList, this.title1, this.title2, this.viewKey}); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: AppText( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0) + ), + ), + child: Center( + child: AppText(widget.title2, color: Colors.white), + ), + height: 60), + ) + ])); + widget.vitalList.forEach((vital) { + var data = vital.toJson()[widget.viewKey]; + if (data != 0) + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: AppText( + '${vital.toJson()[widget.viewKey]}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 1e0ce2cf..6ed044ab 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -1,32 +1,23 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import '../../../../config/size_config.dart'; -import '../../../../widgets/shared/rounded_container_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: VitalSignItem - */ class VitalSignItem extends StatelessWidget { const VitalSignItem( {Key key, - @required this.url, @required this.des, this.lastVal = 'N/A', this.unit = '', this.height, - this.width}) + this.width, + @required this.icon}) : super(key: key); - final String url; final String des; final String lastVal; final String unit; - + final IconData icon; final double height; final double width; @@ -34,52 +25,70 @@ class VitalSignItem extends StatelessWidget { Widget build(BuildContext context) { return RoundedContainer( margin: 0.025 * SizeConfig.realScreenWidth, - height: 0.14 * SizeConfig.realScreenHeight, + height: 0.15 * SizeConfig.realScreenHeight, width: 0.45 * SizeConfig.realScreenWidth, child: Container( padding: EdgeInsets.all(5), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 2, - child: Text( - des, - style: TextStyle( - fontSize: 1.7 * SizeConfig.textMultiplier, - color: HexColor('#B8382C'), - fontWeight: FontWeight.bold), - ), - ), - Expanded( - flex: 1, - child: Column( + Container( + height: 0.10 * SizeConfig.realScreenHeight, + child: Row( children: [ Expanded( - child: Image.asset( - url, - height: SizeConfig.heightMultiplier * 7, - ), - ), - Expanded( - child: RichText( - text: TextSpan( - style: TextStyle(color: Colors.black), - children: [ - new TextSpan(text: lastVal), - new TextSpan( - text: ' ${unit}', + flex: 2, + child: Align( + alignment: Alignment.topLeft, + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Text( + des, style: TextStyle( + fontSize: 1.7 * SizeConfig.textMultiplier, color: HexColor('#B8382C'), + fontWeight: FontWeight.bold, ), ), - ], + ), ), - )) + ), + Expanded( + flex: 1, + child: Container( + child: Icon( + icon, + size: 40, + ), + ), + ) ], ), - ) + ), + Expanded( + child: Container( + width: double.infinity, + child: Align( + alignment: Alignment.topRight, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: RichText( + text: TextSpan( + style: TextStyle(color: Colors.black), + children: [ + TextSpan(text: lastVal), + TextSpan( + text: unit, + style: TextStyle( + color: HexColor('#B8382C'), + ), + ), + ]), + ), + ), + ), + ), + ), ], ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart index 853bec15..5a2d4901 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart @@ -1 +1,195 @@ -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import '../../../../lookups/patient_lookup.dart'; import '../../../../models/patient/vital_sign/vital_sign_res_model.dart'; import '../../../../screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; /* *@author: Elham Rababah *@Date:03/6/2020 *@param: *@return: *@desc: VitalSignItemDetailsScreen */ class VitalSignItemDetailsScreen extends StatelessWidget { VitalSignItemDetailsScreen(); List vitalList = []; String pageTitle; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; pageTitle = routeArgs['title']; var pageKey = routeArgs['key']; List VSchart; switch (pageKey) { case vitalSignDetails.bodyMeasurements: VSchart = [ { 'name': 'Highet', 'title1': 'Date', 'title2': 'Cm', 'viewKey': 'HeightCm', }, { 'name': 'Weight Kg', 'title1': 'Date', 'title2': 'Kg', 'viewKey': 'WeightKg', }, { 'name': 'BodyMassIndex', 'title1': 'Date', 'title2': 'BodyMass', 'viewKey': 'BodyMassIndex', }, { 'name': 'HeadCircumCm', 'title1': 'Date', 'title2': 'Cm', 'viewKey': 'HeadCircumCm', }, { 'name': 'Ideal Body Weight (Lbs)', 'title1': 'Date', 'title2': 'Ideal Weight', 'viewKey': 'IdealBodyWeightLbs', }, { 'name': 'LeanBodyWeightLbs (Lbs)', 'title1': 'Date', 'title2': 'Lean Weight', 'viewKey': 'LeanBodyWeightLbs', } ]; break; case vitalSignDetails.temperature: VSchart = [ { 'name': 'Temperature In Celcius', 'title1': 'Date', 'title2': 'C', 'viewKey': 'TemperatureCelcius', }, ]; break; case vitalSignDetails.pulse: VSchart = [ { 'name': 'Pulse Beat Per Minute', 'title1': 'Date', 'title2': 'Minute', 'viewKey': 'PulseBeatPerMinute', }, ]; break; case vitalSignDetails.pespiration: VSchart = [ { 'name': 'Respiration Beat Per Minute', 'title1': 'Date', 'title2': 'Beat Per Minute', 'viewKey': 'RespirationBeatPerMinute', }, ]; break; case vitalSignDetails.bloodPressure: VSchart = [ { 'name': 'Blood Pressure Higher', 'title1': 'Date', 'title2': 'Minute', 'viewKey': 'BloodPressureHigher', }, { 'name': 'Blood Pressure Lower', 'title1': 'Date', 'title2': 'Minute', 'viewKey': 'BloodPressureLower', } ]; break; case vitalSignDetails.oxygenation: VSchart = [ { 'name': 'FIO2', 'title1': 'Date', 'title2': 'Cm', 'viewKey': 'FIO2', }, { 'name': 'SAO2', 'title1': 'Date', 'title2': 'Cm', 'viewKey': 'SAO2', }, ]; break; case vitalSignDetails.painScale: VSchart = [ { 'name': 'PainScore', 'title1': 'Date', 'title2': 'Cm', 'viewKey': 'PainScore', }, ]; break; default: } return BaseView( onModelReady: (model) { vitalList = model.patientVitalSignOrderdSubList; }, builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: pageTitle, body: ListView( children: VSchart.map((chartInfo) { var vitalListTemp = vitalList.where( (element) => element.toJson()[chartInfo['viewKey']] != null, ); return vitalListTemp.length != 0 ? VitalSingChartAndDetials( vitalList: vitalList, name: chartInfo['name'], title1: chartInfo['title1'], title2: chartInfo['title2'], viewKey: chartInfo['viewKey']) : Center( child: Container( margin: EdgeInsets.only( top: MediaQuery.of(context).size.height * 0.45), child: Center( child: DrAppEmbeddedError( error: TranslationBase.of(context).youDoNotHaveAnyItem), ), )); }).toList(), ), ), ); } } \ No newline at end of file +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class VitalSignItemDetailsScreen extends StatelessWidget { + final vitalSignDetails pageKey; + final String pageTitle; + List VSchart; + + VitalSignItemDetailsScreen({this.vitalList, this.pageKey, this.pageTitle}); + + final List vitalList; + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + switch (pageKey) { + case vitalSignDetails.BodyMeasurements: + VSchart = [ + { + 'name': 'BMI', + 'nameAr': 'مؤشر الكتلة', + 'title1': 'Date', + 'title2': 'BMI', + 'title2Ar': 'الكتلة', + 'viewKey': 'BodyMassIndex', + }, + + ]; + + break; + + case vitalSignDetails.Temperature: + VSchart = [ + { + 'name': 'Temperature In Celsius', + 'nameAr': 'درجة الحرارة بالدرجة المئوية', + 'title1': 'Date', + 'title2': 'C', + 'title2Ar': 'ْس', + 'viewKey': 'TemperatureCelcius', + }, + ]; + + break; + case vitalSignDetails.Pulse: + VSchart = [ + { + 'name': 'Pulse Beat Per Minute', + 'nameAr': 'نبضة نبضة في الدقيقة', + 'title1': 'Date', + 'title2': 'Minute', + 'title2Ar': 'دقيقة', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case vitalSignDetails.Prescriptions: + VSchart = [ + { + 'name': 'Respiration Beat Per Minute', + 'nameAr': 'ضربات التنفس في الدقيقة', + 'title1': 'Date', + 'title2': 'Beat Per Minute', + 'title2Ar': 'نفس في الدقيقة', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case vitalSignDetails.BloodPressure: + VSchart = [ + { + 'name': 'Blood Pressure Systolic Diastolic', + 'nameAr': 'ضغط الدم الإنقباض الإنبساط', + 'title1': 'Date', + 'title2': 'systolic', + 'title3': 'Diastolic', + 'title2Ar': 'الإنقباض', + 'title3Ar': 'الإنبساط', + 'viewKey': 'BloodPressure', + }, + + ]; + + break; + case vitalSignDetails.Respiration: + VSchart = [ + { + 'name': 'Respiration Rate', + 'nameAr': 'معدل التنفس', + 'title1': 'Date', + 'title2': 'bpm', + 'title2Ar': 'نفس', + 'viewKey': 'RespirationBeatPerMinute', + }, + ]; + + break; + case vitalSignDetails.heart: + VSchart = [ + { + 'name': 'Heart rate', + 'nameAr': 'معدل النبض بالدقيقة', + 'title1': 'Date', + 'title2': 'bpm', + 'title2Ar': 'نبضة', + 'viewKey': 'PulseBeatPerMinute', + }, + ]; + + break; + case vitalSignDetails.PainScale: + VSchart = [ + { + 'name': 'PainScore', + 'nameAr': 'نقاط الألم', + 'title1': 'Date', + 'title2': 'Cm', + 'title2Ar': 'سم', + 'viewKey': 'PainScore', + }, + ]; + + break; + case vitalSignDetails.Weight: + VSchart = [ + { + 'name': 'Weight Kg', + 'nameAr': 'الوزن كجم', + 'title1': 'Date', + 'title2': 'Kg', + 'title2Ar': 'كجم', + 'viewKey': 'WeightKg', + }, + ]; + + break; + + case vitalSignDetails.Height: + VSchart = [ + { + 'name': 'Height Cm', + 'nameAr': 'الطول سم', + 'title1': 'Date', + 'title2': 'Cm', + 'title2Ar': 'سم', + 'viewKey': 'HeightCm', + }, + ]; + + break; + default: + } + return AppScaffold( + appBarTitle: pageTitle, + isShowAppBar: true, + body: ListView( + children: VSchart.map((chartInfo) { + var vitalListTemp = vitalList.where( + (element) => element.toJson()[chartInfo['viewKey']] != null, + ); + + if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){ + return VitalSingChartBloodPressure( + vitalList: vitalList, + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], + title1: chartInfo['title1'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], + title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'], + viewKey1: 'BloodPressureHigher', + viewKey2: 'BloodPressureLower', + + ); + } + + return vitalListTemp.length != 0 + ? VitalSingChartAndDetials( + vitalList: vitalList, + name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'], + title1: chartInfo['title1'], + title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'], + viewKey: chartInfo['viewKey']) + : Container(); + }).toList(), + ), + ); + } +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index 7ae4937a..39b22073 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -1,16 +1,13 @@ -import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; -import 'package:doctor_app_flutter/widgets/patients/vital_sign_details_wideget.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; -import 'package:doctor_app_flutter/widgets/shared/charts/app_time_series_chart.dart'; import 'package:flutter/material.dart'; -/* - *@author: Elham Rababah - *@Date:03/6/2020 - *@param: - *@return: - *@desc: VitalSingChartAndDetials - */ +import 'package:charts_flutter/flutter.dart' as charts; + +import 'LineChartCurved.dart'; + class VitalSingChartAndDetials extends StatelessWidget { VitalSingChartAndDetials({ Key key, @@ -21,30 +18,46 @@ class VitalSingChartAndDetials extends StatelessWidget { @required this.title2, }) : super(key: key); - final List vitalList; + final List vitalList; final String name; final String viewKey; final String title1; final String title2; + List timeSeriesData = []; @override Widget build(BuildContext context) { + generateData(); return Column( children: [ AppExpandableNotifier( - headerWid: AppTimeSeriesChart( + // isExpand: true, + headerWid: LineChartCurved(title: name,timeSeries:timeSeriesData,indexes: timeSeriesData.length~/5.5,), + bodyWid: VitalSignDetailsWidget( vitalList: vitalList, - chartName: name, + title1: title1, + title2: title2, viewKey: viewKey, ), - bodyWid: VitalSignDetailsWidget( - vitalList: vitalList.reversed.toList(), - title1: '${title1}', - title2: '${title2}', - viewKey: '${viewKey}', - ), ), ], ); } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) + timeSeriesData.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey].toDouble(), + ), + ); + }, + ); + } + return timeSeriesData.reversed.toList(); + } } diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart new file mode 100644 index 00000000..67390082 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -0,0 +1,84 @@ +import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; +import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'LineChartCurved.dart'; +import 'LineChartCurvedBloodPressure.dart'; + +class VitalSingChartBloodPressure extends StatelessWidget { + VitalSingChartBloodPressure({ + Key key, + @required this.vitalList, + @required this.name, + @required this.viewKey1, + @required this.viewKey2, + @required this.title1, + @required this.title2, + @required this.title3, + }) : super(key: key); + + final List vitalList; + final String name; + final String viewKey1; + final String viewKey2; + final String title1; + final String title2; + final String title3; + List timeSeriesData1 = []; + List timeSeriesData2 = []; + + @override + Widget build(BuildContext context) { + generateData(); + return Column( + children: [ + AppExpandableNotifier( + // isExpand: true, + headerWid: LineChartCurvedBloodPressure( + title: name, + timeSeries1: timeSeriesData1, + timeSeries2: timeSeriesData2, + indexes: timeSeriesData1.length ~/ 5.5, + ), + bodyWid: VitalSignBloodPressureWidget( + vitalList: vitalList, + title1: title1, + title2: title2, + title3: title3, + viewKey1: viewKey1, + viewKey2: viewKey2, + ), + ), + ], + ); + } + + generateData() { + if (vitalList.length > 0) { + vitalList.reversed.toList().forEach( + (element) { + if (element.toJson()[viewKey1]?.toInt() != 0) + timeSeriesData1.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey1].toDouble(), + ), + ); + if (element.toJson()[viewKey2]?.toInt() != 0) + timeSeriesData2.add( + TimeSeriesSales2( + new DateTime(element.vitalSignDate.year, + element.vitalSignDate.month, element.vitalSignDate.day), + element.toJson()[viewKey2].toDouble(), + ), + ); + }, + ); + } + } +} diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 5d651bad..df52b1fd 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -77,5 +77,138 @@ class DateUtils { int.parse(str.substring(startIndex + start.length, endIndex))); return differenceBetweenDateAndCurrent(date); } + + /// get month by + /// [weekDay] convert week day in int to week day name + static getWeekDay(int weekDay) { + switch (weekDay) { + case 1: + return "Monday"; + case 2: + return "Tuesday"; + case 3: + return "Wednesday"; + case 4: + return "Thursday"; + case 5: + return "Friday"; + case 6: + return "Saturday "; + case 7: + return "Sunday"; + } + } + + /// get month by + /// [weekDay] convert week day in int to week day name arabic + static getWeekDayArabic(int weekDay) { + switch (weekDay) { + case 1: + return "الاثنين"; + case 2: + return "الثلاثاء"; + case 3: + return "الاربعاء"; + case 4: + return "الخميس"; + case 5: + return "الجمعه"; + case 6: + return "السبت "; + case 7: + return "الاحد"; + } + } + + /// get month by + /// [month] convert month number in to month name + static getMonth(int month) { + switch (month) { + case 1: + return "January"; + case 2: + return "February"; + case 3: + return "March"; + case 4: + return "April"; + case 5: + return "May"; + case 6: + return "June"; + case 7: + return "July"; + case 8: + return "August"; + case 9: + return "September"; + case 10: + return "October"; + case 11: + return "November"; + case 12: + return "December"; + } + } + + /// get month by + /// [month] convert month number in to month name in Arabic + static getMonthArabic(int month) { + switch (month) { + case 1: + return "يناير"; + case 2: + return " فبراير"; + case 3: + return "مارس"; + case 4: + return "أبريل"; + case 5: + return "مايو"; + case 6: + return "يونيو"; + case 7: + return "يوليو"; + case 8: + return "أغسطس"; + case 9: + return "سبتمبر"; + case 10: + return " اكتوبر"; + case 11: + return " نوفمبر"; + case 12: + return "ديسمبر"; + } + } + + static getMonthByName(String month) { + switch (month.toLowerCase()) { + case 'january': + return 1; + case 'february': + return 2; + case 'march': + return 3; + case 'april': + return 4; + case 'may': + return 5; + case 'june': + return 6; + case 'july': + return 7; + case 'august': + return 8; + case 'september': + return 9; + case 'october': + return 10; + case 'november': + return 11; + case 'december': + return 12; + } + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c5723402..284712cb 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -560,6 +560,9 @@ class TranslationBase { String get addExamination => localizedValues['addExamination'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/charts/app_bar_chart.dart b/lib/widgets/charts/app_bar_chart.dart new file mode 100644 index 00000000..98ef3cfa --- /dev/null +++ b/lib/widgets/charts/app_bar_chart.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +class AppBarChart extends StatelessWidget { + const AppBarChart({ + Key key, + @required this.seriesList, + }) : super(key: key); + + final List seriesList; + + @override + Widget build(BuildContext context) { + return Container( + height: 400, + margin: EdgeInsets.only(top: 60), + child: charts.BarChart( + seriesList, + // animate: animate, + + /// Customize the primary measure axis using a small tick renderer. + /// Use String instead of num for ordinal domain axis + /// (typically bar charts). + primaryMeasureAxis: new charts.NumericAxisSpec( + renderSpec: new charts.GridlineRendererSpec( + // Display the measure axis labels below the gridline. + // + // 'Before' & 'after' follow the axis value direction. + // Vertical axes draw 'before' below & 'after' above the tick. + // Horizontal axes draw 'before' left & 'after' right the tick. + labelAnchor: charts.TickLabelAnchor.before, + + // Left justify the text in the axis. + // + // Note: outside means that the secondary measure axis would right + // justify. + labelJustification: + charts.TickLabelJustification.outside, + )), + ), + ); + } +} diff --git a/lib/widgets/charts/app_line_chart.dart b/lib/widgets/charts/app_line_chart.dart new file mode 100644 index 00000000..553afec8 --- /dev/null +++ b/lib/widgets/charts/app_line_chart.dart @@ -0,0 +1,44 @@ +import 'package:flutter/material.dart'; +import 'package:charts_flutter/flutter.dart' as charts; + +/// chart line +/// [seriesList] charts series +/// [chartTitle] the charts title +/// [animate] enable and disable animate on create chart +/// [includeArea] chart include Area +/// [stacked] stacked chart over the design +class AppLineChart extends StatelessWidget { + final List seriesList; + final String chartTitle; + final bool animate; + final bool includeArea; + final bool stacked; + + AppLineChart( + {Key key, + @required this.seriesList, + this.chartTitle, + this.animate = true, + this.includeArea = false, + this.stacked = true}); + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + Text( + chartTitle, + style: TextStyle(fontSize: 24.0, fontWeight: FontWeight.bold), + ), + Expanded( + child: charts.LineChart(seriesList, + defaultRenderer: charts.LineRendererConfig( + includeArea: false, stacked: true), + animate: animate), + ), + ], + ), + ); + } +} diff --git a/lib/widgets/charts/app_time_series_chart.dart b/lib/widgets/charts/app_time_series_chart.dart new file mode 100644 index 00000000..670284a1 --- /dev/null +++ b/lib/widgets/charts/app_time_series_chart.dart @@ -0,0 +1,71 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:charts_flutter/flutter.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/data_display/list/flexible_container.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; + +/// App Time Series Chart +/// [seriesList] the series list +/// [chartName] the name of the chart +/// [startDate] the start date +/// [endDate] the end date +class AppTimeSeriesChart extends StatelessWidget { + AppTimeSeriesChart({ + Key key, + @required this.seriesList, + this.chartName = '', + this.startDate, + this.endDate, + }); + + final String chartName; + final List> seriesList; + final DateTime startDate; + final DateTime endDate; + + @override + Widget build(BuildContext context) { + return FlexibleContainer( + heightFactor: 0.47, + child: Column( + children: [ + AppText(chartName, fontSize: SizeConfig.textMultiplier * 3), + Container( + height: SizeConfig.realScreenHeight * 0.37, + child: Center( + child: Container( + child: charts.TimeSeriesChart( + seriesList, + animate: true, + behaviors: [ + charts.RangeAnnotation( + [ + charts.RangeAnnotationSegment(startDate, endDate, + charts.RangeAnnotationAxisType.domain ), + ], + ), + ], + ), + ), + ), + ), + ], + ), + ); + } +} + +class TimeSeriesSales { + final DateTime time; + final int sales; + + TimeSeriesSales(this.time, this.sales); +} + +class TimeSeriesSales2 { + final DateTime time; + final double sales; + + TimeSeriesSales2(this.time, this.sales); +} diff --git a/lib/widgets/data_display/list/custom_Item.dart b/lib/widgets/data_display/list/custom_Item.dart new file mode 100644 index 00000000..c11af999 --- /dev/null +++ b/lib/widgets/data_display/list/custom_Item.dart @@ -0,0 +1,93 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; + +/// Custom Item widget +/// [startIcon] icon at the start of the widget +/// [startIconSize] icon size of start icon +/// [startIconColor] icon color of start icon +/// [endIcon] icon at the end of the widget +/// [endIconSize] icon size of end icon +/// [endIconColor] icon color of end icon +/// [disabled] disabled on tap function +/// [onTap] opTap function +/// [padding] padding of the widget +/// [child] child of the widget +/// [decoration] decoration of the widget +class CustomItem extends StatelessWidget { + final IconData startIcon; + final double startIconSize; + final Color startIconColor; + final IconData endIcon; + final double endIconSize; + final Color endIconColor; + final bool disabled; + final Function onTap; + final EdgeInsets padding; + final Widget child; + final BoxDecoration decoration; + + CustomItem( + {Key key, + this.startIcon, + this.disabled: false, + this.onTap, + this.startIconColor, + this.endIcon = EvaIcons.chevronRight, + this.padding, + this.child, + this.endIconColor, + this.endIconSize = 20, + this.decoration, + this.startIconSize = 19}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return IgnorePointer( + ignoring: disabled, + child: Container( + decoration: decoration != null ? decoration : BoxDecoration(), + child: InkWell( + onTap: () { + if (onTap != null) onTap(); + }, + child: Padding( + padding: padding != null + ? padding + : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 16.0), + child: Row( + children: [ + if (startIcon != null) + Expanded( + flex: 1, + child: Icon( + startIcon, + color: startIconColor ?? Theme.of(context).primaryColor, + size: startIconSize, + ), + ), + if (startIcon != null) SizedBox(width: 18.0), + Expanded( + child: child, + flex: 10, + ), + endIcon == null + ? Expanded(child: Container()) + : Expanded( + flex: 1, + child: Icon( + endIcon, + color: endIconColor != null + ? endIconColor + : Colors.grey[500], + size: endIconSize, + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/lib/widgets/data_display/list/flexible_container.dart b/lib/widgets/data_display/list/flexible_container.dart new file mode 100644 index 00000000..a35fa279 --- /dev/null +++ b/lib/widgets/data_display/list/flexible_container.dart @@ -0,0 +1,50 @@ +import 'package:flutter/material.dart'; +/// Flexible container widget +/// [widthFactor] If non-null, the fraction of the incoming width given to the child. +/// If non-null, the child is given a tight width constraint that is the max +/// incoming width constraint multiplied by this factor. +/// If null, the incoming width constraints are passed to the child + +/// [heightFactor]If non-null, the fraction of the incoming height given to the child. +/// If non-null, the child is given a tight height constraint that is the max +/// incoming height constraint multiplied by this factor. +/// If null, the incoming height constraints are passed to the child +/// [padding] add padding to the container +/// [child] child widget inside the container +class FlexibleContainer extends StatelessWidget { + final double widthFactor; + final double heightFactor; + final EdgeInsets padding; + final Widget child; + + FlexibleContainer({ + Key key, + this.widthFactor = 0.9, + this.heightFactor = 1, + this.padding, + this.child, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( +// widthFactor: widthFactor, +// heightFactor: heightFactor, + child: ClipRRect( + borderRadius: BorderRadius.circular(8.0), + child: Material( + color: Theme.of(context).backgroundColor, + child: Container( + padding: padding, + width: double.infinity, + decoration: BoxDecoration( + border: Border.all( + color: Theme.of(context).dividerColor, width: 2.0), + borderRadius: BorderRadius.circular(8.0)), + child: child, + ), + ), + ), + ); + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 19989ecd..52f2ea47 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -70,12 +70,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { .episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), + if(int.parse(patientType) ==7) PatientProfileButton( key: key, patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, + route: PATIENT_VITAL_SIGN, icon: 'heartbeat.png'), if(selectedPatientType != 7) PatientProfileButton( diff --git a/lib/widgets/transitions/fade_page.dart b/lib/widgets/transitions/fade_page.dart new file mode 100644 index 00000000..97a37ce1 --- /dev/null +++ b/lib/widgets/transitions/fade_page.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; + +/// FadePage animation +/// [page] +class FadePage extends PageRouteBuilder { + final Widget page; + FadePage({this.page}) + : super( + opaque: false, + fullscreenDialog: true, + barrierDismissible: true, + barrierColor: Colors.black.withOpacity(0.8), + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) => + page, + transitionDuration: Duration(milliseconds: 300), + transitionsBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child, + ) { + return FadeTransition( + opacity: animation, + child: child + ); + } + ); +} \ No newline at end of file diff --git a/lib/widgets/transitions/slide_up_page.dart b/lib/widgets/transitions/slide_up_page.dart new file mode 100644 index 00000000..2c138b9e --- /dev/null +++ b/lib/widgets/transitions/slide_up_page.dart @@ -0,0 +1,43 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; + +///Slide Up Page Route +/// [widget] widget we need to slide up +/// [fullscreenDialog] show the widget as full screen dialog +/// [opaque] When an opaque route's entrance transition is complete, the routes behind the opaque route will not be built to save resources. +class SlideUpPageRoute extends PageRouteBuilder { + final Widget widget; + final bool fullscreenDialog; + final bool opaque; + + SlideUpPageRoute( + {this.widget, this.fullscreenDialog = false, this.opaque = true}) + : super( + pageBuilder: ( + BuildContext context, + Animation animation, + Animation secondaryAnimation, + ) { + return widget; + }, + fullscreenDialog: fullscreenDialog, + opaque: opaque, + barrierColor: Color.fromRGBO(0, 0, 0, 0.5), + barrierDismissible: true, + transitionDuration: Duration(milliseconds: 800), + transitionsBuilder: ((BuildContext context, + Animation animation, + Animation secondaryAnimation, + Widget child) { + var begin = Offset(0.0, 1.0); + var end = Offset.zero; + var curve = Curves.easeInOutQuint; + + var tween = + Tween(begin: begin, end: end).chain(CurveTween(curve: curve)); + + return SlideTransition( + position: animation.drive(tween), child: child); + }), + ); +} diff --git a/pubspec.lock b/pubspec.lock index 2ad55e08..0d5ec4e8 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -70,7 +70,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.6.0" + version: "1.6.1" build_config: dependency: transitive description: @@ -84,35 +84,35 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.4" + version: "2.1.6" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.2" + version: "3.0.3" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.5.1" + version: "1.5.2" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.11" + version: "1.10.13" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.5" + version: "6.1.6" build_web_compilers: dependency: "direct dev" description: @@ -189,7 +189,7 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.5.0" + version: "3.6.0" collection: dependency: transitive description: @@ -281,6 +281,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + equatable: + dependency: transitive + description: + name: equatable + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.5" eva_icons_flutter: dependency: "direct main" description: @@ -323,6 +330,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.10.11" + fl_chart: + dependency: "direct main" + description: + name: fl_chart + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.2" flutter: dependency: "direct main" description: flutter @@ -468,7 +482,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -553,6 +567,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.0-nullsafety.1" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.1+1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4" path_provider_linux: dependency: transitive description: @@ -650,7 +678,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.2+3" + version: "4.3.2+4" pub_semver: dependency: transitive description: @@ -678,7 +706,7 @@ packages: name: scratch_space url: "https://pub.dartlang.org" source: hosted - version: "0.0.4+2" + version: "0.0.4+3" shared_preferences: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 2a9f2e73..aba2d876 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -59,6 +59,9 @@ dependencies: #Dependency Injection get_it: ^4.0.2 + #chart + fl_chart: ^0.12.1 + #GIF image flutter_gifimage: ^1.0.1 From 6bab2e0b2de76fb74a8efbc1c300bcf672bee5a9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 14 Jan 2021 16:45:52 +0200 Subject: [PATCH 167/421] fix referral patient issue --- lib/config/localized_values.dart | 3 +++ lib/core/viewModel/SOAP_view_model.dart | 11 ++++++--- lib/models/patient/patiant_info_model.dart | 12 +++++----- lib/screens/patients/patients_screen.dart | 8 +++++-- lib/util/translations_delegate_base.dart | 3 +++ .../profile/patient-page-header-widget.dart | 6 ++++- .../profile/patient_profile_widget.dart | 2 +- .../profile/profile_medical_info_widget.dart | 10 ++++---- .../subjective/update_subjective_page.dart | 16 +++++++++---- .../soap_update/update_objective_page.dart | 24 ++++++++++++------- 10 files changed, 65 insertions(+), 30 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d60de738..12847967 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -546,4 +546,7 @@ const Map> localizedValues = { 'ar': "لا توجد تفاصيل لهذا المريض" }, 'doc': {'en': "Doc :", 'ar':" د: " }, + 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, + 'normal': {'en': "Normal", 'ar':"عادي" }, + 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, }; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index e3daf6e9..03500740 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -246,10 +246,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - String getAllergicNames(){ - String allergiesString=''; + String getAllergicNames(isArabic) { + String allergiesString = ''; patientAllergiesList.forEach((element) { - allergiesString += element.allergyDiseaseName+' , '; + MasterKeyModel selectedAllergy = getOneMasterKey( + masterKeys: MasterKeysService.Allergies, + id: element.allergyDiseaseId, + typeId: element.allergyDiseaseType); + allergiesString += + (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; }); return allergiesString; } diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index e5b89cfa..1b3621c1 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -135,14 +135,14 @@ class PatiantInformtion { description: json["Description"]?? json["description"], clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"]?? json["nationalityName"], - nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"], + nationalityName: json["NationalityName"]?? json["nationalityName"]??json['NationalityName'], + nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"]??json['NationalityNameN'], age: json["Age"]?? json["age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', startTime: json["StartTime"], - appointmentNo :json['appointmentNo'], + appointmentNo :json['appointmentNo'] ?? json['AppointmentNo'], appointmentType :json['appointmentType'], arrivedOn :json['arrivedOn'], clinicGroupId :json['clinicGroupId'], @@ -150,12 +150,12 @@ class PatiantInformtion { dischargeStatus :json['dischargeStatus'], doctorDetails :json['doctorDetails'], endTime :json['endTime'], - episodeNo :json['episodeNo'], + episodeNo :json['episodeNo'] ?? json['EpisodeID'], fallRiskScore :json['fallRiskScore'], isSigned :json['isSigned'], medicationOrders :json['medicationOrders'], - nationality :json['nationality'], - patientMRN :json['patientMRN'], + nationality :json['nationality']??json['NationalityNameN'], + patientMRN :json['patientMRN'] ?? json['PatientMRN'], ); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0c2a53d4..3083a779 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -486,6 +486,7 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment .spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Column( crossAxisAlignment: @@ -500,11 +501,14 @@ class _PatientsScreenState extends State { fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), + AppText( item.patientId.toString(), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, backGroundcolor: Colors.white, + ),SizedBox( + width: 10, ), ], ), @@ -513,8 +517,8 @@ class _PatientsScreenState extends State { 2.5, ), AppText( - 'NATIONALITY: ' + - item.nationalityName.toString(), + TranslationBase.of(context).nationality +" : "+( + item.nationalityName??item.nationality), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 74b13864..699267f1 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -560,6 +560,9 @@ class TranslationBase { String get addExamination => localizedValues['addExamination'][locale.languageCode]; String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; String get doc => localizedValues['doc'][locale.languageCode]; + String get allergicTO=> localizedValues['allergicTO'][locale.languageCode]; + String get normal=> localizedValues['normal'][locale.languageCode]; + String get abnormal=> localizedValues['abnormal'][locale.languageCode]; } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index a6c47a7f..fd7fd0d8 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widg import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; class PatientPageHeaderWidget extends StatelessWidget { @@ -16,6 +18,8 @@ class PatientPageHeaderWidget extends StatelessWidget { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( @@ -83,7 +87,7 @@ class PatientPageHeaderWidget extends StatelessWidget { NetworkBaseView( baseViewModel: model, child: model.patientAllergiesList.isNotEmpty ?AppText( - "ALLERGIC TO: "+model.getAllergicNames(), + TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, ) : AppText(''), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 7f49c868..a58a4a38 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -141,7 +141,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - patient.nationalityName, + patient.nationalityName ??patient.nationality , fontWeight: FontWeight.normal, fontSize: 1.7 * SizeConfig.textMultiplier, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 19989ecd..e9956453 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -36,7 +36,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - if (int.parse(patientType) == 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -57,7 +57,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png' ), - if(int.parse(patientType) ==7) + if(int.parse(patientType) ==7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -101,7 +101,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - if (selectedPatientType == 7) + if (selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -123,7 +123,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: 'Order Test', nameLine2: 'Or Procedures', icon: 'lab.png'), - if(selectedPatientType == 7) + if(selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -159,7 +159,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { .of(context) .leave, icon: 'sick_leaves_icons.png'), - if( selectedPatientType == 7) + if( selectedPatientType == 7|| int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index de5d2d68..c998f932 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -160,10 +160,18 @@ class _UpdateSubjectivePageState extends State { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - MasterKeyModel selectedAllergySeverity = model.getOneMasterKey( - masterKeys: MasterKeysService.AllergySeverity, - id: element.severity, - ); + MasterKeyModel selectedAllergySeverity; + if (element.severity == 0) { + selectedAllergySeverity = MasterKeyModel( + id: 0, + typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); + } else { + selectedAllergySeverity = model.getOneMasterKey( + masterKeys: MasterKeysService.AllergySeverity, + id: element.severity, + ); + } + MySelectedAllergy mySelectedAllergy = MySelectedAllergy( selectedAllergy: selectedAllergy, isChecked: element.isChecked, diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 9bd38666..ab1abd21 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -1,9 +1,10 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetPhysicalExamReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -24,6 +25,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; @@ -38,7 +40,6 @@ class UpdateObjectivePage extends StatefulWidget { class _UpdateObjectivePageState extends State { bool isSysExaminationExpand = false; - TextEditingController remarksController = TextEditingController(); BoxDecoration containerBorderDecoration( Color containerColor, Color borderColor) { @@ -55,9 +56,11 @@ class _UpdateObjectivePageState extends State { @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async { + widget.mySelectedExamination.clear(); GetPhysicalExamReqModel getPhysicalExamReqModel = GetPhysicalExamReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -165,7 +168,9 @@ class _UpdateObjectivePageState extends State { Column( children: widget.mySelectedExamination.map((examination) { - return Container( + TextEditingController remarksController= TextEditingController(text :examination.remark); + + return Container( margin: EdgeInsets.only( left: 15, right: 15, top: 15), child: Column(children: [ @@ -174,8 +179,8 @@ class _UpdateObjectivePageState extends State { MainAxisAlignment.spaceBetween, children: [ Texts( - examination - .selectedExamination.nameEn + ( examination + .selectedExamination.nameEn ) .toUpperCase(), variant: "bodyText", bold: true, @@ -212,7 +217,7 @@ class _UpdateObjectivePageState extends State { const EdgeInsets .all(8.0), child: Text( - "Normal", + TranslationBase.of(context).normal, style: TextStyle( fontSize: 12, color: @@ -262,7 +267,7 @@ class _UpdateObjectivePageState extends State { const EdgeInsets .all(8.0), child: Text( - "Abnormal", + TranslationBase.of(context).abnormal, style: TextStyle( fontSize: 12, color: @@ -315,7 +320,10 @@ class _UpdateObjectivePageState extends State { fontWeight: FontWeight.w600, maxLines: 25, minLines: 4, - // controller: remarksController, + controller: remarksController, + onChanged: (val) { + examination.remark = val; + }, validator: (value) { if (value == null) return TranslationBase.of(context) From 4b54ca7d473e1c090322576327af249beba6c618 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 14 Jan 2021 17:53:46 +0200 Subject: [PATCH 168/421] prescription --- lib/landing_page.dart | 4 +- .../prescription/prescription_screen.dart | 62 ++++++++++++++----- 2 files changed, 48 insertions(+), 18 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index edfc496c..9d4bfbb0 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -65,8 +65,8 @@ class _LandingPageState extends State { builder: Builder(builder: (context) => DashboardScreen()), ), MessagesScreen(), - //MyScheduleScreen(), - NewPrescriptionScreen(), + MyScheduleScreen(), + //NewPrescriptionScreen(), ServicesScreen() ], ), diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 45e5173f..54e31f12 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -453,6 +453,27 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( + dose: model + .prescriptionList[ + 0] + .entityList[ + index] + .doseTimingID + .toString(), + frequency: model + .prescriptionList[ + 0] + .entityList[ + index] + .frequencyID + .toString(), + rouat: model + .prescriptionList[ + 0] + .entityList[ + index] + .routeID + .toString(), patient: patient, drugId: model @@ -466,7 +487,7 @@ class _NewPrescriptionScreenState extends State { 0] .entityList[ index] - .medicationName, + .doseDetail, remarks: model .prescriptionList[ 0] @@ -571,13 +592,17 @@ class _NewPrescriptionScreenState extends State { } } - void updatePrescriptionForm( - {context, - String drugName, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient}) { + void updatePrescriptionForm({ + context, + String drugName, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient, + String rouat, + String frequency, + String dose, + }) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); @@ -587,11 +612,11 @@ class _NewPrescriptionScreenState extends State { isScrollControlled: true, builder: (BuildContext bc) { return Container( - height: 600, + height: MediaQuery.of(context).size.height * 0.73, child: Form( child: Padding( padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -626,7 +651,7 @@ class _NewPrescriptionScreenState extends State { border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), child: TextFields( - hintText: 'Dose', + hintText: 'Dose Time', controller: doseController, keyboardType: TextInputType.number, ), @@ -649,7 +674,6 @@ class _NewPrescriptionScreenState extends State { SizedBox( height: 12.0, ), - AppText('Remarks'), Container( decoration: BoxDecoration( borderRadius: @@ -667,7 +691,7 @@ class _NewPrescriptionScreenState extends State { height: 12.0, ), SizedBox( - height: 140.0, + height: MediaQuery.of(context).size.height * 0.12, ), Container( margin: @@ -679,6 +703,9 @@ class _NewPrescriptionScreenState extends State { title: 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( + doseId: dose, + frequencyId: frequency, + routeId: rouat, patient: patient, model: model, drugId: drugId, @@ -704,10 +731,13 @@ class _NewPrescriptionScreenState extends State { updatePrescription( {PrescriptionViewModel model, int drugId, + String frequencyId, String remarks, String dose, + String doseId, String frequency, String route, + String routeId, PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = @@ -725,12 +755,12 @@ class _NewPrescriptionScreenState extends State { dose: frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, doseUnitId: 1, - route: frequency.isNotEmpty ? int.parse(route) : 1, - frequency: frequency.isNotEmpty ? int.parse(frequency) : 1, + route: route.isNotEmpty ? int.parse(route) : routeId, + frequency: frequency.isNotEmpty ? int.parse(frequency) : frequencyId, remarks: remarks.isEmpty ? '' : remarks, approvalRequired: true, icdcode10Id: "test2", - doseTime: 1, + doseTime: dose.isNotEmpty ? int.parse(frequency) : doseId, duration: 2, doseStartDate: "2020-12-20T13:07:41.769Z")); updatePrescriptionReqModel.prescriptionRequestModel = sss; From debcad3a3d44fa11a9d775d4d452b44314cf470f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 14 Jan 2021 23:59:20 +0200 Subject: [PATCH 169/421] prescription --- .../prescription/prescription_screen.dart | 63 +++++++++---------- pubspec.lock | 6 +- 2 files changed, 34 insertions(+), 35 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 54e31f12..df8c0e17 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -453,6 +453,9 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( + startDate: + model.prescriptionList[0].entityList[index].startDate + .toString(), dose: model .prescriptionList[ 0] @@ -460,13 +463,9 @@ class _NewPrescriptionScreenState extends State { index] .doseTimingID .toString(), - frequency: model - .prescriptionList[ - 0] - .entityList[ - index] - .frequencyID - .toString(), + frequency: + model.prescriptionList[0].entityList[index].frequencyID + .toString(), rouat: model .prescriptionList[ 0] @@ -489,15 +488,11 @@ class _NewPrescriptionScreenState extends State { index] .doseDetail, remarks: model - .prescriptionList[ - 0] - .entityList[ - index] + .prescriptionList[0] + .entityList[index] .remarks, - model: - model, - context: - context); + model: model, + context: context); //model.postPrescription(); }, ), @@ -592,17 +587,17 @@ class _NewPrescriptionScreenState extends State { } } - void updatePrescriptionForm({ - context, - String drugName, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - }) { + void updatePrescriptionForm( + {context, + String drugName, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient, + String rouat, + String frequency, + String dose, + String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); TextEditingController frequencyController = TextEditingController(); @@ -703,6 +698,7 @@ class _NewPrescriptionScreenState extends State { title: 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( + startDate: startDate, doseId: dose, frequencyId: frequency, routeId: rouat, @@ -738,6 +734,7 @@ class _NewPrescriptionScreenState extends State { String frequency, String route, String routeId, + String startDate, PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = @@ -752,17 +749,19 @@ class _NewPrescriptionScreenState extends State { "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; sss.add(PrescriptionRequestModel( covered: true, - dose: frequency.isNotEmpty ? int.parse(dose) : 1, + dose: 9, //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: 1, - route: route.isNotEmpty ? int.parse(route) : routeId, - frequency: frequency.isNotEmpty ? int.parse(frequency) : frequencyId, + doseUnitId: 2, + route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), + frequency: frequency.isNotEmpty + ? int.parse(frequency) + : int.parse(frequencyId), remarks: remarks.isEmpty ? '' : remarks, approvalRequired: true, icdcode10Id: "test2", - doseTime: dose.isNotEmpty ? int.parse(frequency) : doseId, + doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), duration: 2, - doseStartDate: "2020-12-20T13:07:41.769Z")); + doseStartDate: startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; diff --git a/pubspec.lock b/pubspec.lock index 7f1d8c1d..5650f5f9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -503,7 +503,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -760,7 +760,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -895,5 +895,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From b0410dc74430b3efc9b050206a8e9b8225db8449 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 15 Jan 2021 00:32:21 +0200 Subject: [PATCH 170/421] Procedure updates --- .../entity_list_checkbox_search_widget.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 273 +++++++++--------- 2 files changed, 145 insertions(+), 130 deletions(-) diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 78f584f6..0a04124f 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -61,7 +61,7 @@ class _EntityListCheckboxSearchWidgetState child: ListView( children: [ TextFields( - hintText: 'Search ', + hintText: 'Search Procedure', suffixIcon: EvaIcons.search, onChanged: (value) { filterSearchResults(value); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 60a04480..6955508c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -568,139 +568,154 @@ class _AddSelectedProcedureState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( baseViewModel: model, - child: SingleChildScrollView( - child: Container( - height: 810, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - 'Select Procedure'.toUpperCase(), - fontWeight: FontWeight.w900, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: - selectedCategory['categoryName']); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'Procedure Categorey', - selectedCategory != null - ? selectedCategory['categoryName'] + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'Search Procedure Category'.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 5.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + model.categoryList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.categoryList, + attributeName: 'categoryName', + attributeValueId: 'categoryId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + selectedCategory = selectedValue; + model.getProcedureCategory( + categoryName: selectedCategory[ + 'categoryName']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + //model.getProcedureCategory(); + } : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) - EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order Type'.toUpperCase(), - controller: procedureController, + child: TextField( + decoration: textFieldSelectorDecoration( + 'Procedure Categorey', + selectedCategory != null + ? selectedCategory['categoryName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, + ), + ), ), - ), - SizedBox( - height: 15.0, - ), - TextFields( - hintText: 'Remarks', - controller: remarksController, - minLines: 3, - maxLines: 5, - ), - SizedBox( - height: 50.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'add Selected Procedures'.toUpperCase(), - onPressed: () { - Navigator.pop(context); - postProcedure( - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), ), - ], + ), + SizedBox( + height: 15.0, ), - ), - ], - ) - ], - ), - ), - ), - ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: 'Order Type'.toUpperCase(), + controller: procedureController, + ), + ), + SizedBox( + height: 15.0, + ), + TextFields( + hintText: 'Remarks', + controller: remarksController, + minLines: 3, + maxLines: 5, + ), + SizedBox( + height: 50.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + 'add Selected Procedures'.toUpperCase(), + onPressed: () { + Navigator.pop(context); + postProcedure( + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), ), ); } @@ -760,7 +775,7 @@ void updateProcedureForm(context, isScrollControlled: true, builder: (BuildContext bc) { return Container( - height: 400, + height: MediaQuery.of(context).size.height * 0.55, child: Form( child: Padding( padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), From eae0bb443f4df876b8181507a88b020f0a04dcbc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 17 Jan 2021 14:50:56 +0200 Subject: [PATCH 171/421] solve problem with vital signs charts depend on date --- .../vital_sign_details_blood_pressurewideget.dart | 4 +++- .../vital_sign/vital_sign_details_wideget.dart | 4 +++- .../vital_sign/vital_sing_chart_and_detials.dart | 4 +++- .../vital_sign/vital_sing_chart_blood_pressure.dart | 11 +++++++---- lib/util/date-utils.dart | 8 +++++++- pubspec.lock | 6 +++--- 6 files changed, 26 insertions(+), 11 deletions(-) diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart index df7b80d6..693507bb 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart @@ -101,6 +101,8 @@ class _VitalSignDetailsWidgetState extends State { ])); widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey1]; + DateTime elementDate = + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -109,7 +111,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart index 8e936f1e..11a24e42 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart @@ -89,6 +89,8 @@ class _VitalSignDetailsWidgetState extends State { ])); widget.vitalList.forEach((vital) { var data = vital.toJson()[widget.viewKey]; + DateTime elementDate = + DateUtils.getDateTimeFromServerFormat(vital.createdOn); if (data != 0) tableRow.add(TableRow(children: [ Container( @@ -97,7 +99,7 @@ class _VitalSignDetailsWidgetState extends State { color: Colors.white, child: Center( child: AppText( - '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtils.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(vital.vitalSignDate.month) : DateUtils.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ', + '${projectViewModel.isArabic ? DateUtils.getWeekDayArabic(elementDate.weekday) : DateUtils.getWeekDay(elementDate.weekday)}, ${elementDate.day} ${projectViewModel.isArabic ? DateUtils.getMonthArabic(elementDate.month) : DateUtils.getMonth(elementDate.month)}, ${elementDate.year} ', textAlign: TextAlign.center, ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index 8856e5fe..cc93c77b 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; @@ -49,10 +50,11 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { + DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn); if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) timeSeriesData.add( TimeSeriesSales2( - new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day), + new DateTime(elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey].toDouble(), ), ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart index b94c4ab1..dd9f940f 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_blood_pressure.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_blood_pressurewideget.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/widgets/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; import 'package:flutter/material.dart'; @@ -62,19 +63,21 @@ class VitalSingChartBloodPressure extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { + DateTime elementDate = + DateUtils.getDateTimeFromServerFormat(element.createdOn); if (element.toJson()[viewKey1]?.toInt() != 0) timeSeriesData1.add( TimeSeriesSales2( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey1].toDouble(), ), ); if (element.toJson()[viewKey2]?.toInt() != 0) timeSeriesData2.add( TimeSeriesSales2( - new DateTime(element.vitalSignDate.year, - element.vitalSignDate.month, element.vitalSignDate.day), + new DateTime( + elementDate.year, elementDate.month, elementDate.day), element.toJson()[viewKey2].toDouble(), ), ); diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index df52b1fd..a624dd2c 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -12,6 +12,12 @@ class DateUtils { } static convertDateFromServerFormat(String str, dateFormat) { + var date = getDateTimeFromServerFormat(str); + + return DateFormat(dateFormat).format(date); + } + + static DateTime getDateTimeFromServerFormat(String str) { const start = "/Date("; const end = "+0300)"; @@ -23,7 +29,7 @@ class DateUtils { var date = new DateTime.fromMillisecondsSinceEpoch( int.parse(str.substring(startIndex + start.length, endIndex))); - return DateFormat(dateFormat).format(date); + return date; } static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate) { diff --git a/pubspec.lock b/pubspec.lock index 77edb88a..55a6e826 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -552,7 +552,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: @@ -823,7 +823,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: @@ -958,5 +958,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 e67233bb21d40144791adc960a74aa328d0a75c1 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 17 Jan 2021 16:28:48 +0200 Subject: [PATCH 172/421] medical dile & Order Procedure translation --- lib/config/localized_values.dart | 33 ++- lib/screens/dashboard_screen.dart | 2 +- .../medical-file/medical_file_details.dart | 58 ++-- .../medical-file/medical_file_page.dart | 22 +- .../prescription/add_prescription_form.dart | 22 +- .../entity_list_checkbox_search_widget.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 276 +++++++++++------- lib/util/translations_delegate_base.dart | 43 ++- .../profile/profile_medical_info_widget.dart | 103 +++---- 9 files changed, 356 insertions(+), 206 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4ad53ebe..2b6b86de 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -536,9 +536,32 @@ const Map> localizedValues = { 'en': "There is no Chief Complaint", 'ar': "ليس هناك شكوى رئيس" }, - 'addAssessment': {'en': "Add ASSESSMENT", 'ar':"أضف التقييم" }, - 'assessment': {'en': "ASSESSMENT", 'ar':" التقييم" }, - 'physicalSystemExamination': {'en': "Physical/System Examination", 'ar':" الفحص البدني / النظام" }, - 'searchExamination': {'en': "Search Examination", 'ar':"فحص البحث" }, - 'addExamination': {'en': "Add Examination", 'ar':"اضافه" }, + 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, + 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, + 'physicalSystemExamination': { + 'en': "Physical/System Examination", + 'ar': " الفحص البدني / النظام" + }, + 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, + 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, + 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, + 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, + 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, + 'regular': {'en': "Regular", 'ar': "اعتيادي"}, + 'addMoreProcedure': { + 'en': "Add More Procedures", + 'ar': "اضف المزيد من العمليات" + }, + 'searchProcedures': {'en': "Search Procedures", 'ar': "البحث في العمليات"}, + 'selectProcedures': {'en': "Select procedure", 'ar': "اختر العملية"}, + 'procedureCategorise': { + 'en': "Select Procedure Category", + 'ar': "اختر صنف العمليات " + }, + 'addSelectedProcedures': { + 'en': "add Selected Procedures", + 'ar': "اضافة العمليات المختارة " + }, + 'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"}, + 'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 20f22382..7187641d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -78,7 +78,7 @@ class _DashboardScreenState extends State { currentFocus.unfocus(); } return BaseView( - onModelReady: (model) => model.getDashboard(), + //onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index e11201e5..d445f471 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -66,7 +66,7 @@ class _MedicalFileDetailsState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'medical file'.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -141,7 +141,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Visit Date : ', + TranslationBase.of(context).visitDate + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -174,7 +175,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Doctor : '.toUpperCase(), + TranslationBase.of(context).doctorName + + ": ".toUpperCase(), fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -203,7 +205,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Clinic : ', + TranslationBase.of(context).clinicName + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -229,7 +232,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ AppText( - 'Episode Number : ', + TranslationBase.of(context).episode + + ": ", fontWeight: FontWeight.w700, ), if (model.medicalFileList.length != 0 && @@ -277,7 +281,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ Texts( - 'History of present illness' + TranslationBase.of(context) + .historyOfPresentIllness .toUpperCase(), variant: isHistoryExpand ? "bodyText" @@ -376,7 +381,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts('assessment'.toUpperCase(), + Texts( + TranslationBase.of(context) + .assessment + .toUpperCase(), variant: isAssessmentExpand ? "bodyText" : '', @@ -554,7 +562,8 @@ class _MedicalFileDetailsState extends State { Row( children: [ Texts( - 'Test / procedures' + TranslationBase.of(context) + .test .toUpperCase(), variant: isProcedureExpand ? "bodyText" @@ -638,18 +647,22 @@ class _MedicalFileDetailsState extends State { ), Row( children: [ - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[index] - .procName, - fontWeight: - FontWeight.w700, + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight.w700, + ), ) ], ), @@ -717,7 +730,10 @@ class _MedicalFileDetailsState extends State { children: [ Row( children: [ - Texts('physical exam'.toUpperCase(), + Texts( + TranslationBase.of(context) + .physicalSystemExamination + .toUpperCase(), variant: isPhysicalExam ? "bodyText" : '', diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 1e3b4739..069dfbc2 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -27,7 +27,7 @@ class _MedicalFilePageState extends State { (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'medical Report'.toUpperCase(), + appBarTitle: TranslationBase.of(context).medicalReport.toUpperCase(), body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -93,6 +93,7 @@ class _MedicalFilePageState extends State { if (model.medicalFileList.length != 0) ListView.builder( //physics: , + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model @@ -108,7 +109,8 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Branch : ', + TranslationBase.of(context).branch + + ": ", fontWeight: FontWeight.w700, ), AppText(model @@ -121,13 +123,19 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Doctor : '.toUpperCase(), + TranslationBase.of(context) + .doctorName + .toUpperCase() + + ": ", fontWeight: FontWeight.w700, ), Expanded( child: AppText( - model.medicalFileList[0].entityList[0] - .timelines[index].doctorName, + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, fontWeight: FontWeight.w700, ), ), @@ -136,7 +144,9 @@ class _MedicalFilePageState extends State { Row( children: [ AppText( - 'Clinic : ', + TranslationBase.of(context) + .clinicName + + ": ", fontWeight: FontWeight.w700, ), AppText( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 1b4d7e2d..c8ff6ce2 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -92,6 +92,7 @@ class PrescriptionFormWidget extends StatefulWidget { } class _PrescriptionFormWidgetState extends State { + int selectedType; TextEditingController durationController = TextEditingController(); TextEditingController strengthController = TextEditingController(); TextEditingController routeController = TextEditingController(); @@ -126,6 +127,7 @@ class _PrescriptionFormWidgetState extends State { @override void initState() { super.initState(); + selectedType = 1; referToList = List(); strengthList = List(); routeList = List(); @@ -251,6 +253,12 @@ class _PrescriptionFormWidgetState extends State { referToList.add(urgentOrder); } + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -343,10 +351,22 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ AppText('Order Type'), - Radio(), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), Text('Regular'), Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, value: 1, + onChanged: (value) { + setSelectedType(value); + }, ), Text('Urgent'), ], diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 0a04124f..4f236a4b 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -61,7 +62,7 @@ class _EntityListCheckboxSearchWidgetState child: ListView( children: [ TextFields( - hintText: 'Search Procedure', + hintText: TranslationBase.of(context).searchProcedures, suffixIcon: EvaIcons.search, onChanged: (value) { filterSearchResults(value); diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 6955508c..31eb99e9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -33,8 +33,15 @@ class ProcedureScreen extends StatefulWidget { } class _ProcedureScreenState extends State { + int selectedType = 0; int testNum = 1; PatiantInformtion patient; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + TextEditingController procedureController = TextEditingController(); @override Widget build(BuildContext context) { @@ -45,7 +52,7 @@ class _ProcedureScreenState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => AppScaffold( isShowAppBar: true, - appBarTitle: 'ORDER PROCEDURE', + appBarTitle: TranslationBase.of(context).orderProcedure, body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( @@ -199,7 +206,8 @@ class _ProcedureScreenState extends State { .spaceBetween, children: [ AppText( - ' Add more procedure', + TranslationBase.of(context) + .addMoreProcedure, fontWeight: FontWeight.w100, fontSize: 12.5, ), @@ -275,7 +283,10 @@ class _ProcedureScreenState extends State { Row( children: [ AppText( - 'Code #: ', + TranslationBase.of( + context) + .codeNo + + " : ", fontWeight: FontWeight .w700, @@ -297,7 +308,10 @@ class _ProcedureScreenState extends State { width: 12.0, ), AppText( - 'Order Type: ', + TranslationBase.of( + context) + .orderType + + " : ", fontWeight: FontWeight .w700, @@ -312,8 +326,8 @@ class _ProcedureScreenState extends State { : 'Urgent', fontSize: 13.0, - color: Colors - .red, + color: Color( + 0xFFB9382C), ), ], ), @@ -342,7 +356,10 @@ class _ProcedureScreenState extends State { Row( children: [ AppText( - 'Price: ', + TranslationBase.of( + context) + .price + + " : ", fontWeight: FontWeight .w700, @@ -409,6 +426,12 @@ class _ProcedureScreenState extends State { onTap: () { updateProcedureForm( context, + remarks: model + .procedureList[ + 0] + .entityList[ + index] + .remarks, procedureName: model .procedureList[ 0] @@ -452,6 +475,109 @@ class _ProcedureScreenState extends State { )), ); } + + void updateProcedureForm(context, + {String procedureName, + PatiantInformtion patient, + String procedureId, + String remarks, + String categoreId}) { + ProcedureViewModel model = ProcedureViewModel(); + TextEditingController remarksController = TextEditingController(); + TextEditingController orderController = TextEditingController(); + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return Container( + height: MediaQuery.of(context).size.height * 0.55, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: remarks, + controller: remarksController, + maxLines: 5, + minLines: 3, + ), + ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + Navigator.pop(context); + updateProcedure( + categorieId: categoreId, + procedureId: procedureId, + patient: patient, + model: model, + remarks: remarksController.text); + // authorizationForm(context); + }, + ), + ], + ), + ), + ], + ), + ), + )); + }); + } } postProcedure( @@ -553,6 +679,7 @@ class AddSelectedProcedure extends StatefulWidget { } class _AddSelectedProcedureState extends State { + int selectedType; ProcedureViewModel model; PatiantInformtion patient; _AddSelectedProcedureState({this.patient, this.model}); @@ -560,6 +687,12 @@ class _AddSelectedProcedureState extends State { TextEditingController remarksController = TextEditingController(); List entityList = List(); dynamic selectedCategory; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + @override Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; @@ -582,11 +715,13 @@ class _AddSelectedProcedureState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - 'Search Procedure Category'.toUpperCase(), + TranslationBase.of(context) + .selectProcedures + .toUpperCase(), fontWeight: FontWeight.w900, ), SizedBox( - height: 5.0, + height: 10.0, ), Container( height: screenSize.height * 0.070, @@ -620,7 +755,8 @@ class _AddSelectedProcedureState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - 'Procedure Categorey', + TranslationBase.of(context) + .procedureCategorise, selectedCategory != null ? selectedCategory['categoryName'] : null, @@ -665,21 +801,36 @@ class _AddSelectedProcedureState extends State { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order Type'.toUpperCase(), - controller: procedureController, + child: Row( + children: [ + AppText( + TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + ], ), ), SizedBox( height: 15.0, ), TextFields( - hintText: 'Remarks', + hintText: TranslationBase.of(context).remarks, controller: remarksController, minLines: 3, maxLines: 5, @@ -694,8 +845,8 @@ class _AddSelectedProcedureState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: - 'add Selected Procedures'.toUpperCase(), + title: TranslationBase.of(context) + .addSelectedProcedures, onPressed: () { Navigator.pop(context); postProcedure( @@ -761,86 +912,3 @@ class _AddSelectedProcedureState extends State { ); } } - -void updateProcedureForm(context, - {String procedureName, - PatiantInformtion patient, - String procedureId, - String categoreId}) { - ProcedureViewModel model = ProcedureViewModel(); - TextEditingController remarksController = TextEditingController(); - TextEditingController orderController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: MediaQuery.of(context).size.height * 0.55, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Order ', - controller: orderController, - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Remarks', - controller: remarksController, - maxLines: 5, - minLines: 3, - ), - ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'Update procedure'.toUpperCase(), - onPressed: () { - Navigator.pop(context); - updateProcedure( - categorieId: categoreId, - procedureId: procedureId, - patient: patient, - model: model, - remarks: remarksController.text); - // authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); -} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index e6b5dbd5..4c03e7b4 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -544,20 +544,47 @@ class TranslationBase { localizedValues['referralEmptyMsg'][locale.languageCode]; String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; - String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get diagnoseType => + localizedValues['diagnoseType'][locale.languageCode]; String get condition => localizedValues['condition'][locale.languageCode]; String get id => localizedValues['id'][locale.languageCode]; String get quantity => localizedValues['quantity'][locale.languageCode]; String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode]; - String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; - String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; - String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get approvalRequired => + localizedValues['approvalRequired'][locale.languageCode]; + String get uncoveredByDoctor => + localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get addAssessment => + localizedValues['addAssessment'][locale.languageCode]; String get assessment => localizedValues['assessment'][locale.languageCode]; - String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get chiefComplaintEmptyMsg => + localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; + String get physicalSystemExamination => + localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => + localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => + localizedValues['addExamination'][locale.languageCode]; + String get medicalReport => + localizedValues['medicalReport'][locale.languageCode]; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String get test => localizedValues['test'][locale.languageCode]; + String get addMoreProcedure => + localizedValues['addMoreProcedure'][locale.languageCode]; + String get regular => localizedValues['regular'][locale.languageCode]; + String get searchProcedures => + localizedValues['searchProcedures'][locale.languageCode]; + String get procedureCategorise => + localizedValues['procedureCategorise'][locale.languageCode]; + String get selectProcedures => + localizedValues['selectProcedures'][locale.languageCode]; + String get addSelectedProcedures => + localizedValues['addSelectedProcedures'][locale.languageCode]; + String get updateProcedure => + localizedValues['updateProcedure'][locale.languageCode]; + String get orderProcedure => + localizedValues['orderProcedure'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index c39c7c95..5c26a39a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -19,7 +19,7 @@ import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { ProfileMedicalInfoWidget({Key key, this.patient, this.patientType}); PatiantInformtion patient; - String patientType; + String patientType; @override Widget build(BuildContext context) { return SliverGrid.count( @@ -28,38 +28,39 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - icon: 'create-episod.png'), - if(int.parse(patientType) ==7) - PatientProfileButton( - key: key, - patient: patient, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + icon: 'create-episod.png'), + if (int.parse(patientType) == 7) + PatientProfileButton( + key: key, + patient: patient, + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, + route: UPDATE_EPISODE, + icon: 'modilfy-episode.png'), PatientProfileButton( key: key, patient: patient, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: (selectedPatientType == 6 || selectedPatientType == 7) ? PATIENT_VITAL_SIGN : VITAL_SIGN_DETAILS, + route: (selectedPatientType == 6 || selectedPatientType == 7) + ? PATIENT_VITAL_SIGN + : VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), - if(selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), - + if (selectedPatientType != 7) + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -87,63 +88,47 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: ORDER_PRESCRIPTION, - nameLine1: 'Order', - nameLine2: 'Prescription', + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, route: ORDER_PROCEDURE, - nameLine1: 'Order Test', - nameLine2: 'Or Procedures', + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - if(selectedPatientType == 7) + if (selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase - .of(context) - .myReferral, - nameLine2: TranslationBase - .of(context) - .patient, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - if(selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5) PatientProfileButton( key: key, patient: patient, route: PATIENT_ORDERS, - nameLine1: TranslationBase - .of(context) - .orders, - nameLine2: TranslationBase - .of(context) - .list, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).list, icon: 'radiology-1.png'), - if(selectedPatientType != 0 && selectedPatientType != 5) + if (selectedPatientType != 0 && selectedPatientType != 5) PatientProfileButton( key: key, patient: patient, route: ADD_SICKLEAVE, - nameLine1: TranslationBase - .of(context) - .patientSick, - nameLine2: TranslationBase - .of(context) - .leave, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - if( selectedPatientType == 7) + if (selectedPatientType == 7) PatientProfileButton( key: key, patient: patient, route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase - .of(context) - .patient, - nameLine2: TranslationBase - .of(context) - .ucaf, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, icon: 'lab.png'), ]); } From 1fa52e0394b141aef371c73e6708c21695c6b7ea Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 17 Jan 2021 16:39:20 +0200 Subject: [PATCH 173/421] medical dile & Order Procedure translation --- lib/config/localized_values.dart | 18 ++----------- lib/util/translations_delegate_base.dart | 15 ++++------- .../profile/profile_medical_info_widget.dart | 25 +++++++++++++------ pubspec.lock | 2 +- 4 files changed, 25 insertions(+), 35 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 426a309b..df7cea74 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -587,14 +587,8 @@ const Map> localizedValues = { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" }, - "systolic-lng": { - "en": "Systolic", - "ar": "الإنقباض" - }, - "diastolic-lng": { - "en": "Diastolic", - "ar": "الإنبساط" - }, + "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, + "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, "temp-c": {"en": "°C", "ar": "°س"}, "bpm": {"en": "bpm", "ar": "نبضة"}, @@ -603,14 +597,6 @@ const Map> localizedValues = { "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, 'heart': {'en': 'Heart', 'ar': 'قلب'}, - 'addAssessment': {'en': "Add ASSESSMENT", 'ar': "أضف التقييم"}, - 'assessment': {'en': "ASSESSMENT", 'ar': " التقييم"}, - 'physicalSystemExamination': { - 'en': "Physical/System Examination", - 'ar': " الفحص البدني / النظام" - }, - 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, - 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index aae8e091..c3df9d86 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -612,8 +612,10 @@ class TranslationBase { String get doc => localizedValues['doc'][locale.languageCode]; String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; - String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; - String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get systolicLng => + localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => + localizedValues['diastolic-lng'][locale.languageCode]; String get mass => localizedValues['mass'][locale.languageCode]; String get tempC => localizedValues['temp-c'][locale.languageCode]; String get bpm => localizedValues['bpm'][locale.languageCode]; @@ -624,14 +626,7 @@ class TranslationBase { String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; String get heart => localizedValues['heart'][locale.languageCode]; - String get chiefComplaintEmptyMsg => - localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; - String get physicalSystemExamination => - localizedValues['physicalSystemExamination'][locale.languageCode]; - String get searchExamination => - localizedValues['searchExamination'][locale.languageCode]; - String get addExamination => - localizedValues['addExamination'][locale.languageCode]; + String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; String get visitDate => localizedValues['visitDate'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ad813be0..6085f938 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -27,8 +27,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ProfileMedicalInfoWidget( {Key key, this.patient, this.patientType, this.from, this.to}); + String from; + String to; + PatiantInformtion patient; - String patientType; + String patientType; @override Widget build(BuildContext context) { return BaseView( @@ -43,7 +46,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - isDisable: patient.episodeNo != 0 ? true : false,nameLine1: TranslationBase.of(context).createNew, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, nameLine2: TranslationBase.of(context).episode, route: CREATE_EPISODE, onTap: () async { @@ -55,15 +59,18 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Navigator.of(context).pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); }, - isLoading: model.state == ViewState.BusyLocal,icon: 'create-episod.png'), + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png'), if (int.parse(patientType) == 7) PatientProfileButton( key: key, patient: patient, - isDisable: patient.episodeNo == 0 ? true : false,nameLine1: TranslationBase.of(context).update, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase.of(context).update, nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'),if (int.parse(patientType) == 7) + icon: 'modilfy-episode.png'), + if (int.parse(patientType) == 7) PatientProfileButton( key: key, patient: patient, @@ -71,9 +78,11 @@ class ProfileMedicalInfoWidget extends StatelessWidget { to: to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN - */, - icon: 'heartbeat.png'), + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + */ + , + icon: 'heartbeat.png'), if (selectedPatientType != 7) PatientProfileButton( key: key, diff --git a/pubspec.lock b/pubspec.lock index 77edb88a..9d63a65c 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -510,7 +510,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: From bc8a90ef2c02e8cdf2ad4d86139696575028f4c0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 17 Jan 2021 19:43:25 +0200 Subject: [PATCH 174/421] first step from fix loader --- ios/Podfile.lock | 102 ++++++++++++++++++ lib/screens/dashboard_screen.dart | 2 +- .../profile/patient-page-header-widget.dart | 20 ++-- .../subjective/update_subjective_page.dart | 10 +- .../soap_update/update_assessment_page.dart | 10 +- .../soap_update/update_objective_page.dart | 13 ++- .../profile/soap_update/update_plan_page.dart | 6 +- .../soap_update/update_soap_index.dart | 23 +++- .../shared/loader/gif_loader_container.dart | 1 + lib/widgets/shared/network_base_view.dart | 5 +- 10 files changed, 167 insertions(+), 25 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 108205bf..40d9a06a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -13,11 +13,72 @@ PODS: - Flutter - device_info (0.0.1): - Flutter + - Firebase/CoreOnly (6.33.0): + - FirebaseCore (= 6.10.3) + - Firebase/Messaging (6.33.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 4.7.0) + - firebase_core (0.5.3): + - Firebase/CoreOnly (~> 6.33.0) + - Flutter + - firebase_core_web (0.1.0): + - Flutter + - firebase_messaging (7.0.3): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Messaging (~> 6.33.0) + - firebase_core + - Flutter + - FirebaseCore (6.10.3): + - FirebaseCoreDiagnostics (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - FirebaseCoreDiagnostics (1.7.0): + - GoogleDataTransport (~> 7.4) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - nanopb (~> 1.30906.0) + - FirebaseInstallations (1.7.0): + - FirebaseCore (~> 6.10) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - PromisesObjC (~> 1.2) + - FirebaseInstanceID (4.8.0): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - FirebaseMessaging (4.7.1): + - FirebaseCore (~> 6.10) + - FirebaseInstanceID (~> 4.7) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Reachability (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - Protobuf (>= 3.9.2, ~> 3.9) - Flutter (1.0.0) - flutter_flexible_toast (0.0.1): - Flutter - flutter_plugin_android_lifecycle (0.0.1): - Flutter + - GoogleDataTransport (7.5.1): + - nanopb (~> 1.30906.0) + - GoogleUtilities/AppDelegateSwizzler (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (6.7.2): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Network (6.7.2): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (6.7.2)" + - GoogleUtilities/Reachability (6.7.2): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (6.7.2): + - GoogleUtilities/Logger - hexcolor (0.0.1): - Flutter - imei_plugin (0.0.1): @@ -27,6 +88,11 @@ PODS: - maps_launcher (0.0.1): - Flutter - MTBBarcodeScanner (5.0.11) + - nanopb (1.30906.0): + - nanopb/decode (= 1.30906.0) + - nanopb/encode (= 1.30906.0) + - nanopb/decode (1.30906.0) + - nanopb/encode (1.30906.0) - OpenTok (2.15.3) - path_provider_linux (0.0.1): - Flutter @@ -34,6 +100,8 @@ PODS: - Flutter - "permission_handler (5.0.1+1)": - Flutter + - PromisesObjC (1.2.10) + - Protobuf (3.13.0) - Reachability (3.2) - shared_preferences (0.0.1): - Flutter @@ -68,6 +136,9 @@ DEPENDENCIES: - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - device_info (from `.symlinks/plugins/device_info/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) @@ -94,8 +165,19 @@ DEPENDENCIES: SPEC REPOS: trunk: - Alamofire + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseInstallations + - FirebaseInstanceID + - FirebaseMessaging + - GoogleDataTransport + - GoogleUtilities - MTBBarcodeScanner + - nanopb - OpenTok + - PromisesObjC + - Protobuf - Reachability - SwiftProtobuf - Try @@ -111,6 +193,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_macos/ios" device_info: :path: ".symlinks/plugins/device_info/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_core_web: + :path: ".symlinks/plugins/firebase_core_web/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter flutter_flexible_toast: @@ -161,18 +249,32 @@ SPEC CHECKSUMS: connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 + Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 + firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 + firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd + FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 + FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 + FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 + GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151 + Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 8787eb42..78a27f7e 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -70,7 +70,7 @@ class _DashboardScreenState extends State { DEVICE_TOKEN = token; var request = await sharedPref.getObj(DOCTOR_PROFILE); authProvider.insertDeviceImei(request).then((value) { - print(value['ReturnValue']); + // print(value['ReturnValue']); changeIsLoading(false); }); } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index fd7fd0d8..dd2698a9 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -29,6 +30,12 @@ class PatientPageHeaderWidget extends StatelessWidget { doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); + if (model.allergiesList.length == 0) { + await model.getMasterLookup(MasterKeysService.Allergies); + } + if (model.allergySeverityList.length == 0) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } }, builder: (_, model, w) => Container( @@ -84,14 +91,11 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - NetworkBaseView( - baseViewModel: model, - child: model.patientAllergiesList.isNotEmpty ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ) : AppText(''), - ), + model.patientAllergiesList.isNotEmpty ?AppText( + TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ) : AppText(''), ], ), ) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index c998f932..6f058792 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -30,6 +30,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; + final Function changeLoadingState; final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; @@ -39,7 +40,7 @@ class UpdateSubjectivePage extends StatefulWidget { this.changePageViewIndex, this.myAllergiesList, this.myHistoryList, - this.patientInfo}); + this.patientInfo, this.changeLoadingState}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -53,6 +54,7 @@ class _UpdateSubjectivePageState extends State { TextEditingController complaintsController = TextEditingController(); final formKey = GlobalKey(); getHistory(SOAPViewModel model) async{ + widget.changeLoadingState(true); GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), @@ -206,10 +208,13 @@ class _UpdateSubjectivePageState extends State { await getHistory(model); await getAllergies(model); + + widget.changeLoadingState(false); + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -463,6 +468,7 @@ class _UpdateSubjectivePageState extends State { helpers.showErrorToast(model.error); } } + widget.changeLoadingState(true); widget.changePageViewIndex(1); diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 93d56af2..05813d82 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -29,11 +29,12 @@ class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; List mySelectedAssessmentList; final PatiantInformtion patientInfo; + final Function changeLoadingState; UpdateAssessmentPage({Key key, this.changePageViewIndex, this.mySelectedAssessmentList, - this.patientInfo}); + this.patientInfo, this.changeLoadingState}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -92,10 +93,13 @@ class _UpdateAssessmentPageState extends State { widget.mySelectedAssessmentList.add(temMySelectedAssessment); }); } + + widget.changeLoadingState(false); + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -366,6 +370,8 @@ class _UpdateAssessmentPageState extends State { loading: model.state == ViewState.BusyLocal, onPressed: () async { widget.changePageViewIndex(3); + widget.changeLoadingState(true); + }, ), SizedBox( diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index ab1abd21..fe80a5c3 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -29,10 +29,12 @@ import 'package:provider/provider.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; + final Function changeLoadingState; + final List mySelectedExamination; final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); + {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, this.changeLoadingState}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -87,10 +89,13 @@ class _UpdateObjectivePageState extends State { widget.mySelectedExamination.add(tempEam); }); } + + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, + body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -402,9 +407,13 @@ class _UpdateObjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); } } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); // helpers.showErrorToast(TranslationBase.of(context).requiredMsg); diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index a3c2cdd2..d0e91c8d 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -21,8 +21,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; + final Function changeLoadingState; - UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo}); + UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -64,9 +65,10 @@ class _UpdatePlanPageState extends State { progressNoteController.text = helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); } + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, + // baseViewModel: model, isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 84b8cc61..8235f55a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -7,8 +6,8 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.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/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart'; @@ -30,7 +29,7 @@ class _UpdateSoapIndexState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 0; - List myAllergiesList= List(); + List myAllergiesList = List(); List myHistoryList = List(); List mySelectedExamination = List(); List mySelectedAssessment = List(); @@ -38,6 +37,8 @@ class _UpdateSoapIndexState extends State _controller.jumpToPage(pageIndex); } + bool _isLoading = true; + @override void initState() { // TODO: implement initState @@ -45,13 +46,21 @@ class _UpdateSoapIndexState extends State super.initState(); } + + void changeLoadingState(isLoading) { + setState(() { + _isLoading = isLoading; + }); + } + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( builder: (_, model, w) => AppScaffold( - baseViewModel: model, + // baseViewModel: model, + isLoading: _isLoading, appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( @@ -97,22 +106,28 @@ class _UpdateSoapIndexState extends State myAllergiesList: myAllergiesList, myHistoryList: myHistoryList, patientInfo: patient, + changeLoadingState:changeLoadingState ), UpdateObjectivePage( changePageViewIndex: changePageViewIndex, mySelectedExamination: mySelectedExamination, patientInfo: patient, + changeLoadingState:changeLoadingState ), UpdateAssessmentPage( changePageViewIndex: changePageViewIndex, mySelectedAssessmentList: mySelectedAssessment, patientInfo: patient, + changeLoadingState:changeLoadingState + ), UpdatePlanPage( changePageViewIndex: changePageViewIndex, patientInfo: patient, + changeLoadingState:changeLoadingState + ) ], ), diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b7a20339..b2c2224b 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -34,6 +34,7 @@ class _GifLoaderContainerState extends State child: Container( // margin: EdgeInsets.only(bottom: 40), child: GifImage( + controller: controller1, image: AssetImage( "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index fbd05870..b8db1546 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -27,10 +27,7 @@ class NetworkBaseView extends StatelessWidget { return child; break; case ViewState.Busy: - return Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: const CircularProgressIndicator()), - ); + return AppLoaderWidget(); break; case ViewState.Error: return Center( From 5150f9b93df191cc8518b3c7d81c57a511cb03eb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 17 Jan 2021 20:33:14 +0200 Subject: [PATCH 175/421] Prescription & procedure body update --- .../prescription/add_prescription_form.dart | 3 +- .../prescription/prescription_screen.dart | 3 +- lib/screens/procedures/procedure_screen.dart | 689 ++++++++++-------- 3 files changed, 370 insertions(+), 325 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0b49c257..3704f47e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -56,8 +56,7 @@ postProcedure( postProcedureReqModel.clinicID = patient.clinicId; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - postProcedureReqModel.vidaAuthTokenID = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; + sss.add(PrescriptionRequestModel( covered: true, dose: 1, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index df8c0e17..5e323f7c 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -745,8 +745,7 @@ class _NewPrescriptionScreenState extends State { updatePrescriptionReqModel.clinicID = patient.clinicId; updatePrescriptionReqModel.episodeID = patient.episodeNo; updatePrescriptionReqModel.patientMRN = patient.patientMRN; - updatePrescriptionReqModel.vidaAuthTokenID = - "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpIjoiOGFjNDRjZGQtOWE0Mi00M2YxLWE2YTQtMWQ4NzBmZmYwNTUyIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTU2NDkiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkRPQ1RPUlMiLCJIRUFEIERPQ1RPUlMiLCJBRE1JTklTVFJBVE9SUyIsIlJFQ0VQVElPTklTVCIsIkVSIE5VUlNFIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIkNPTlNFTlQgIiwiTUVESUNBTCBSRVBPUlQgLSBTSUNLIExFQVZFIE1BTkFHRVIiXSwibmJmIjoxNjA4NzM2NjY5LCJleHAiOjE2MDk2MDA2NjksImlhdCI6MTYwODczNjY2OX0.9EDgYrbe5fQA2CvgLdFT4s_PL7hD5R_Qggfpv4lDtUY"; + sss.add(PrescriptionRequestModel( covered: true, dose: 9, //frequency.isNotEmpty ? int.parse(dose) : 1, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 31eb99e9..1d6bfb41 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -115,227 +115,273 @@ class _ProcedureScreenState extends State { thickness: 1.0, color: Colors.grey, ), - if (model.procedureList.length != 0) - SizedBox( - height: model.procedureList[0].rowcount == 0 - ? 200.0 - : 10.0), + (model.procedureList.length != 0) + ? SizedBox( + height: model.procedureList[0].rowcount == 0 + ? 200.0 + : 10.0) + : SizedBox(height: 200.0), //model.prescriptionList == null - if (model.procedureList.length != 0) - model.procedureList[0].rowcount == 0 - ? Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - InkWell( - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); + (model.procedureList.length != 0) + ? model.procedureList[0].rowcount == 0 + ? Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + model + .getProcedureCategory() + .then((value) { + addSelectedProcedure( + context, model, patient); + }); - //model.postPrescription(); - }, - child: CircleAvatar( - radius: 65, - backgroundColor: Color(0XFFB8382C), + //model.postPrescription(); + }, child: CircleAvatar( - radius: 60, - backgroundColor: Colors.white, - child: Icon( - Icons.add, - color: Colors.black, - size: 45.0, + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, + ), ), ), ), - ), - SizedBox( - height: 15.0, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - 'NO ORDER FOR PROCEDURE LISTED', - color: Colors.black, - fontWeight: FontWeight.w900, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - AppText( - TranslationBase.of(context).addNow, - color: Color(0XFFB8382C), - fontWeight: FontWeight.w700, - ), - ], - ), - ], - ) - : Padding( - padding: EdgeInsets.all(16.0), - child: NetworkBaseView( - baseViewModel: model, - child: Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - InkWell( - child: Container( - height: 50.0, - width: 450.0, - decoration: BoxDecoration( - border: Border.all( - color: Colors.grey), - borderRadius: - BorderRadius.circular(10.0), - ), - child: Padding( - padding: EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - AppText( - TranslationBase.of(context) - .addMoreProcedure, - fontWeight: FontWeight.w100, - fontSize: 12.5, - ), - Icon( - Icons.add, - color: Color(0XFFB8382C), - ) - ], - ), - ), + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + 'NO ORDER FOR PROCEDURE LISTED', + color: Colors.black, + fontWeight: FontWeight.w900, ), - onTap: () { - model - .getProcedureCategory() - .then((value) { - addSelectedProcedure( - context, model, patient); - }); - - //model.postPrescription(); - }, - ), - // Container( - // decoration: BoxDecoration( - // borderRadius: BorderRadius.all( - // Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // child: AppTextFormField( - // labelText: 'Add more procedure', - // borderColor: Colors.white, - // //suffixIcon: Icons.search, - // - // //textInputType: TextInputType.number, - // inputFormatter: ONLY_NUMBERS, - // onTap: () { - // addSelectedProcedure(context); - // }, - // ), - // ), - SizedBox( - height: 35.0, - ), - ...List.generate( - model.procedureList[0].rowcount, - (index) => Container( - child: Column( - children: [ - Row( + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ) + : Padding( + padding: EdgeInsets.all(16.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + InkWell( + child: Container( + height: 50.0, + width: 450.0, + decoration: BoxDecoration( + border: Border.all( + color: Colors.grey), + borderRadius: + BorderRadius.circular(10.0), + ), + child: Padding( + padding: EdgeInsets.all(8.0), + child: Row( mainAxisAlignment: MainAxisAlignment .spaceBetween, children: [ - Container( - height: 120.0, - width: 45.0, - child: Column( - children: [ - AppText( - '8\nDEC', - color: Colors.green, - ) - ], - ), + AppText( + TranslationBase.of( + context) + .addMoreProcedure, + fontWeight: + FontWeight.w100, + fontSize: 12.5, ), - Expanded( - child: Container( - height: 120, - width: 325.0, + Icon( + Icons.add, + color: Color(0XFFB8382C), + ) + ], + ), + ), + ), + onTap: () { + model + .getProcedureCategory() + .then((value) { + addSelectedProcedure( + context, model, patient); + }); + + //model.postPrescription(); + }, + ), + // Container( + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // child: AppTextFormField( + // labelText: 'Add more procedure', + // borderColor: Colors.white, + // //suffixIcon: Icons.search, + // + // //textInputType: TextInputType.number, + // inputFormatter: ONLY_NUMBERS, + // onTap: () { + // addSelectedProcedure(context); + // }, + // ), + // ), + SizedBox( + height: 35.0, + ), + ...List.generate( + model.procedureList[0].rowcount, + (index) => Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: 120.0, + width: 45.0, child: Column( children: [ - Row( - children: [ - AppText( - TranslationBase.of( - context) - .codeNo + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .procedureId - .toString(), - fontSize: - 13.0, - ), - SizedBox( - width: 12.0, - ), - AppText( - TranslationBase.of( - context) - .orderType + - " : ", - fontWeight: - FontWeight - .w700, - fontSize: - 15.0, - ), - AppText( - model.procedureList[0].entityList[index] - .orderType == - 1 - ? 'Regular' - : 'Urgent', - fontSize: - 13.0, - color: Color( - 0xFFB9382C), - ), - ], - ), - Row( - children: [ - Container( - child: - Expanded( + AppText( + '8\nDEC', + color: + Colors.green, + ) + ], + ), + ), + Expanded( + child: Container( + height: 120, + width: 325.0, + child: Column( + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .codeNo + + " : ", + fontWeight: + FontWeight + .w700, + fontSize: + 15.0, + ), + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .procedureId + .toString(), + fontSize: + 13.0, + ), + SizedBox( + width: 12.0, + ), + AppText( + TranslationBase.of(context) + .orderType + + " : ", + fontWeight: + FontWeight + .w700, + fontSize: + 15.0, + ), + AppText( + model.procedureList[0].entityList[index].orderType == + 1 + ? 'Regular' + : 'Urgent', + fontSize: + 13.0, + color: Color( + 0xFFB9382C), + ), + ], + ), + Row( + children: [ + Container( + child: + Expanded( + child: + AppText( + model + .procedureList[0] + .entityList[index] + .procedureName, + fontWeight: + FontWeight.w800, + ), + ), + ) + ], + ), + + Row( + children: [ + AppText( + TranslationBase.of(context) + .price + + " : ", + fontWeight: + FontWeight + .w700, + ), + // Expanded( + // child: AppText( + // model + // .procedureList[ + // 0] + // .entityList[ + // index] + // .price + // .toString(), + // fontSize: + // 13.0), + // ) + ], + ), + SizedBox( + height: 10.0, + ), + + Row( + children: [ + Expanded( child: AppText( model @@ -343,131 +389,136 @@ class _ProcedureScreenState extends State { 0] .entityList[ index] - .procedureName, - fontWeight: - FontWeight - .w800, + .remarks + .toString(), + fontSize: + 13.5, ), ), - ) - ], - ), + ], + ), + SizedBox( + height: 10.0, + ), - Row( - children: [ - AppText( - TranslationBase.of( - context) - .price + - " : ", - fontWeight: - FontWeight - .w700, - ), - // Expanded( - // child: AppText( - // model - // .procedureList[ - // 0] - // .entityList[ - // index] - // .price - // .toString(), - // fontSize: - // 13.0), - // ) - ], - ), - SizedBox( - height: 10.0, - ), - - Row( - children: [ - Expanded( - child: - AppText( - model + Divider( + height: 5.0, + thickness: 1.0, + color: + Colors.grey, + ) + // SizedBox( + // height: 40, + // ), + ], + ), + ), + ), + Container( + child: Column( + children: [ + InkWell( + child: Icon( + Icons.edit), + onTap: () { + updateProcedureForm( + context, + remarks: model .procedureList[ 0] .entityList[ index] - .remarks - .toString(), - fontSize: - 13.5, - ), - ), - ], - ), - SizedBox( - height: 10.0, - ), - - Divider( - height: 5.0, - thickness: 1.0, - color: - Colors.grey, + .remarks, + procedureName: model + .procedureList[ + 0] + .entityList[ + index] + .procedureName, + patient: + patient, + procedureId: model + .procedureList[ + 0] + .entityList[ + index] + .procedureId, + categoreId: model + .procedureList[ + 0] + .entityList[ + index] + .categoryID + .toString()); + }, ) - // SizedBox( - // height: 40, - // ), ], ), - ), - ), - Container( - child: Column( - children: [ - InkWell( - child: Icon( - Icons.edit), - onTap: () { - updateProcedureForm( - context, - remarks: model - .procedureList[ - 0] - .entityList[ - index] - .remarks, - procedureName: model - .procedureList[ - 0] - .entityList[ - index] - .procedureName, - patient: - patient, - procedureId: model - .procedureList[ - 0] - .entityList[ - index] - .procedureId, - categoreId: model - .procedureList[ - 0] - .entityList[ - index] - .categoryID - .toString()); - }, - ) - ], - ), - ) - ], - ), - ], + ) + ], + ), + ], + ), ), ), + ], + ), + ), + ) + : Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + InkWell( + onTap: () { + model + .getProcedureCategory() + .then((value) { + addSelectedProcedure( + context, model, patient); + }); + + //model.postPrescription(); + }, + child: CircleAvatar( + radius: 65, + backgroundColor: Color(0XFFB8382C), + child: CircleAvatar( + radius: 60, + backgroundColor: Colors.white, + child: Icon( + Icons.add, + color: Colors.black, + size: 45.0, ), - ], + ), ), ), - ) + SizedBox( + height: 15.0, + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + 'NO ORDER FOR PROCEDURE LISTED', + color: Colors.black, + fontWeight: FontWeight.w900, + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + AppText( + TranslationBase.of(context).addNow, + color: Color(0XFFB8382C), + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ) ], ), ), @@ -593,8 +644,6 @@ postProcedure( postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - postProcedureReqModel.vidaAuthTokenID = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; controls.add( Controls( @@ -632,8 +681,6 @@ updateProcedure( updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.patientMRN = patient.patientMRN; - updateProcedureReqModel.vidaAuthTokenID = - 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxNDg1IiwianRpIjoiZjQ4YTk0OTQtYTczZS00MDI3LWI2MjgtNzc4MjAwMzUyYWEzIiwiZW1haWwiOiJNb2hhbWVkLlJlc3dhbkBjbG91ZHNvbHV0aW9uLXNhLmNvbSIsImlkIjoiMTQ4NSIsIk5hbWUiOiJTSEFLRVJBIFBBUlZFRU4gKFVTRUQgQlkgRVNFUlZJQ0VTKSIsIkVtcGxveWVlSWQiOiIxNDg1IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiIxNDg1IiwiU0VTU0lPTklEIjoiMjE1ODUyMTAiLCJDbGluaWNJZCI6IjMiLCJyb2xlIjoiRE9DVE9SUyIsIm5iZiI6MTYwODM2NDU2OCwiZXhwIjoxNjA5MjI4NTY4LCJpYXQiOjE2MDgzNjQ1Njh9.YLbvq5nxPn8o9ZYkcbc5YAX7Jy23Mm0s33oRmE8GHDI'; controls.add( Controls( From 763d6bb49f09918564a665485cc09957612cecc3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 10:49:16 +0200 Subject: [PATCH 176/421] finish add loader --- .../medicine/medicine_search_screen.dart | 147 +++++++++--------- lib/screens/patients/patients_screen.dart | 3 +- 2 files changed, 78 insertions(+), 72 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 3a2ff96c..2c5b8213 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -162,87 +163,86 @@ class _MedicineSearchState extends State { // TODO change it secondary button and add loading AppButton( title: TranslationBase.of(context).search, - onPressed: () { - searchMedicine(context, model); + onPressed: () async{ + await searchMedicine(context, model); + }, ), ], ), ), - NetworkBaseView( - baseViewModel: model, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( + Column( + children: [ + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase + .of(context) + .youCanFind + + model.pharmacyItemsList.length + .toString() + + " " + TranslationBase .of(context) - .youCanFind + - model.pharmacyItemsList.length - .toString() + - " " + - TranslationBase - .of(context) - .itemsInSearch, - fontWeight: FontWeight.bold, - ), - ], + .itemsInSearch, + fontWeight: FontWeight.bold, ), - ), - Container( - height: MediaQuery - .of(context) - .size - .height * 0.35, - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: - model.pharmacyItemsList == - null - ? 0 - : model - .pharmacyItemsList.length, - itemBuilder: - (BuildContext context, int index) { - return InkWell( - child: MedicineItemWidget( - label: model - .pharmacyItemsList[index] - ["ItemDescription"], - url: model - .pharmacyItemsList[index] - ["ImageSRCUrl"], + ], + ), + ), + Container( + height: MediaQuery + .of(context) + .size + .height * 0.35, + child: Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: + model.pharmacyItemsList == + null + ? 0 + : model + .pharmacyItemsList.length, + itemBuilder: + (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: model + .pharmacyItemsList[index] + ["ItemDescription"], + url: model + .pharmacyItemsList[index] + ["ImageSRCUrl"], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmaciesListScreen( + itemID: model + .pharmacyItemsList[ + index]["ItemID"], + url: model + .pharmacyItemsList[ + index]["ImageSRCUrl"]), ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID: model - .pharmacyItemsList[ - index]["ItemID"], - url: model - .pharmacyItemsList[ - index]["ImageSRCUrl"]), - ), - ); - }, ); - }, - ), - ), + }, + ); + }, ), - ], - )), + ), + ), + ], + ), ], ), ), @@ -252,7 +252,7 @@ class _MedicineSearchState extends State { ),),); } - searchMedicine(context, MedicineViewModel model) { + searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { helpers.showErrorToast(TranslationBase @@ -267,7 +267,12 @@ class _MedicineSearchState extends State { .moreThan3Letter); return; } - model.getMedicineItem(myController.text); + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getMedicineItem(myController.text); + GifLoaderDialogUtils.hideDialog(context); + } startVoiceSearch() { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 3083a779..a6428c21 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -317,8 +317,9 @@ class _PatientsScreenState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: patientTypeTitle, + isLoading: _isLoading, body: _isLoading - ? DrAppCircularProgressIndeicator() + ? Container() : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 From a99b3847ac205c2c1d6903d34e0a13f2784afdad Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 18 Jan 2021 14:14:36 +0300 Subject: [PATCH 177/421] login completed --- lib/config/shared_pref_kay.dart | 1 + lib/core/model/imei_details.dart | 23 +-- lib/core/model/insert_imei_model.dart | 17 +- lib/core/service/prescription_service.dart | 22 ++- lib/core/viewModel/auth_view_model.dart | 13 +- .../viewModel/prescription_view_model.dart | 10 +- .../auth/send_activation_code_model2.dart | 7 +- lib/screens/dashboard_screen.dart | 2 +- .../prescription/add_prescription_form.dart | 20 ++- lib/screens/prescription/drugtodrug.dart | 101 ++++++----- .../prescription/prescription_screen.dart | 14 +- lib/widgets/auth/verification_methods.dart | 159 +++++++++--------- 12 files changed, 232 insertions(+), 157 deletions(-) diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 1520207f..376c8dab 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -12,3 +12,4 @@ final LOGGED_IN_USER = 'loggedUser'; final DASHBOARD_DATA = 'dashboard-data'; final OTP_TYPE = 'otp-type'; final LAST_LOGIN_USER = 'last-login-user'; +final PASSWORD = 'password'; diff --git a/lib/core/model/imei_details.dart b/lib/core/model/imei_details.dart index 614ce67a..eb37e736 100644 --- a/lib/core/model/imei_details.dart +++ b/lib/core/model/imei_details.dart @@ -4,30 +4,30 @@ class GetIMEIDetailsModel { int logInTypeID; bool outSA; String mobile; - Null identificationNo; + dynamic identificationNo; int doctorID; String doctorName; String doctorNameN; int clinicID; String clinicDescription; - Null clinicDescriptionN; + dynamic clinicDescriptionN; int projectID; String projectName; String genderDescription; - Null genderDescriptionN; + dynamic genderDescriptionN; String titleDescription; - Null titleDescriptionN; - Null zipCode; + dynamic titleDescriptionN; + dynamic zipCode; String createdOn; - Null createdBy; + dynamic createdBy; String editedOn; - int editedBy; + dynamic editedBy; bool biometricEnabled; - Null preferredLanguage; + dynamic preferredLanguage; bool isActive; String vidaAuthTokenID; String vidaRefreshTokenID; - + String password; GetIMEIDetailsModel( {this.iD, this.iMEI, @@ -56,7 +56,8 @@ class GetIMEIDetailsModel { this.preferredLanguage, this.isActive, this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + this.vidaRefreshTokenID, + this.password}); GetIMEIDetailsModel.fromJson(Map json) { iD = json['ID']; @@ -87,6 +88,7 @@ class GetIMEIDetailsModel { isActive = json['IsActive']; vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; + password = json['Password']; } Map toJson() { @@ -119,6 +121,7 @@ class GetIMEIDetailsModel { data['IsActive'] = this.isActive; data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + data['Password'] = this.password; return data; } } diff --git a/lib/core/model/insert_imei_model.dart b/lib/core/model/insert_imei_model.dart index 40668dba..25e22b7a 100644 --- a/lib/core/model/insert_imei_model.dart +++ b/lib/core/model/insert_imei_model.dart @@ -1,9 +1,9 @@ class InsertIMEIDetailsModel { String iMEI; int logInTypeID; - Null outSA; - Null mobile; - Null identificationNo; + dynamic outSA; + String mobile; + dynamic identificationNo; int doctorID; String doctorName; String doctorNameN; @@ -31,7 +31,7 @@ class InsertIMEIDetailsModel { int patientOutSA; String vidaAuthTokenID; String vidaRefreshTokenID; - + dynamic password; InsertIMEIDetailsModel( {this.iMEI, this.logInTypeID, @@ -64,13 +64,14 @@ class InsertIMEIDetailsModel { this.isLoginForDoctorApp, this.patientOutSA, this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + this.vidaRefreshTokenID, + this.password}); InsertIMEIDetailsModel.fromJson(Map json) { iMEI = json['IMEI']; logInTypeID = json['LogInTypeID']; outSA = json['OutSA']; - mobile = json['Mobile']; + mobile = json['MobileNo']; identificationNo = json['IdentificationNo']; doctorID = json['DoctorID']; doctorName = json['DoctorName']; @@ -99,6 +100,7 @@ class InsertIMEIDetailsModel { patientOutSA = json['PatientOutSA']; vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; + password = json['Password']; } Map toJson() { @@ -106,7 +108,7 @@ class InsertIMEIDetailsModel { data['IMEI'] = this.iMEI; data['LogInTypeID'] = this.logInTypeID; data['OutSA'] = this.outSA; - data['Mobile'] = this.mobile; + data['MobileNo'] = this.mobile; data['IdentificationNo'] = this.identificationNo; data['DoctorID'] = this.doctorID; data['DoctorName'] = this.doctorName; @@ -135,6 +137,7 @@ class InsertIMEIDetailsModel { data['PatientOutSA'] = this.patientOutSA; data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + data['Password'] = this.password; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 90b12041..6558ad6e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; class PrescriptionService extends BaseService { @@ -93,9 +94,24 @@ class PrescriptionService extends BaseService { } Future getDrugToDrug( - VitalSignData vital, List allergy) async { + VitalSignData vital, + List diagnosis, + List allergy, + PatiantInformtion patient, + List prescription) async { + Map request = { + "Prescription": { + "objPatientInfo": {"Gender": patient.gender, "Age": patient.age}, + "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, + "objPrescriptionItems": prescription[0].entityList, + "objAllergies": allergy, + "objDiagnosis": diagnosis, + "IsDoctor": "false", + "IsPharmacist": "false" + } + }; + hasError = false; - var request = {}; await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { drugToDrug = []; @@ -103,6 +119,6 @@ class PrescriptionService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: _drugRequestModel.toJson()); + }, body: request); } } diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 960462cd..3a873049 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -81,11 +81,15 @@ class AuthViewModel extends BaseViewModel { Future insertDeviceImei(request) async { var loggedIn = await sharedPref.getObj(LOGGED_IN_USER); - + var user = await sharedPref.getObj(LAST_LOGIN_USER); + if (user != null) { + user = GetIMEIDetailsModel.fromJson(user); + } request['IMEI'] = DEVICE_TOKEN; request['LogInTypeID'] = await sharedPref.getInt(OTP_TYPE); request['BioMetricEnabled'] = true; - request['MobileNo'] = loggedIn['MobileNumber']; + request['MobileNo'] = + loggedIn != null ? loggedIn['MobileNumber'] : user.mobile; InsertIMEIDetailsModel nRequest = InsertIMEIDetailsModel.fromJson(request); nRequest.genderDescription = request['Gender_Description']; nRequest.genderDescriptionN = request['Gender_DescriptionN']; @@ -93,9 +97,14 @@ class AuthViewModel extends BaseViewModel { nRequest.titleDescription = request['Title_Description']; nRequest.titleDescriptionN = request['Title_DescriptionN']; nRequest.projectID = await sharedPref.getInt(PROJECT_ID); + nRequest.doctorID = loggedIn != null + ? loggedIn['List_MemberInformation'][0]['MemberID'] + : user.doctorID; + nRequest.outSA = loggedIn != null ? loggedIn['PatientOutSA'] : user.outSA; nRequest.vidaAuthTokenID = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); nRequest.vidaRefreshTokenID = await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); + nRequest.password = await sharedPref.getString(PASSWORD); try { var localRes; await baseAppClient.post(INSERT_DEVICE_IMEI, diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index d7b8f409..3e39a7fa 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; class PrescriptionViewModel extends BaseViewModel { @@ -72,10 +73,15 @@ class PrescriptionViewModel extends BaseViewModel { } Future getDrugToDrug( - VitalSignData vital, List allergy) async { + VitalSignData vital, + List listOfDiagnosisType, + List allergy, + PatiantInformtion patient, + List prescription) async { hasError = false; setState(ViewState.Busy); - await _prescriptionService.getDrugToDrug(vital, allergy); + await _prescriptionService.getDrugToDrug( + vital, listOfDiagnosisType, allergy, patient, prescription); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); diff --git a/lib/models/auth/send_activation_code_model2.dart b/lib/models/auth/send_activation_code_model2.dart index 794887b3..68a90c85 100644 --- a/lib/models/auth/send_activation_code_model2.dart +++ b/lib/models/auth/send_activation_code_model2.dart @@ -11,7 +11,7 @@ class ActivationCodeModel2 { int isMobileFingerPrint; String vidaAuthTokenID; String vidaRefreshTokenID; - + String iMEI; ActivationCodeModel2( {this.oTPSendType, this.mobileNumber, @@ -24,7 +24,8 @@ class ActivationCodeModel2 { this.generalid, this.isMobileFingerPrint, this.vidaAuthTokenID, - this.vidaRefreshTokenID}); + this.vidaRefreshTokenID, + this.iMEI}); ActivationCodeModel2.fromJson(Map json) { oTPSendType = json['OTP_SendType']; @@ -39,6 +40,7 @@ class ActivationCodeModel2 { isMobileFingerPrint = json['IsMobileFingerPrint']; vidaAuthTokenID = json['VidaAuthTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID']; + iMEI = json['IMEI']; } Map toJson() { @@ -55,6 +57,7 @@ class ActivationCodeModel2 { data['IsMobileFingerPrint'] = this.isMobileFingerPrint; data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; + data['IMEI'] = this.iMEI; return data; } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 8787eb42..7fd09138 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -70,7 +70,7 @@ class _DashboardScreenState extends State { DEVICE_TOKEN = token; var request = await sharedPref.getObj(DOCTOR_PROFILE); authProvider.insertDeviceImei(request).then((value) { - print(value['ReturnValue']); + print(value); changeIsLoading(false); }); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 8714327d..7d7b45b3 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -25,13 +26,13 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; -addPrescriptionForm( - context, PrescriptionViewModel model, PatiantInformtion patient) { +addPrescriptionForm(context, PrescriptionViewModel model, + PatiantInformtion patient, prescription) { showModalBottomSheet( isScrollControlled: true, context: context, builder: (BuildContext bc) { - return PrescriptionFormWidget(model, patient); + return PrescriptionFormWidget(model, patient, prescription); }); } @@ -86,7 +87,8 @@ postProcedure( class PrescriptionFormWidget extends StatefulWidget { final PrescriptionViewModel model; PatiantInformtion patient; - PrescriptionFormWidget(this.model, this.patient); + List prescriptionList; + PrescriptionFormWidget(this.model, this.patient, this.prescriptionList); @override _PrescriptionFormWidgetState createState() => _PrescriptionFormWidgetState(); @@ -301,7 +303,7 @@ class _PrescriptionFormWidgetState extends State { ListSelectDialog dialog = ListSelectDialog( list: model.drugsList, - attributeName: 'Description', + attributeName: 'GenericName', attributeValueId: 'ItemId', okText: TranslationBase.of(context) @@ -694,8 +696,8 @@ class _PrescriptionFormWidgetState extends State { .addMedication, onPressed: () { formKey.currentState.save(); - // Navigator.pop(context); - // openDrugToDrug(); + Navigator.pop(context); + openDrugToDrug(); if (strength == null || route == null || frequency == null || @@ -800,9 +802,9 @@ class _PrescriptionFormWidgetState extends State { child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrugToDrug(widget.patient), + DrugToDrug(widget.patient, widget.prescriptionList), Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), child: AppButton( title: TranslationBase.of(context).addMedication, onPressed: () { diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index 8f51da80..b97dbb2d 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -1,5 +1,8 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; @@ -16,13 +19,15 @@ import 'package:flutter/material.dart'; class DrugToDrug extends StatefulWidget { final PatiantInformtion patient; - DrugToDrug(this.patient); + final prescription; + DrugToDrug(this.patient, this.prescription); @override _DrugToDrug createState() => _DrugToDrug(); } class _DrugToDrug extends State { int typeID = 1; + bool isLoaded = false; List> expandableList = [ {'name': 'CRITICAL'}, {'name': 'HIGH'}, @@ -30,54 +35,59 @@ class _DrugToDrug extends State { {'name': 'LOW'}, {'name': 'INFO'}, ]; + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: 2954208, //widget.patient.patientMRN, + episodeId: 210011002, //widget.patient.episodeNo, + appointmentNo: 2016055308, //widget.patient.appointmentNo, + doctorID: '', + editedBy: ''); + + VitalSignsViewModel model = new VitalSignsViewModel(); + SOAPViewModel model2 = new SOAPViewModel(); @override void initState() { getTypeID(); + getRequestedData(); super.initState(); } @override Widget build(BuildContext context) { - GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: 2954208, //widget.patient.patientMRN, - episodeId: 210011002, //widget.patient.episodeNo, - appointmentNo: 2016055308, //widget.patient.appointmentNo, - doctorID: '', - editedBy: ''); - - return BaseView( - onModelReady: (model) => model.getPatientVitalSign(widget.patient), - builder: (BuildContext context, model, Widget child) { - return BaseView( - onModelReady: (model2) => - model2.getPatientAllergy(generalGetReqForSOAP), - builder: (BuildContext context, model2, Widget child) { - return BaseView( - onModelReady: (model3) => model3.getDrugToDrug( - model.patientVitalSigns, model2.patientAllergiesList), - builder: (BuildContext context, - PrescriptionViewModel model3, Widget child) => - NetworkBaseView( - baseViewModel: model3, - child: Container( - height: SizeConfig.realScreenHeight * .45, - child: new ListView.builder( - itemCount: expandableList.length, - itemBuilder: (context, i) { - return new ExpansionTile( - title: new Text( - expandableList[i]['name'], - style: new TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.italic), - ), - children: [Text('Hi')], - ); - })))); - }); - }); + return isLoaded == true + ? BaseView( + onModelReady: (model3) => model3.getDrugToDrug( + model.patientVitalSigns, + model2.listOfDiagnosisType, + model2.patientAllergiesList, + widget.patient, + widget.prescription), + builder: (BuildContext context, PrescriptionViewModel model3, + Widget child) => + NetworkBaseView( + baseViewModel: model3, + child: Container( + height: SizeConfig.realScreenHeight * .4, + child: new ListView.builder( + itemCount: expandableList.length, + itemBuilder: (context, i) { + return new ExpansionTile( + title: new Text( + expandableList[i]['name'], + style: new TextStyle( + fontSize: 20.0, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.italic), + ), + children: [Text('Hi')], + ); + })))) + : Container( + height: SizeConfig.realScreenHeight * .45, + child: Center( + child: CircularProgressIndicator( + valueColor: AlwaysStoppedAnimation(Colors.black), + ))); } getTypeID() async { @@ -86,4 +96,15 @@ class _DrugToDrug extends State { typeID = type; }); } + + getRequestedData() async { + await model.getPatientVitalSign(widget.patient); + await model2.getPatientAllergy(generalGetReqForSOAP); + await model2.getMasterLookup(MasterKeysService.DiagnosisType); + if (model.state == ViewState.Idle && model2.state == ViewState.Idle) { + setState(() { + isLoaded = true; + }); + } + } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 45e5173f..2330181b 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -128,7 +128,10 @@ class _NewPrescriptionScreenState extends State { InkWell( onTap: () { addPrescriptionForm( - context, model, patient); + context, + model, + patient, + model.prescriptionList); //model.postPrescription(); }, child: CircleAvatar( @@ -219,7 +222,10 @@ class _NewPrescriptionScreenState extends State { ), onTap: () { addPrescriptionForm( - context, model, patient); + context, + model, + patient, + model.prescriptionList); //model.postPrescription(); }, ), @@ -500,8 +506,8 @@ class _NewPrescriptionScreenState extends State { children: [ InkWell( onTap: () { - addPrescriptionForm( - context, model, patient); + addPrescriptionForm(context, model, + patient, model.prescriptionList); //model.postPrescription(); }, child: CircleAvatar( diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index caee190d..ff748a95 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -63,6 +63,10 @@ class _VerificationMethodsState extends State { bool authenticated; + var fingrePrintBefore; + + var selectedOption; + @override void initState() { super.initState(); @@ -105,7 +109,9 @@ class _VerificationMethodsState extends State { helpers.showErrorToast('Error: ${snapshot.error}'); return Text('Error: ${snapshot.error}'); } else { - return Container( + return SingleChildScrollView( + child: Container( + height: SizeConfig.realScreenHeight, width: SizeConfig.realScreenWidth, child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -155,18 +161,17 @@ class _VerificationMethodsState extends State { TextOverflow.ellipsis, ), subtitle: Text( - // user. != null - // ? formatDate(Helpers - // .convertStringToDate( - // user - // .)) - // : user != - // null - // ? formatDate(Helpers - // .convertStringToDate(user - // .createdOn)) - //: - '--', + user.editedOn != null + ? formatDate(Helpers + .convertStringToDate( + user + .editedOn)) + : user.createdOn != + null + ? formatDate(Helpers + .convertStringToDate(user + .createdOn)) + : '--', overflow: TextOverflow.ellipsis, textAlign: @@ -263,7 +268,7 @@ class _VerificationMethodsState extends State { 3, authProv)), Expanded( child: getButton( - 2, authProv)) + 4, authProv)) ], ) : SizedBox(), @@ -275,7 +280,7 @@ class _VerificationMethodsState extends State { child: getButton(1, authProv)), Expanded( - child: getButton(4, authProv)) + child: getButton(2, authProv)) ], ), ]), @@ -307,7 +312,7 @@ class _VerificationMethodsState extends State { )) ], ), - ); + )); } } }); @@ -342,14 +347,13 @@ class _VerificationMethodsState extends State { authProv .sendActivationCodeForDoctorApp(activationCodeModel) .then((res) { - widget.changeLoadingStata(false); - if (res['MessageStatus'] == 1) { print("VerificationCode : " + res["VerificationCode"]); sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); sharedPref.setString( VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); + sharedPref.setString(PASSWORD, widget.password); this.startSMSService(oTPSendType, authProv); } else { print(res['ErrorEndUserMessage']); @@ -380,55 +384,50 @@ class _VerificationMethodsState extends State { sendActivationCodeVerificationScreen( oTPSendType, AuthViewModel authProv) async { // TODO : build enum for verfication method - if (oTPSendType == 1 || oTPSendType == 2) { - widget.changeLoadingStata(true); - ActivationCodeModel2 activationCodeModel = ActivationCodeModel2( - facilityId: user.projectID, - memberID: user.doctorID, - zipCode: user.outSA == true ? '971' : '966', - mobileNumber: user.mobile, - oTPSendType: oTPSendType, - isMobileFingerPrint: 1, - vidaAuthTokenID: user.vidaAuthTokenID, - vidaRefreshTokenID: user.vidaRefreshTokenID); + //if (oTPSendType == 1 || oTPSendType == 2) { + widget.changeLoadingStata(true); + ActivationCodeModel2 activationCodeModel = ActivationCodeModel2( + iMEI: user.iMEI, + facilityId: user.projectID, + memberID: user.doctorID, + zipCode: user.outSA == true ? '971' : '966', + mobileNumber: user.mobile, + oTPSendType: oTPSendType, + isMobileFingerPrint: 1, + vidaAuthTokenID: user.vidaAuthTokenID, + vidaRefreshTokenID: user.vidaRefreshTokenID); - try { - authProv - .sendActivationCodeVerificationScreen(activationCodeModel) - .then((res) { - widget.changeLoadingStata(false); - - if (res['MessageStatus'] == 1) { - print("VerificationCode : " + res["VerificationCode"]); - sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); - sharedPref.setString( - VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); - sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); + try { + authProv + .sendActivationCodeVerificationScreen(activationCodeModel) + .then((res) { + if (res['MessageStatus'] == 1) { + print("VerificationCode : " + res["VerificationCode"]); + sharedPref.setString(VIDA_AUTH_TOKEN_ID, res["VidaAuthTokenID"]); + sharedPref.setString( + VIDA_REFRESH_TOKEN_ID, res["VidaRefreshTokenID"]); + sharedPref.setString(LOGIN_TOKEN_ID, res["LogInTokenID"]); + if (oTPSendType == 1 || oTPSendType == 2) { + widget.changeLoadingStata(false); this.startSMSService(oTPSendType, authProv); } else { - print(res['ErrorEndUserMessage']); - helpers.showErrorToast(res['ErrorEndUserMessage']); + checkActivationCode(authProv); } - }).catchError((err) { - print('$err'); - widget.changeLoadingStata(false); - - helpers.showErrorToast(); - }); - } catch (e) {} - } else { - // TODO route to this page with parameters to inicate we should present 2 option - if (Platform.isAndroid && oTPSendType == 3) { - helpers.showErrorToast('Your device not support this feature'); - } else { - // Navigator.of(context).push(MaterialPageRoute( - // builder: (BuildContext context) => - // VerificationMethodsScreen(password: widget.password,))); + } else { + print(res['ErrorEndUserMessage']); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + print('$err'); + widget.changeLoadingStata(false); - // Navigator.of(context).pushNamed(VERIFICATION_METHODS, - // arguments: {'verificationMethod': oTPSendType}); - } - } + helpers.showErrorToast(); + }); + } catch (e) {} + // } + // else { + // checkActivationCode(authProv); + // } } Widget getButton(flag, authProv) { @@ -635,10 +634,10 @@ class _VerificationMethodsState extends State { authenticateUser(type, isActive, authProv) { //GifLoaderDialogUtils.showMyDialog(context); - // if (type == 2 || type == 3) { - // fingrePrintBefore = type; - // } - //this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; + if (type == 3 || type == 4) { + fingrePrintBefore = type; + } + this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; switch (type) { case 1: @@ -657,8 +656,8 @@ class _VerificationMethodsState extends State { default: break; } - // sharedPref.setInt(LAST_LOGIN, - // this.selectedOption); //this.cs.sharedService.setStorage(this.selectedOption, AuthenticationService.LAST_LOGIN); + sharedPref.setInt(OTP_TYPE, selectedOption); + // sharedPref.setInt(LAST_LOGIN), } loginWithSMS(type, isActive, authProv) { @@ -729,11 +728,10 @@ class _VerificationMethodsState extends State { } startSMSService(type, authProv) { - sharedPref.setInt(OTP_TYPE, type); new SMSOTP( context, type, - _loggedUser['MobileNumber'], + _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile, (value) { showDialog( context: context, @@ -759,10 +757,13 @@ class _VerificationMethodsState extends State { localizedReason: 'Scan your fingerprint to authenticate', useErrorDialogs: true, stickyAuth: true); - if (user.logInTypeID == 1 || user.logInTypeID == 2) { - this.onlySMSBox = true; + if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) { + this.sendActivationCode(type, authProv); + // this.checkActivationCode(authProv); } else { - this.checkActivationCode(authProv); + setState(() { + this.onlySMSBox = true; + }); } // if (authenticated == true) { @@ -779,11 +780,15 @@ class _VerificationMethodsState extends State { checkActivationCode(AuthViewModel authProv, {value}) async { CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = new CheckActivationCodeRequestModel( - zipCode: _loggedUser['ZipCode'], - mobileNumber: _loggedUser['MobileNumber'], - projectID: await sharedPref.getInt(PROJECT_ID), + zipCode: + _loggedUser != null ? _loggedUser['ZipCode'] : user.zipCode, + mobileNumber: + _loggedUser != null ? _loggedUser['MobileNumber'] : user.mobile, + projectID: await sharedPref.getInt(PROJECT_ID) != null + ? await sharedPref.getInt(PROJECT_ID) + : user.projectID, logInTokenID: await sharedPref.getString(LOGIN_TOKEN_ID), - activationCode: value, + activationCode: value ?? '0000', oTPSendType: await sharedPref.getInt(OTP_TYPE), generalid: "Cs2020@2016\$2958"); From 9674eb89d95297dde1923d41e617481e574daf7e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 14:36:59 +0200 Subject: [PATCH 178/421] add modification on so --- lib/config/localized_values.dart | 7 ++ lib/core/service/SOAP_service.dart | 4 +- lib/core/viewModel/SOAP_view_model.dart | 3 +- .../SOAP/GetGetProgressNoteResModel.dart | 39 +++++++++- lib/util/translations_delegate_base.dart | 15 ++++ .../soap_update/update_assessment_page.dart | 70 ++++++++++------- .../profile/soap_update/update_plan_page.dart | 77 ++++++++++++------- .../soap_update/update_soap_index.dart | 4 + 8 files changed, 157 insertions(+), 62 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d121dd87..78c5d833 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -590,4 +590,11 @@ const Map> localizedValues = { 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, 'normal': {'en': "Normal", 'ar':"عادي" }, 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, + 'nameOrICD': {'en': "Name or ICD", 'ar':"الاسم او  ICD" }, + 'dType': {'en': "Type", 'ar':"النوع" }, + 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar':"أضف تفاصيل التقييم" }, + 'progressNoteSOAP': {'en': "Progress Note", 'ar':"ملاحظة التقدم" }, + 'addProgressNote': {'en': "Add Progress Note", 'ar':"أضف ملاحظة التقدم" }, + 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, + 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, }; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index e3ab61b2..abb832c7 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -29,7 +29,7 @@ class SOAPService extends LookupService { List patientAllergiesList = []; List patientHistoryList = []; List patientPhysicalExamList = []; - List patientProgressNoteList = []; + List patientProgressNoteList = []; List patientAssessmentList = []; int episodeID; @@ -284,7 +284,7 @@ class SOAPService extends LookupService { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { - patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v)); + patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 03500740..1ff23a18 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -74,7 +74,7 @@ class SOAPViewModel extends BaseViewModel { List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; List get patientAssessmentList => @@ -253,6 +253,7 @@ class SOAPViewModel extends BaseViewModel { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if(selectedAllergy != null) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; }); diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index bbc184f1..ce6c0a12 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,15 +1,39 @@ -class GetGetProgressNoteResModel { +class GetPatientProgressNoteResModel { int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + String dName; + String editedByName; + String editedOn; int episodeId; + String mName; int patientMRN; String planNote; - GetGetProgressNoteResModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + GetPatientProgressNoteResModel( + {this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); - GetGetProgressNoteResModel.fromJson(Map json) { + GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; + createdBy = json['createdBy']; + createdByName = json['createdByName']; + createdOn = json['createdOn']; + dName = json['dName']; + editedByName = json['editedByName']; + editedOn = json['editedOn']; episodeId = json['episodeId']; + mName = json['mName']; patientMRN = json['patientMRN']; planNote = json['planNote']; } @@ -17,7 +41,14 @@ class GetGetProgressNoteResModel { Map toJson() { final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; + data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; + data['createdOn'] = this.createdOn; + data['dName'] = this.dName; + data['editedByName'] = this.editedByName; + data['editedOn'] = this.editedOn; data['episodeId'] = this.episodeId; + data['mName'] = this.mName; data['patientMRN'] = this.patientMRN; data['planNote'] = this.planNote; return data; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index dd72e58a..c1e9b1b8 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -616,6 +616,21 @@ class TranslationBase { String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get nameOrICD => + localizedValues['nameOrICD'][locale.languageCode]; + + String get dType => + localizedValues['dType'][locale.languageCode]; + String get addAssessmentDetails => + localizedValues['addAssessmentDetails'][locale.languageCode]; + String get progressNoteSOAP => + localizedValues['progressNoteSOAP'][locale.languageCode]; + String get addProgressNote => + localizedValues['addProgressNote'][locale.languageCode]; + String get createdBy => + localizedValues['createdBy'][locale.languageCode]; + String get editedBy => + localizedValues['editedBy'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 05813d82..5c0dbc4c 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,15 +1,16 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.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/helpers.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/TextFields.dart'; @@ -22,6 +23,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; import 'custom_validation_error.dart'; @@ -44,6 +46,7 @@ class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async{ @@ -78,19 +81,23 @@ class _UpdateAssessmentPageState extends State { masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - icdCode10ID: element.icdCode10ID - ); + if(diagnosisCondition !=null &&diagnosisType !=null && diagnosisCondition!=null) { + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID + ); + + widget.mySelectedAssessmentList.add(temMySelectedAssessment); + } - widget.mySelectedAssessmentList.add(temMySelectedAssessment); }); } @@ -197,13 +204,14 @@ class _UpdateAssessmentPageState extends State { CrossAxisAlignment.start, children: [ AppText( - "12".toUpperCase(), + + assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day, fontWeight: FontWeight .bold, fontSize: 16, ), AppText( - "DEC".toUpperCase(), + Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), fontSize: 10, color: Colors.grey, ), @@ -239,7 +247,9 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - assessment + projectViewModel.isArabic?assessment + .selectedDiagnosisCondition + .nameAr : assessment .selectedDiagnosisCondition .nameEn, fontWeight: FontWeight @@ -253,13 +263,15 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).type +':', + TranslationBase.of(context).dType+':', fontWeight: FontWeight .bold, fontSize: 16, ), AppText( - assessment + projectViewModel.isArabic?assessment + .selectedDiagnosisType + .nameAr:assessment .selectedDiagnosisType .nameEn, fontSize: 10, @@ -438,6 +450,8 @@ class _AddAssessmentDetailsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + remarkController.text = widget.mySelectedAssessment.remark ?? ""; appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); @@ -498,7 +512,7 @@ class _AddAssessmentDetailsState extends State { height: 16, ), AppText( - "Add Assessment Details".toUpperCase(), + TranslationBase.of(context).addAssessmentDetails.toUpperCase(), fontWeight: FontWeight.bold, fontSize: 16, ), @@ -538,7 +552,7 @@ class _AddAssessmentDetailsState extends State { } : null, child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), key: key, suggestions: model.listOfICD10, @@ -553,7 +567,7 @@ class _AddAssessmentDetailsState extends State { ): TextField( decoration: textFieldSelectorDecoration( widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", - widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), @@ -595,10 +609,12 @@ class _AddAssessmentDetailsState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - "Condition", + TranslationBase.of(context).condition, widget.mySelectedAssessment .selectedDiagnosisCondition != null - ? widget.mySelectedAssessment + ? projectViewModel.isArabic?widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameAr:widget.mySelectedAssessment .selectedDiagnosisCondition .nameEn : null, @@ -645,10 +661,11 @@ class _AddAssessmentDetailsState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - "Type", + TranslationBase.of(context).dType, widget.mySelectedAssessment .selectedDiagnosisType != null - ? widget.mySelectedAssessment + ?projectViewModel.isArabic?widget.mySelectedAssessment + .selectedDiagnosisType.nameAr: widget.mySelectedAssessment .selectedDiagnosisType.nameEn : null, true), @@ -764,7 +781,8 @@ class _AddAssessmentDetailsState extends State { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + helpers + .showErrorToast(model.error); } else { mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index d0e91c8d..437b86f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -3,9 +3,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.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/helpers.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/TextFields.dart'; @@ -22,8 +24,14 @@ class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; + GetPatientProgressNoteResModel patientProgressNote; - UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState}); + UpdatePlanPage( + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.patientProgressNote}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -32,7 +40,6 @@ class UpdatePlanPage extends StatefulWidget { class _UpdatePlanPageState extends State { bool isProgressNoteExpand = false; - List progressNoteList; TextEditingController progressNoteController = TextEditingController(text: null); @@ -64,6 +71,12 @@ class _UpdatePlanPageState extends State { if (model.patientProgressNoteList.isNotEmpty) { progressNoteController.text = helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); + widget.patientProgressNote.planNote = progressNoteController.text; + widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; + widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; + widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; + widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; + } widget.changeLoadingState(false); }, @@ -87,7 +100,9 @@ class _UpdatePlanPageState extends State { children: [ Row( children: [ - Texts('Progress Note', + Texts(TranslationBase + .of(context) + .progressNoteSOAP, variant: isProgressNoteExpand ? "bodyText" : '', bold: isProgressNoteExpand ? true : false, color: Colors.black), @@ -115,22 +130,24 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty || progressNoteController.text !='') - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Progress Note", - fontSize: 13.5, - onTapTextFields: () { - openProgressNote(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, + if(model.patientProgressNoteList.isEmpty) + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: TranslationBase + .of(context) + .addProgressNote, + fontSize: 13.5, + onTapTextFields: () { + openProgressNote(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, validator: (value) { if (value == null) return TranslationBase.of(context) @@ -161,12 +178,14 @@ class _UpdatePlanPageState extends State { CrossAxisAlignment.start, children: [ AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, + + widget.patientProgressNote.createdOn !=null?DateTime.parse(widget.patientProgressNote.createdOn).day.toString():DateTime.now().day.toString(), + fontWeight: FontWeight + .bold, fontSize: 16, ), AppText( - "DEC".toUpperCase(), + Helpers.getMonth(widget.patientProgressNote.createdOn !=null?(DateTime.parse(widget.patientProgressNote.createdOn).month):DateTime.now().month).toUpperCase(), fontSize: 10, color: Colors.grey, ), @@ -209,12 +228,12 @@ class _UpdatePlanPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Created By : ", + TranslationBase.of(context).createdBy, fontWeight: FontWeight.bold, fontSize: 16, ), AppText( - "Anas Abdullah on 12 De", + widget.patientProgressNote.createdByName??"", fontSize: 10, color: Colors.grey, ), @@ -225,12 +244,12 @@ class _UpdatePlanPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Edited By : ", + TranslationBase.of(context).editedBy, fontWeight: FontWeight.bold, fontSize: 16, ), AppText( - "Rahim on 13 Dec", + widget.patientProgressNote.editedByName??"", fontSize: 10, color: Colors.grey, ), @@ -321,7 +340,7 @@ class _UpdatePlanPageState extends State { height: 16, ), AppText( - "Add Progress Note", + TranslationBase.of(context).addProgressNote, fontWeight: FontWeight.bold, fontSize: 16, ), @@ -331,7 +350,7 @@ class _UpdatePlanPageState extends State { Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: TextFields( - hintText: "Add progress note here", + hintText: TranslationBase.of(context).addProgressNote, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -350,7 +369,7 @@ class _UpdatePlanPageState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { setState(() { print(progressNoteController.text); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 8235f55a..7b68b4f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -33,6 +34,8 @@ class _UpdateSoapIndexState extends State List myHistoryList = List(); List mySelectedExamination = List(); List mySelectedAssessment = List(); + + GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -126,6 +129,7 @@ class _UpdateSoapIndexState extends State UpdatePlanPage( changePageViewIndex: changePageViewIndex, patientInfo: patient, + patientProgressNote: patientProgressNote, changeLoadingState:changeLoadingState ) From 40cfad7f7bcdf8c4f71adda3f9114c8d321750a7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 18 Jan 2021 15:46:41 +0300 Subject: [PATCH 179/421] login --- lib/widgets/auth/verification_methods.dart | 52 +--------------------- 1 file changed, 1 insertion(+), 51 deletions(-) diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index ff748a95..adc35982 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -662,49 +662,8 @@ class _VerificationMethodsState extends State { loginWithSMS(type, isActive, authProv) { this.sendActivationCode(type, authProv); - // //if (!el.disabled) { - // if (this.user != null) { - // this.checkUserAuthentication(type); - // } else { - // // if (this.loginTokenID != null) { - // this.sendActivationCode(type, authProv); - // // } else { - // //this.checkUserAuthentication(type); - // // } - // } } - // checkUserAuthentication(type) { - // // showLoader(true); - // // var req = getCommonRequest(type: type); - // // req.logInTokenID = ""; - - // // var request = CheckPatientAuthenticationReq.fromJson(req.toJson()); - - // // sharedPref.setObject(REGISTER_DATA_FOR_REGISTER, request); - // // authService - // // .checkPatientAuthentication(request) - // // .then((value) => { - // // GifLoaderDialogUtils.hideDialog(context), - // // if (value['isSMSSent']) - // // { - // // sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), - // // this.loginTokenID = value['LogInTokenID'], - // // sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), - // // // Future.delayed(Duration(seconds: 1), () { - // // this.sendActivationCode(type) - // // // }) - // // } - // // else - // // { - // // if (value['IsAuthenticated']) {this.checkActivationCode()} - // // } - // // }) - // // .catchError((err) { - // // print(err); - // // GifLoaderDialogUtils.hideDialog(context); - // // }); - // } Future _getAvailableBiometrics() async { var availableBiometrics; try { @@ -744,7 +703,7 @@ class _VerificationMethodsState extends State { this.checkActivationCode(authProv, value: value); }, () => { - Navigator.pop(context), + //Navigator.pop(context), print('Faild..'), }, ).displayDialog(context); @@ -765,15 +724,6 @@ class _VerificationMethodsState extends State { this.onlySMSBox = true; }); } - - // if (authenticated == true) { - // if (user != null && (user.logInTypeID == 4 || user.logInTypeID == 3)) { - // //this.checkActivationCode(); - // } else { - // // var request = this.getCommonRequest(type: type); - // // this.getMobileInfo(request); - // } - // } } } From eb90fc0161e659c9c9e9d9f288526dd1a3d88371 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 15:53:53 +0200 Subject: [PATCH 180/421] fix bug in assessment --- .../patients/profile/soap_update/update_assessment_page.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 5c0dbc4c..ac1e547e 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -205,7 +205,7 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( - assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day, + assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), fontWeight: FontWeight .bold, fontSize: 16, @@ -722,9 +722,6 @@ class _AddAssessmentDetailsState extends State { null && widget.mySelectedAssessment .selectedICD != null) { - widget.addSelectedAssessment( - widget.mySelectedAssessment, - widget.isUpdate); await submitAssessment( isUpdate: widget.isUpdate, model: model, From 02167afa6bd5ae7977eadafe6de907e0bd7d69c3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 19 Jan 2021 17:42:29 +0200 Subject: [PATCH 181/421] fix 143,144 --- lib/models/patient/patiant_info_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 1b3621c1..f7c4b0a2 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -111,7 +111,7 @@ class PatiantInformtion { projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"]?? json["clinicID"], doctorId: json["DoctorID"]?? json["doctorID"], - patientId: json["PatientID"]?? json["patientID"], + patientId: json["PatientID"]?? json["patientID"]??json['patientMRN'] ?? json['PatientMRN'], doctorName: json["DoctorName"]?? json["doctorName"], doctorNameN: json["DoctorNameN"]?? json["doctorNameN"], firstName: json["FirstName"]?? json["firstName"], From 855ed0ac1269505c06af43b3e5ba3e1133cf6666 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 19 Jan 2021 19:33:08 +0200 Subject: [PATCH 182/421] fix 145 --- lib/config/localized_values.dart | 1 + lib/util/translations_delegate_base.dart | 360 +++++++++++++++++- .../subjective/update_subjective_page.dart | 41 +- 3 files changed, 393 insertions(+), 9 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3103c583..d2d3351d 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -627,4 +627,5 @@ const Map> localizedValues = { 'addProgressNote': {'en': "Add Progress Note", 'ar':"أضف ملاحظة التقدم" }, 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, + 'currentMedications': {'en': "Current Medications", 'ar':"الأدوية الحالية" }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3d1a8d50..4c92bf42 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -25,6 +25,7 @@ class TranslationBase { String get lanArabic => localizedValues['lanArabic'][locale.languageCode]; String get theDoctor => localizedValues['theDoctor'][locale.languageCode]; + String get reply => localizedValues['reply'][locale.languageCode]; String get time => localizedValues['time'][locale.languageCode]; @@ -45,223 +46,380 @@ class TranslationBase { localizedValues['errorNoSchedule'][locale.languageCode]; String get verify => localizedValues['verify'][locale.languageCode]; + String get referralDoctor => localizedValues['referralDoctor'][locale.languageCode]; + String get referringClinic => localizedValues['referringClinic'][locale.languageCode]; + String get frequency => localizedValues['frequency'][locale.languageCode]; + String get priority => localizedValues['priority'][locale.languageCode]; + String get maxResponseTime => localizedValues['maxResponseTime'][locale.languageCode]; + String get clinicDetailsandRemarks => localizedValues['clinicDetailsandRemarks'][locale.languageCode]; + String get answerSuggestions => localizedValues['answerSuggestions'][locale.languageCode]; + String get outPatients => localizedValues['outPatients'][locale.languageCode]; + String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; + String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; + String get patient => localizedValues['patient'][locale.languageCode]; + String get labResult => localizedValues['labResult'][locale.languageCode]; + String get todayStatistics => localizedValues['todayStatistics'][locale.languageCode]; + String get familyMedicine => localizedValues['familyMedicine'][locale.languageCode]; + String get arrived => localizedValues['arrived'][locale.languageCode]; + String get er => localizedValues['er'][locale.languageCode]; + String get walkIn => localizedValues['walkIn'][locale.languageCode]; + String get notArrived => localizedValues['notArrived'][locale.languageCode]; + String get radiology => localizedValues['radiology'][locale.languageCode]; + String get service => localizedValues['service'][locale.languageCode]; + String get referral => localizedValues['referral'][locale.languageCode]; + String get inPatient => localizedValues['inPatient'][locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; + String get patientServices => localizedValues['patientServices'][locale.languageCode]; + String get searchMedicine => localizedValues['searchMedicine'][locale.languageCode]; + String get myReferralPatient => localizedValues['myReferralPatient'][locale.languageCode]; String get referPatient => localizedValues['referPatient'][locale.languageCode]; + String get myReferral => localizedValues['myReferral'][locale.languageCode]; + String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get firstName => localizedValues['firstName'][locale.languageCode]; + String get middleName => localizedValues['middleName'][locale.languageCode]; + String get lastName => localizedValues['lastName'][locale.languageCode]; + String get phoneNumber => localizedValues['phoneNumber'][locale.languageCode]; + String get patientID => localizedValues['patientID'][locale.languageCode]; + String get patientFile => localizedValues['patientFile'][locale.languageCode]; + String get search => localizedValues['search'][locale.languageCode]; + String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get searchMedicineNameHere => localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String get itemsInSearch => localizedValues['itemsInSearch'][locale.languageCode]; + String get qr => localizedValues['qr'][locale.languageCode]; + String get reader => localizedValues['reader'][locale.languageCode]; + String get startScanning => localizedValues['startScanning'][locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; + String get gender => localizedValues['gender'][locale.languageCode]; + String get clinic => localizedValues['clinic'][locale.languageCode]; + String get clinicSelect => localizedValues['clinicSelect'][locale.languageCode]; + String get doctorSelect => localizedValues['doctorSelect'][locale.languageCode]; + String get hospital => localizedValues['hospital'][locale.languageCode]; + String get speciality => localizedValues['speciality'][locale.languageCode]; + String get errorMessage => localizedValues['errorMessage'][locale.languageCode]; + String get patientProfile => localizedValues['patientProfile'][locale.languageCode]; + String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String get vital => localizedValues['vital'][locale.languageCode]; + String get signs => localizedValues['signs'][locale.languageCode]; + String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String get lab => localizedValues['lab'][locale.languageCode]; + String get result => localizedValues['result'][locale.languageCode]; + String get medicines => localizedValues['medicines'][locale.languageCode]; + String get prescription => localizedValues['prescription'][locale.languageCode]; + String get insuranceApprovals => localizedValues['insuranceApprovals'][locale.languageCode]; + String get insurance => localizedValues['insurance'][locale.languageCode]; + String get approvals => localizedValues['approvals'][locale.languageCode]; + String get bodyMeasurements => localizedValues['bodyMeasurements'][locale.languageCode]; + String get temperature => localizedValues['temperature'][locale.languageCode]; + String get pulse => localizedValues['pulse'][locale.languageCode]; + String get respiration => localizedValues['respiration'][locale.languageCode]; + String get bloodPressure => localizedValues['bloodPressure'][locale.languageCode]; + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; + String get errorNoVitalSign => localizedValues['errorNoVitalSign'][locale.languageCode]; + String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String get errorNoLabOrders => localizedValues['errorNoLabOrders'][locale.languageCode]; + String get answerThePatient => localizedValues['answerThePatient'][locale.languageCode]; + String get pleaseEnterAnswer => localizedValues['pleaseEnterAnswer'][locale.languageCode]; + String get replay => localizedValues['replay'][locale.languageCode]; + String get progressNote => localizedValues['progressNote'][locale.languageCode]; + String get progress => localizedValues['progress'][locale.languageCode]; + String get note => localizedValues['note'][locale.languageCode]; + String get searchNote => localizedValues['searchNote'][locale.languageCode]; + String get errorNoProgressNote => localizedValues['errorNoProgressNote'][locale.languageCode]; + String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get generalResult => localizedValues['generalResult'][locale.languageCode]; + String get description => localizedValues['description'][locale.languageCode]; + String get value => localizedValues['value'][locale.languageCode]; + String get range => localizedValues['range'][locale.languageCode]; + String get enterId => localizedValues['enterId'][locale.languageCode]; + String get pleaseEnterYourID => localizedValues['pleaseEnterYourID'][locale.languageCode]; + String get enterPassword => localizedValues['enterPassword'][locale.languageCode]; + String get pleaseEnterPassword => localizedValues['pleaseEnterPassword'][locale.languageCode]; + String get selectYourProject => localizedValues['selectYourProject'][locale.languageCode]; + String get pleaseEnterYourProject => localizedValues['pleaseEnterYourProject'][locale.languageCode]; + String get login => localizedValues['login'][locale.languageCode]; + String get drSulaimanAlHabib => localizedValues['drSulaimanAlHabib'][locale.languageCode]; + String get welcomeTo => localizedValues['welcomeTo'][locale.languageCode]; + String get welcomeBackTo => localizedValues['welcomeBackTo'][locale.languageCode]; + String get home => localizedValues['home'][locale.languageCode]; + String get services => localizedValues['services'][locale.languageCode]; + String get sms => localizedValues['sms'][locale.languageCode]; + String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; + String get faceId => localizedValues['faceId'][locale.languageCode]; + String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; + String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; + String get choose => localizedValues['choose'][locale.languageCode]; + String get verification => localizedValues['verification'][locale.languageCode]; + String get firstStep => localizedValues['firstStep'][locale.languageCode]; + String get yourAccount => localizedValues['yourAccount!'][locale.languageCode]; + String get verify1 => localizedValues['verify1'][locale.languageCode]; + String get youWillReceiveA => localizedValues['youWillReceiveA'][locale.languageCode]; + String get loginCode => localizedValues['loginCode'][locale.languageCode]; + String get smsBy => localizedValues['smsBy'][locale.languageCode]; + String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get youDontHaveAnyPatient => localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode]; + String get youDoNotHaveAnyItem => localizedValues['youDoNotHaveAnyItem'][locale.languageCode]; + String get age => localizedValues['age'][locale.languageCode]; + String get nationality => localizedValues['nationality'][locale.languageCode]; + String get today => localizedValues['today'][locale.languageCode]; + String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String get all => localizedValues['all'][locale.languageCode]; + String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String get errorNoInsuranceApprovals => localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get searchInsuranceApprovals => localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get producerName => localizedValues['producerName'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get doctor => localizedValues['doctor'][locale.languageCode]; + String get ext => localizedValues['ext'][locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String get urgent => localizedValues['urgent'][locale.languageCode]; + String get routine => localizedValues['routine'][locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; + String get referralFrequency => localizedValues['referralFrequency'][locale.languageCode]; + String get selectReferralFrequency => localizedValues['selectReferralFrequency'][locale.languageCode]; + String get clinicalDetailsAndRemarks => localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get remarks => localizedValues['remarks'][locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String get replay2 => localizedValues['replay2'][locale.languageCode]; + String get outPatient => localizedValues['outPatient'][locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; + String get pharmaciesList => localizedValues['pharmaciesList'][locale.languageCode]; + String get price => localizedValues['price'][locale.languageCode]; + String get youCanFindItIn => localizedValues['youCanFindItIn'][locale.languageCode]; + String get radiologyReport => localizedValues['radiologyReport'][locale.languageCode]; + String get orders => localizedValues['orders'][locale.languageCode]; + String get list => localizedValues['list'][locale.languageCode]; + String get searchOrders => localizedValues['searchOrders'][locale.languageCode]; + String get prescriptionDetails => localizedValues['prescriptionDetails'][locale.languageCode]; + String get prescriptionInfo => localizedValues['prescriptionInfo'][locale.languageCode]; + String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; + String get livecare => localizedValues['livecare'][locale.languageCode]; + String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; String get cancel => localizedValues['cancel'][locale.languageCode]; @@ -300,58 +458,94 @@ class TranslationBase { localizedValues['searchPatientImageCaptionBody'][locale.languageCode]; String get welcome => localizedValues['welcome'][locale.languageCode]; + String get typeMedicineName => localizedValues['typeMedicineName'][locale.languageCode]; + String get moreThan3Letter => localizedValues['moreThan3Letter'][locale.languageCode]; + String get gender2 => localizedValues['gender2'][locale.languageCode]; + String get age2 => localizedValues['age2'][locale.languageCode]; + String get sickleave => localizedValues['sick-leaves'][locale.languageCode]; + String get patientSick => localizedValues['patient-sick'][locale.languageCode]; + String get leave => localizedValues['leave'][locale.languageCode]; + String get submit => localizedValues['submit'][locale.languageCode]; + String get doctorName => localizedValues['doc-name'][locale.languageCode]; + String get clinicName => localizedValues['clinicname'][locale.languageCode]; + String get sickLeaveDate => localizedValues['sick-leave-date'][locale.languageCode]; + String get sickLeaveDays => localizedValues['sick-leave-days'][locale.languageCode]; + String get admissionDetail => localizedValues['admissionDetail'][locale.languageCode]; + String get dateTime => localizedValues['dateTime'][locale.languageCode]; + String get date => localizedValues['date'][locale.languageCode]; + String get admissionNo => localizedValues['admissionNo'][locale.languageCode]; + String get losNo => localizedValues['losNo'][locale.languageCode]; + String get area => localizedValues['area'][locale.languageCode]; + String get room => localizedValues['room'][locale.languageCode]; + String get bed => localizedValues['bed'][locale.languageCode]; + String get previousSickLeaveIssue => localizedValues['prevoius-sickleave-issed'][locale.languageCode]; + String get noSickLeaveApplied => localizedValues['no-sickleve-applied'][locale.languageCode]; + String get applyNow => localizedValues['applynow'][locale.languageCode]; + String get addSickLeave => localizedValues['add-sickleave'][locale.languageCode]; + String get add => localizedValues['add'][locale.languageCode]; + String get approved => localizedValues['approved'][locale.languageCode]; + String get extended => localizedValues['extended'][locale.languageCode]; + String get pending => localizedValues['pending'][locale.languageCode]; + String get leaveStartDate => localizedValues['leave-start-date'][locale.languageCode]; + String get daysSickleave => localizedValues['days-sick-leave'][locale.languageCode]; + String get extend => localizedValues['extend'][locale.languageCode]; + String get extendSickLeave => localizedValues['extend-sickleave'][locale.languageCode]; + String get targetPatient => localizedValues['patient-target'][locale.languageCode]; + String get noPrescription => localizedValues['no-priscription-listed'][locale.languageCode]; + String get next => localizedValues['next'][locale.languageCode]; String get emptyMessage => localizedValues['empty-message'][locale.languageCode]; + String get healthRecordInformation => localizedValues['healthRecordInformation'][locale.languageCode]; @@ -359,202 +553,325 @@ class TranslationBase { localizedValues['chiefComplaintLength'][locale.languageCode]; String get referTo => localizedValues['referTo'][locale.languageCode]; + String get referredFrom => localizedValues['referredFrom'][locale.languageCode]; + String get branch => localizedValues['branch'][locale.languageCode]; + String get chooseAppointment => localizedValues['chooseAppointment'][locale.languageCode]; + String get appointmentNo => localizedValues['appointmentNo'][locale.languageCode]; + String get refer => localizedValues['refer'][locale.languageCode]; String get rejected => localizedValues['rejected'][locale.languageCode]; + String get sameBranch => localizedValues['sameBranch'][locale.languageCode]; + String get otherBranch => localizedValues['otherBranch'][locale.languageCode]; + String get dr => localizedValues['dr'][locale.languageCode]; + String get previewHealth => localizedValues['previewHealth'][locale.languageCode]; + String get summaryReport => localizedValues['summaryReport'][locale.languageCode]; + String get accept => localizedValues['accept'][locale.languageCode]; + String get reject => localizedValues['reject'][locale.languageCode]; + String get noAppointmentsErrorMsg => localizedValues['noAppointmentsErrorMsg'][locale.languageCode]; String get referralPatient => localizedValues['referralPatient'][locale.languageCode]; + String get noPrescriptionListed => localizedValues['noPrescriptionListed'][locale.languageCode]; + String get addNow => localizedValues['addNow'][locale.languageCode]; + String get orderType => localizedValues['orderType'][locale.languageCode]; + String get strength => localizedValues['strength'][locale.languageCode]; + String get doseTime => localizedValues['doseTime'][locale.languageCode]; + String get indication => localizedValues['indication'][locale.languageCode]; + String get duration => localizedValues['duration'][locale.languageCode]; + String get instruction => localizedValues['instruction'][locale.languageCode]; + String get rescheduleLeaves => localizedValues['reschedule-leave'][locale.languageCode]; + String get addMedication => localizedValues['addMedication'][locale.languageCode]; + String get route => localizedValues['route'][locale.languageCode]; + String get noReScheduleLeave => localizedValues['no-reschedule-leave'][locale.languageCode]; + String get weight => localizedValues['weight'][locale.languageCode]; + String get kg => localizedValues['kg'][locale.languageCode]; + String get height => localizedValues['height'][locale.languageCode]; + String get cm => localizedValues['cm'][locale.languageCode]; + String get idealBodyWeight => localizedValues['idealBodyWeight'][locale.languageCode]; + String get waistSize => localizedValues['waistSize'][locale.languageCode]; + String get inch => localizedValues['inch'][locale.languageCode]; + String get headCircum => localizedValues['headCircum'][locale.languageCode]; + String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + String get method => localizedValues['method'][locale.languageCode]; + String get pulseBeats => localizedValues['pulseBeats'][locale.languageCode]; + String get rhythm => localizedValues['rhythm'][locale.languageCode]; + String get respBeats => localizedValues['respBeats'][locale.languageCode]; + String get patternOfRespiration => localizedValues['patternOfRespiration'][locale.languageCode]; + String get bloodPressureDiastoleAndSystole => localizedValues['bloodPressureDiastoleAndSystole'][locale.languageCode]; + String get cuffLocation => localizedValues['cuffLocation'][locale.languageCode]; + String get cuffSize => localizedValues['cuffSize'][locale.languageCode]; + String get patientPosition => localizedValues['patientPosition'][locale.languageCode]; + String get fio2 => localizedValues['fio2'][locale.languageCode]; + String get sao2 => localizedValues['sao2'][locale.languageCode]; + String get painManagement => localizedValues['painManagement'][locale.languageCode]; + String get holiday => localizedValues['holiday'][locale.languageCode]; + String get to => localizedValues['to'][locale.languageCode]; + String get coveringDoctor => localizedValues['coveringDoctor'][locale.languageCode]; + String get requestLeave => localizedValues['requestLeave'][locale.languageCode]; + String get pleaseEnterDate => localizedValues['pleaseEnterDate'][locale.languageCode]; + String get pleaseEnterNoOfDays => localizedValues['pleaseEnterNoOfDays'][locale.languageCode]; + String get pleaseEnterRemarks => localizedValues['pleaseEnterRemarks'][locale.languageCode]; + String get update => localizedValues['update'][locale.languageCode]; + String get admission => localizedValues['admission'][locale.languageCode]; + String get request => localizedValues['request'][locale.languageCode]; + String get admissionRequest => localizedValues['admissionRequest'][locale.languageCode]; + String get patientDetails => localizedValues['patientDetails'][locale.languageCode]; + String get specialityAndDoctorDetail => localizedValues['specialityAndDoctorDetail'][locale.languageCode]; + String get referringDate => localizedValues['referringDate'][locale.languageCode]; + String get referringDoctor => localizedValues['referringDoctor'][locale.languageCode]; + String get otherInformation => localizedValues['otherInformation'][locale.languageCode]; + String get expectedDays => localizedValues['expectedDays'][locale.languageCode]; + String get expectedAdmissionDate => localizedValues['expectedAdmissionDate'][locale.languageCode]; + String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; + String get treatmentLine => localizedValues['treatmentLine'][locale.languageCode]; + String get ward => localizedValues['ward'][locale.languageCode]; + String get preAnesthesiaReferred => localizedValues['preAnesthesiaReferred'][locale.languageCode]; + String get admissionType => localizedValues['admissionType'][locale.languageCode]; + String get diagnosis => localizedValues['diagnosis'][locale.languageCode]; + String get allergies => localizedValues['allergies'][locale.languageCode]; + String get preOperativeOrders => localizedValues['preOperativeOrders'][locale.languageCode]; + String get elementForImprovement => localizedValues['elementForImprovement'][locale.languageCode]; + String get dischargeDate => localizedValues['dischargeDate'][locale.languageCode]; + String get dietType => localizedValues['dietType'][locale.languageCode]; + String get dietTypeRemarks => localizedValues['dietTypeRemarks'][locale.languageCode]; + String get save => localizedValues['save'][locale.languageCode]; + String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get ucaf => localizedValues['ucaf'][locale.languageCode]; + String get emergencyCase => localizedValues['emergencyCase'][locale.languageCode]; + String get durationOfIllness => localizedValues['durationOfIllness'][locale.languageCode]; + String get chiefComplaintsAndSymptoms => localizedValues['chiefComplaintsAndSymptoms'][locale.languageCode]; + String get patientFeelsPainInHisBackAndCough => localizedValues['patientFeelsPainInHisBackAndCough'][locale.languageCode]; + String get additionalTextComplaints => localizedValues['additionalTextComplaints'][locale.languageCode]; + String get otherConditions => localizedValues['otherConditions'][locale.languageCode]; + String get other => localizedValues['other'][locale.languageCode]; + String get how => localizedValues['how'][locale.languageCode]; + String get when => localizedValues['when'][locale.languageCode]; + String get where => localizedValues['where'][locale.languageCode]; + String get specifyPossibleLineManagement => localizedValues['specifyPossibleLineManagement'][locale.languageCode]; + String get significantSigns => localizedValues['significantSigns'][locale.languageCode]; + String get backAbdomen => localizedValues['backAbdomen'][locale.languageCode]; + String get reasons => localizedValues['reasons'][locale.languageCode]; + String get createNew => localizedValues['createNew'][locale.languageCode]; String get episode => localizedValues['episode'][locale.languageCode]; + String get medications => localizedValues['medications'][locale.languageCode]; + String get procedures => localizedValues['procedures'][locale.languageCode]; String get chiefComplaints => localizedValues['chiefComplaints'][locale.languageCode]; + String get histories => localizedValues['histories'][locale.languageCode]; + String get allergiesSoap => localizedValues['allergiesSoap'][locale.languageCode]; + String get addChiefComplaints => localizedValues['addChiefComplaints'][locale.languageCode]; + String get historyOfPresentIllness => localizedValues['historyOfPresentIllness'][locale.languageCode]; + String get requiredMsg => localizedValues['requiredMsg'][locale.languageCode]; + String get addHistory => localizedValues['addHistory'][locale.languageCode]; + String get searchHistory => localizedValues['searchHistory'][locale.languageCode]; + String get addSelectedHistories => localizedValues['addSelectedHistories'][locale.languageCode]; + String get addAllergies => localizedValues['addAllergies'][locale.languageCode]; + String get itemExist => localizedValues['itemExist'][locale.languageCode]; + String get selectAllergy => localizedValues['selectAllergy'][locale.languageCode]; + String get selectSeverity => localizedValues['selectSeverity'][locale.languageCode]; + String get leaveCreated => localizedValues['leaveCreated'][locale.languageCode]; + String get vitalSignEmptyMsg => localizedValues['vitalSignEmptyMsg'][locale.languageCode]; + String get referralEmptyMsg => localizedValues['referralEmptyMsg'][locale.languageCode]; + String get referralSuccessMsg => localizedValues['referralSuccessMsg'][locale.languageCode]; + String get diagnoseType => localizedValues['diagnoseType'][locale.languageCode]; + String get condition => localizedValues['condition'][locale.languageCode]; + String get id => localizedValues['id'][locale.languageCode]; + String get quantity => localizedValues['quantity'][locale.languageCode]; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; + String get covered => localizedValues['covered'][locale.languageCode]; + String get approvalRequired => localizedValues['approvalRequired'][locale.languageCode]; + String get uncoveredByDoctor => localizedValues['uncoveredByDoctor'][locale.languageCode]; + String get chiefComplaintEmptyMsg => localizedValues['chiefComplaintEmptyMsg'][locale.languageCode]; @@ -594,77 +911,114 @@ class TranslationBase { String get verifyFingerprint2 => localizedValues['verify-fingerprint'][locale.languageCode]; + String get verificationMessage => localizedValues['verification_message'][locale.languageCode]; + String get validationMessage => localizedValues['validation_message'][locale.languageCode]; String get addAssessment => localizedValues['addAssessment'][locale.languageCode]; + String get assessment => localizedValues['assessment'][locale.languageCode]; String get physicalSystemExamination => localizedValues['physicalSystemExamination'][locale.languageCode]; + String get searchExamination => localizedValues['searchExamination'][locale.languageCode]; + String get addExamination => localizedValues['addExamination'][locale.languageCode]; + String get doc => localizedValues['doc'][locale.languageCode]; - String get allergicTO=> localizedValues['allergicTO'][locale.languageCode]; - String get normal=> localizedValues['normal'][locale.languageCode]; - String get abnormal=> localizedValues['abnormal'][locale.languageCode]; + + String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; + + String get normal => localizedValues['normal'][locale.languageCode]; + + String get abnormal => localizedValues['abnormal'][locale.languageCode]; String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get systolicLng => localizedValues['systolic-lng'][locale.languageCode]; + String get diastolicLng => localizedValues['diastolic-lng'][locale.languageCode]; + String get mass => localizedValues['mass'][locale.languageCode]; + String get tempC => localizedValues['temp-c'][locale.languageCode]; + String get bpm => localizedValues['bpm'][locale.languageCode]; + String get respirationSigns => localizedValues['respiration-signs'][locale.languageCode]; + String get sysDias => localizedValues['sys-dias'][locale.languageCode]; + String get body => localizedValues['body'][locale.languageCode]; + String get respirationRate => localizedValues['respirationRate'][locale.languageCode]; + String get heart => localizedValues['heart'][locale.languageCode]; String get medicalReport => localizedValues['medicalReport'][locale.languageCode]; + String get visitDate => localizedValues['visitDate'][locale.languageCode]; + String get test => localizedValues['test'][locale.languageCode]; + String get addMoreProcedure => localizedValues['addMoreProcedure'][locale.languageCode]; + String get regular => localizedValues['regular'][locale.languageCode]; + String get searchProcedures => localizedValues['searchProcedures'][locale.languageCode]; + String get procedureCategorise => localizedValues['procedureCategorise'][locale.languageCode]; + String get selectProcedures => localizedValues['selectProcedures'][locale.languageCode]; + String get addSelectedProcedures => localizedValues['addSelectedProcedures'][locale.languageCode]; + String get updateProcedure => localizedValues['updateProcedure'][locale.languageCode]; + String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; String get dType => localizedValues['dType'][locale.languageCode]; + String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; + String get progressNoteSOAP => localizedValues['progressNoteSOAP'][locale.languageCode]; + String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; + String get createdBy => localizedValues['createdBy'][locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get currentMedications => + localizedValues['currentMedications'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 6f058792..3e2f2d76 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -52,8 +52,11 @@ class _UpdateSubjectivePageState extends State { bool isAllergiesExpand = false; TextEditingController illnessController = TextEditingController(); TextEditingController complaintsController = TextEditingController(); + TextEditingController medicationController = TextEditingController(); + final formKey = GlobalKey(); - getHistory(SOAPViewModel model) async{ + + getHistory(SOAPViewModel model) async { widget.changeLoadingState(true); GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, @@ -204,6 +207,7 @@ class _UpdateSubjectivePageState extends State { complaintsController.text = helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; + medicationController.text = model.patientChiefComplaintList[0].currentMedication; } await getHistory(model); @@ -302,8 +306,7 @@ class _UpdateSubjectivePageState extends State { controller: illnessController, validator: (value) { if (value == null || value == "") - return TranslationBase - .of(context) + return TranslationBase.of(context) .emptyMessage; else return null; @@ -312,8 +315,34 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 20, ), - // TODO return it back when we need it. - // AddMedication(), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: TranslationBase.of(context) + .currentMedications, + fontSize: 13.5, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: medicationController, + validator: (value) { + if (value == null || value == "") + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }), + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 10, + ), ]), ), isExpand: isChiefExpand, @@ -563,7 +592,7 @@ class _UpdateSubjectivePageState extends State { episodeID: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, chiefComplaint: complaintsController.text, - currentMedication: " currentMedication ", + currentMedication: medicationController.text, hopi: illnessController.text, isLactation: false, ispregnant: false, From e9de8a72e98a370db0543fa950785ac42e8a4ba6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 19 Jan 2021 19:36:47 +0200 Subject: [PATCH 183/421] fix DA-152 --- lib/core/viewModel/SOAP_view_model.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 1ff23a18..d4f50ce6 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -253,7 +253,7 @@ class SOAPViewModel extends BaseViewModel { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); - if(selectedAllergy != null) + if(selectedAllergy != null && element.isChecked) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; }); From e95638bd99f4a3afd6958746306655c2142c97a1 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 19 Jan 2021 19:53:01 +0200 Subject: [PATCH 184/421] fix DA-157 --- lib/widgets/patients/profile/soap_update/update_plan_page.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 437b86f3..d059e445 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -223,6 +223,7 @@ class _UpdatePlanPageState extends State { SizedBox( height: 8, ), + if(widget.patientProgressNote.createdByName !=null) Row( mainAxisAlignment: MainAxisAlignment.start, @@ -239,6 +240,7 @@ class _UpdatePlanPageState extends State { ), ], ), + if(widget.patientProgressNote.editedByName !=null) Row( mainAxisAlignment: MainAxisAlignment.start, From c6156921e80777b15deff5a26b7b258a87bb5884 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 19 Jan 2021 20:00:21 +0200 Subject: [PATCH 185/421] fix DA-197 --- lib/screens/patients/patient_search_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 94102b1b..9da3bc32 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -361,12 +361,12 @@ class _PatientSearchScreenState extends State { textInputType: TextInputType.number, inputFormatter: ONLY_NUMBERS, onSaved: (value) { - value == null + value == null || value=='' ? _patientSearchFormValues.setPatientID = 0 : _patientSearchFormValues.setPatientID = int.parse(value); - if (value.toString().trim().isEmpty) { + if (value.trim().toString().isEmpty) { _patientSearchFormValues.setPatientID = 0; } }), From d53493aa52f637c4ef682927d4635808ed1d3755 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 Jan 2021 11:33:37 +0200 Subject: [PATCH 186/421] fix DA-237 --- .../patients/patient_search_screen.dart | 37 +++++++---- lib/screens/patients/patients_screen.dart | 64 +++++++++++++------ 2 files changed, 69 insertions(+), 32 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 9da3bc32..60ec80e3 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; @@ -15,7 +14,6 @@ import 'package:provider/provider.dart'; import '../../config/config.dart'; import '../../config/size_config.dart'; import '../../lookups/patient_lookup.dart'; -import '../../models/doctor/doctor_profile_model.dart'; import '../../widgets/patients/dynamic_elements.dart'; import '../../widgets/shared/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; @@ -87,7 +85,7 @@ class _PatientSearchScreenState extends State { }); } } catch (err) { - error = err; + error = err.toString(); } } @@ -244,13 +242,14 @@ class _PatientSearchScreenState extends State { TranslationBase.of(context).firstName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setFirstName = "0" : _patientSearchFormValues.setFirstName = value; - if (value.toString().trim().isEmpty) { + if (value != null && + value.toString().trim().isEmpty) { _patientSearchFormValues.setFirstName = "0"; } }, @@ -274,14 +273,17 @@ class _PatientSearchScreenState extends State { TranslationBase.of(context).middleName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setMiddleName = "0" : _patientSearchFormValues.setMiddleName = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues.setMiddleName = - "0"; + "0"; } }, // validator: (value) { @@ -303,12 +305,15 @@ class _PatientSearchScreenState extends State { labelText: TranslationBase.of(context).lastName, borderColor: Colors.white, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues.setLastName = "0" : _patientSearchFormValues.setLastName = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues.setLastName = "0"; } }, @@ -331,13 +336,16 @@ class _PatientSearchScreenState extends State { textInputType: TextInputType.number, inputFormatter: ONLY_NUMBERS, onSaved: (value) { - value == null + value == null || value == '' ? _patientSearchFormValues .setPatientMobileNumber = "0" : _patientSearchFormValues .setPatientMobileNumber = value; - if (value.toString().trim().isEmpty) { + if (value != null && value + .toString() + .trim() + .isEmpty) { _patientSearchFormValues .setPatientMobileNumber = "0"; } @@ -366,7 +374,10 @@ class _PatientSearchScreenState extends State { 0 : _patientSearchFormValues.setPatientID = int.parse(value); - if (value.trim().toString().isEmpty) { + if (value != null && value + .trim() + .toString() + .isEmpty) { _patientSearchFormValues.setPatientID = 0; } }), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ccc90fcb..57abe393 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -481,6 +481,10 @@ class _PatientsScreenState extends State { backGroundcolor: Colors.white, ), + SizedBox( + height: + 5, + ), ], ), Row( @@ -502,13 +506,13 @@ class _PatientsScreenState extends State { fontWeight: FontWeight.bold, backGroundcolor: Colors.white, ), - AppText( item.patientId.toString(), fontSize: 1.8 * SizeConfig.textMultiplier, fontWeight: FontWeight.w300, backGroundcolor: Colors.white, - ),SizedBox( + ), + SizedBox( width: 10, ), ], @@ -517,15 +521,20 @@ class _PatientsScreenState extends State { height: 2.5, ), - AppText( - TranslationBase.of(context).nationality +" : "+( - item.nationalityName??item.nationality), - fontSize: - 1.8 * SizeConfig.textMultiplier, - fontWeight: - FontWeight.bold, - backGroundcolor: - Colors.white, + Container( + child: + AppText( + TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality), + fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + ), + margin: + EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0), + ), + SizedBox( + width: + 10, ), SizedBox( height: @@ -590,16 +599,32 @@ class _PatientsScreenState extends State { Wrap( children: [ AppText( - TranslationBase.of(context).age2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, + TranslationBase + .of( + context) + .age2, + fontSize: 1.8 * + SizeConfig + .textMultiplier, + fontWeight: FontWeight + .bold, + backGroundcolor: Colors + .white, ), AppText( - item.age.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, + item + .age + .toString(), + fontSize: 1.8 * + SizeConfig + .textMultiplier, + fontWeight: FontWeight + .w300, + backGroundcolor: Colors + .white, + ), + SizedBox( + width: 10, ), ], ), @@ -607,6 +632,7 @@ class _PatientsScreenState extends State { height: 2.5, ), + Wrap( children: [ AppText( From c11f195e72c234890fad233643c1967d3baa11df Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 Jan 2021 11:45:38 +0200 Subject: [PATCH 187/421] fix DA-192 --- lib/config/localized_values.dart | 1 + lib/screens/doctor/doctor_reply_screen.dart | 4 +++- lib/util/translations_delegate_base.dart | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d2d3351d..fa15c2cb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -628,4 +628,5 @@ const Map> localizedValues = { 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, 'currentMedications': {'en': "Current Medications", 'ar':"الأدوية الحالية" }, + 'noItem': {'en': "No items exists in this list", 'ar':"لا توجد عناصر في هذه القائمة" }, }; diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index 4326397f..dc6de602 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/doctor/doctor_reply_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -22,7 +23,8 @@ class DoctorReplyScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).replay2, - body: Container( + body: model + .listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem):Container( padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), child: ListView( children: [ diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 4c92bf42..9e1e1516 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1019,6 +1019,8 @@ class TranslationBase { localizedValues['editedBy'][locale.languageCode]; String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get noItem => + localizedValues['noItem'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 83601790502b359fd20174450f8d830891114eb9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 Jan 2021 11:50:46 +0200 Subject: [PATCH 188/421] fix DA-195 --- lib/screens/patients/patient_search_screen.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 60ec80e3..7915a168 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -42,6 +42,7 @@ class _PatientSearchScreenState extends State { String itemText2 = ''; final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; + bool onlyArrived = false; var _patientSearchFormValues = PatientModel( FirstName: "0", @@ -502,10 +503,14 @@ class _PatientSearchScreenState extends State { height: 25, width: 25, child: Checkbox( - value: true, + value: onlyArrived, checkColor: HexColor("#2A930A"), activeColor: Colors.white, - onChanged: (bool newValue) {}), + onChanged: (bool newValue) { + setState(() { + onlyArrived = newValue; + }); + }), ), SizedBox( width: 12, From 88f1dc637f58a9940737adbdd9dfef14e4187f55 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 20 Jan 2021 13:33:46 +0200 Subject: [PATCH 189/421] some fixes --- lib/config/localized_values.dart | 2 ++ lib/core/service/patient-ucaf-service.dart | 19 +++++++++++-- .../viewModel/patient-ucaf-viewmodel.dart | 11 ++++++++ .../profile/UCAF/UCAF-detail-screen.dart | 14 +++++++++- .../vital_sing_chart_and_detials.dart | 28 ++++++++++++------- lib/util/date-utils.dart | 2 +- lib/util/translations_delegate_base.dart | 4 +++ .../profile/PatientHeaderWidgetNoAvatar.dart | 2 +- .../profile/profile_medical_info_widget.dart | 8 +++--- 9 files changed, 71 insertions(+), 19 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3103c583..8872f151 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -627,4 +627,6 @@ const Map> localizedValues = { 'addProgressNote': {'en': "Add Progress Note", 'ar':"أضف ملاحظة التقدم" }, 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, + 'postUcafSuccessMsg': {'en': "UCAF request send successfully", 'ar':"تم ارسال طلب UCAF بنجاح" }, + 'vitalSignDetailEmpty': {'en': "There is no data for this vital sign", 'ar':"لا توجد بيانات لهذه العلامة الحيوية" }, }; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index ac8ff300..38f2407b 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -41,8 +41,8 @@ class UcafService extends LookupService { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientMRN; - body['AppointmentNo'] = patient.appointmentNo; - body['EpisodeID'] = patient.episodeNo; + // body['AppointmentNo'] = patient.appointmentNo; + // body['EpisodeID'] = patient.episodeNo; await baseAppClient.post( GET_PATIENT_VITAL_SIGN_DATA, @@ -101,4 +101,19 @@ class UcafService extends LookupService { }, body: body); } + Future postUCAF(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + + await baseAppClient.post (POST_UCAF, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + } \ No newline at end of file diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index 5586e711..ae8fc96f 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -115,4 +115,15 @@ class UcafViewModel extends BaseViewModel { return null; } } + + Future postUCAF(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _ucafService.postUCAF(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); // but with empty list + } + } } diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 83f2d68b..489c462d 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,11 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/order-procedure.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/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; @@ -82,7 +84,17 @@ class _UcafDetailScreenState extends State { backgroundColor: HexColor("#B8382B"), textColor: Colors.white, fontSize: SizeConfig.textMultiplier * 2.0, - handler: () {}, + handler: () async { + await model.postUCAF(patient); + if(model.state == ViewState.Idle){ + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); + Navigator.of(context).popUntil((route){ + return route.settings.name == PATIENTS_PROFILE; + }); + } else { + DrAppToastMsg.showErrorToast(model.error); + } + }, ), ), Container( diff --git a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart index cc93c77b..fbc0f3e1 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sing_chart_and_detials.dart @@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_details_wideget.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/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:charts_flutter/flutter.dart' as charts; @@ -29,8 +31,8 @@ class VitalSingChartAndDetials extends StatelessWidget { @override Widget build(BuildContext context) { - generateData(); - return Column( + generateData(); + return timeSeriesData.length != 0 ? Column( children: [ AppExpandableNotifier( // isExpand: true, @@ -43,6 +45,12 @@ class VitalSingChartAndDetials extends StatelessWidget { ), ), ], + ) : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height, + child: Center( + child: AppText(TranslationBase.of(context).vitalSignDetailEmpty), + ), ); } @@ -50,14 +58,14 @@ class VitalSingChartAndDetials extends StatelessWidget { if (vitalList.length > 0) { vitalList.reversed.toList().forEach( (element) { - DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn); - if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) - timeSeriesData.add( - TimeSeriesSales2( - new DateTime(elementDate.year, elementDate.month, elementDate.day), - element.toJson()[viewKey].toDouble(), - ), - ); + DateTime elementDate = DateUtils.getDateTimeFromServerFormat(element.createdOn); + if(element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0) + timeSeriesData.add( + TimeSeriesSales2( + new DateTime(elementDate.year, elementDate.month, elementDate.day), + element.toJson()[viewKey].toDouble(), + ), + ); }, ); } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index a624dd2c..c414cd51 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -60,7 +60,7 @@ class DateUtils { var difference = now.difference(firstDate); int minutesInDays = difference.inMinutes; - int hoursInDays = minutesInDays ~/ 60; + int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int int minutes = minutesInDays % 60; int days = hoursInDays ~/ 24; int hours = hoursInDays % 24; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3d1a8d50..49e75caa 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -665,6 +665,10 @@ class TranslationBase { localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get postUcafSuccessMsg => + localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get vitalSignDetailEmpty => + localizedValues['vitalSignDetailEmpty'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart index 25bc80e4..1f1c4079 100644 --- a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -48,7 +48,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "${patient.companyName}", + "${patient.companyName != null ? patient.companyName : ""}", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 054d3c34..b243f15a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -70,7 +70,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - if (int.parse(patientType) == 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -106,7 +106,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - if (selectedPatientType == 7|| int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -128,7 +128,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - if (selectedPatientType == 7|| int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -152,7 +152,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - if (selectedPatientType == 7|| int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, From e32c360f855461fc928d71fa4974753369d750e3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 Jan 2021 16:23:00 +0200 Subject: [PATCH 190/421] fix DA-154,DA-150 --- .../patients/patient_search_screen.dart | 2 +- .../profile/progress_note_screen.dart | 10 ++++-- .../profile/patient-page-header-widget.dart | 2 +- .../profile/soap_update/steps_widget.dart | 34 +++++++++---------- .../soap_update/update_assessment_page.dart | 10 ++++-- .../soap_update/update_objective_page.dart | 8 ++--- .../profile/soap_update/update_plan_page.dart | 2 ++ 7 files changed, 39 insertions(+), 29 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 7915a168..52fbb677 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -42,7 +42,7 @@ class _PatientSearchScreenState extends State { String itemText2 = ''; final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; - bool onlyArrived = false; + bool onlyArrived = true; var _patientSearchFormValues = PatientModel( FirstName: "0", diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index 88e34cdb..56a5cd5e 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -141,9 +141,13 @@ class _ProgressNoteState extends State { indent: 0, endIndent: 0, ), - AppText( - notesList[index]["Notes"], - margin: 5, + Row(mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + notesList[index]["Notes"], + margin: 5, + ), + ], ) ], ), diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index dd2698a9..abd2f5ad 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -77,7 +77,7 @@ class PatientPageHeaderWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).age, + TranslationBase.of(context).age , color: Colors.black, fontWeight: FontWeight.bold, ), diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index b7e9e837..ab088e36 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -36,7 +37,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 0 ? 70 : 50, @@ -74,7 +75,7 @@ class StepsWidget extends StatelessWidget { AppText( "SUBJECTIVE", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize: SizeConfig.textMultiplier * 2.0, ), ], ), @@ -86,7 +87,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => index >= 1 ? changeCurrentTab(1) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 1 ? 70 : 50, @@ -124,7 +125,7 @@ class StepsWidget extends StatelessWidget { AppText( "OBJECTIVE", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ], ), @@ -139,7 +140,7 @@ class StepsWidget extends StatelessWidget { changeCurrentTab(2); }, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 2 ? 70 : 50, @@ -177,7 +178,7 @@ class StepsWidget extends StatelessWidget { AppText( "ASSESSMENT", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ], ), @@ -189,7 +190,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 3 ? 70 : 50, @@ -224,13 +225,12 @@ class StepsWidget extends StatelessWidget { SizedBox( height: index == 3 ? 5 : 10, ), - Container( - margin: EdgeInsets.only(left: index == 3? 15:0), + Center( child: AppText( "PLAN", fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ), ], @@ -259,7 +259,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 0 ? 70 : 50, @@ -309,7 +309,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => index >= 2 ? changeCurrentTab(1) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 1 ? 70 : 50, @@ -347,7 +347,7 @@ class StepsWidget extends StatelessWidget { AppText( "هدف", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ], ), @@ -359,7 +359,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(2) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 2 ? 70 : 50, @@ -400,7 +400,7 @@ class StepsWidget extends StatelessWidget { child: AppText( "تقدير", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ), ], @@ -413,7 +413,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => index >= 3 ? changeCurrentTab(4) : null, child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.center, children: [ Container( width: index == 3 ? 70 : 50, @@ -453,7 +453,7 @@ class StepsWidget extends StatelessWidget { child: AppText( "خطة", fontWeight: FontWeight.bold, - fontSize: 14, + fontSize:SizeConfig.textMultiplier * 2.0, ), ), ], diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index ac1e547e..e6cb4654 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -381,9 +381,13 @@ class _UpdateAssessmentPageState extends State { .next, loading: model.state == ViewState.BusyLocal, onPressed: () async { - widget.changePageViewIndex(3); - widget.changeLoadingState(true); - + if (widget.mySelectedAssessmentList.isEmpty) { + helpers.showErrorToast( + TranslationBase.of(context).requiredMsg); + } else { + widget.changePageViewIndex(3); + widget.changeLoadingState(true); + } }, ), SizedBox( diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index fe80a5c3..a5aad1bf 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -412,11 +412,11 @@ class _UpdateObjectivePageState extends State { widget.changePageViewIndex(2); } } else { - widget.changeLoadingState(true); + // widget.changeLoadingState(true); + // + // widget.changePageViewIndex(2); - widget.changePageViewIndex(2); - - // helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } } diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index d059e445..9d4a4c39 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -321,6 +321,8 @@ class _UpdatePlanPageState extends State { } else { Navigator.of(context).pop(); } + } else { + helpers.showErrorToast(TranslationBase.of(context).requiredMsg); } } From e133a014e8ecdafda1d90e445804f8ceaea4f571 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 20 Jan 2021 17:28:40 +0200 Subject: [PATCH 191/421] Prescription & medical file fix --- lib/core/service/procedure_service.dart | 2 +- .../medical-file/medical_file_details.dart | 26 +- .../prescription/add_prescription_form.dart | 172 +++++-- .../prescription/prescription_screen.dart | 471 +++++++++++++----- lib/screens/procedures/procedure_screen.dart | 3 +- 5 files changed, 493 insertions(+), 181 deletions(-) diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 5836beec..89fe6be3 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -78,7 +78,7 @@ class ProcedureService extends BaseService { patientMRN: 0, pageIndex: 1, clinicId: 0, - pageSize: 100, + pageSize: 300, ); hasError = false; _categoriesList.clear(); diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index d445f471..7ad1d47e 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -632,17 +632,21 @@ class _MedicalFileDetailsState extends State { fontWeight: FontWeight.w700, ), - // AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[0] - // .timeLineEvents[0] - // .consulations[0] - // .lstProcedure[index] - // .orderDate - // .trim(), - // ), + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[0] + .timeLineEvents[0] + .consulations[0] + .lstProcedure[ + index] + .orderDate + .trim(), + ), + ), ], ), Row( diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 3704f47e..f5263724 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -47,6 +47,7 @@ postProcedure( String instruction, PrescriptionViewModel model, DateTime doseTime, + String doseUnit, PatiantInformtion patient}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); @@ -59,9 +60,9 @@ postProcedure( sss.add(PrescriptionRequestModel( covered: true, - dose: 1, + dose: int.parse(dose), itemId: drugId.isEmpty ? 1 : int.parse(drugId), - doseUnitId: 1, + doseUnitId: int.parse(doseUnit), route: route.isEmpty ? 1 : int.parse(route), frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, @@ -114,6 +115,7 @@ class _PrescriptionFormWidgetState extends State { dynamic duration; dynamic doseTime; dynamic indication; + dynamic units; List strengthList; List routeList; @@ -121,6 +123,7 @@ class _PrescriptionFormWidgetState extends State { List durationList; List doseTimeList; List indicationList; + List unitsList; String routeInatial = 'By Mouth'; //PatiantInformtion patient; @@ -135,12 +138,22 @@ class _PrescriptionFormWidgetState extends State { durationList = List(); doseTimeList = List(); indicationList = List(); + unitsList = List(); + dynamic unit1 = {"id": 1, "name": "MG"}; + dynamic unit2 = {"id": 2, "name": "MCG"}; + dynamic unit3 = {"id": 3, "name": "GM"}; dynamic regularOrder = {"id": 1, "name": "regular Order"}; dynamic urgentOrder = {"id": 2, "name": "urgent Order"}; dynamic strength1 = {"id": 1, "name": "1"}; dynamic strength2 = {"id": 2, "name": "2"}; dynamic strength3 = {"id": 3, "name": "3"}; + dynamic strength4 = {"id": 4, "name": "4"}; + dynamic strength5 = {"id": 5, "name": "5"}; + dynamic strength6 = {"id": 6, "name": "6"}; + dynamic strength7 = {"id": 7, "name": "7"}; + dynamic strength8 = {"id": 8, "name": "8"}; + dynamic strength9 = {"id": 9, "name": "9"}; dynamic route1 = {"id": 7, "name": "By Mouth"}; dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; dynamic route3 = {"id": 15, "name": "for INJECTION"}; @@ -169,6 +182,11 @@ class _PrescriptionFormWidgetState extends State { dynamic duration9 = {"id": 9, "name": "For 9 Days"}; dynamic duration10 = {"id": 10, "name": "For 10 Days"}; dynamic duration11 = {"id": 14, "name": "For 14 Days"}; + dynamic duration12 = {"id": 21, "name": "For 21 Days"}; + dynamic duration13 = {"id": 30, "name": "For 30 Days"}; + dynamic duration14 = {"id": 45, "name": "For 45 Days"}; + dynamic duration15 = {"id": 60, "name": "For 60 Days"}; + dynamic duration16 = {"id": 90, "name": "For 90 Days"}; dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; dynamic doseTime2 = {"id": 2, "name": "After Meals"}; dynamic doseTime3 = {"id": 3, "name": "With Meals"}; @@ -195,6 +213,9 @@ class _PrescriptionFormWidgetState extends State { dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; + unitsList.add(unit1); + unitsList.add(unit2); + unitsList.add(unit3); indicationList.add(indication1); indicationList.add(indication2); indicationList.add(indication3); @@ -238,6 +259,12 @@ class _PrescriptionFormWidgetState extends State { strengthList.add(strength1); strengthList.add(strength2); strengthList.add(strength3); + strengthList.add(strength4); + strengthList.add(strength5); + strengthList.add(strength6); + strengthList.add(strength7); + strengthList.add(strength8); + strengthList.add(strength9); durationList.add(duration1); durationList.add(duration2); durationList.add(duration3); @@ -249,6 +276,11 @@ class _PrescriptionFormWidgetState extends State { durationList.add(duration9); durationList.add(duration10); durationList.add(duration11); + durationList.add(duration12); + durationList.add(duration13); + durationList.add(duration14); + durationList.add(duration15); + durationList.add(duration16); referToList.add(regularOrder); referToList.add(urgentOrder); } @@ -415,41 +447,103 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, - child: InkWell( - onTap: strengthList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: strengthList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - strength = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).strength, - strength != null - ? strength['name'] + width: double.infinity, + child: Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * + 0.5, + child: InkWell( + onTap: strengthList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: strengthList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + strength = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } : null, - true), - enabled: false, - ), + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .strength, + strength != null + ? strength['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + width: 10.0, + ), + Container( + width: + MediaQuery.of(context).size.width * + 0.40, + child: InkWell( + onTap: unitsList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: unitsList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['name'] + : null, + true), + enabled: false, + ), + ), + ), + ], ), ), SizedBox(height: spaceBetweenTextFileds), @@ -761,11 +855,11 @@ class _PrescriptionFormWidgetState extends State { selectDate(BuildContext context, PrescriptionViewModel model) async { DateTime selectedDate; - selectedDate = DateTime.now().add(Duration(hours: 15)); + selectedDate = DateTime.now(); final DateTime picked = await showDatePicker( context: context, initialDate: selectedDate, - firstDate: DateTime.now().add(Duration(hours: 15)), + firstDate: DateTime.now(), lastDate: DateTime(2040), initialEntryMode: DatePickerEntryMode.calendar, ); @@ -826,6 +920,8 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, onPressed: () { postProcedure( + dose: strength['id'].toString(), + doseUnit: units['id'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 5e323f7c..88108a73 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -18,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -28,10 +29,86 @@ class NewPrescriptionScreen extends StatefulWidget { } class _NewPrescriptionScreenState extends State { + PersistentBottomSheetController _controller; + final _scaffoldKey = GlobalKey(); int testNum = 0; PatiantInformtion patient; + dynamic route; + dynamic doseTime; + dynamic frequencyUpdate; + + List doseTimeList; + List routeList; + List frequencyList; @override + void initState() { + super.initState(); + routeList = List(); + doseTimeList = List(); + frequencyList = List(); + + dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; + dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; + dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; + dynamic frequency4 = {"id": 8, "name": "As Needed"}; + dynamic frequency5 = {"id": 9, "name": "Bed Time"}; + dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; + dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; + dynamic frequency8 = {"id": 34, "name": "As Directed"}; + dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; + dynamic doseTime2 = {"id": 2, "name": "After Meals"}; + dynamic doseTime3 = {"id": 3, "name": "With Meals"}; + dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; + dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; + dynamic doseTime6 = {"id": 6, "name": "After Supper"}; + dynamic doseTime7 = {"id": 7, "name": "With Supper"}; + dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; + dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; + dynamic doseTime10 = {"id": 10, "name": "While wake"}; + dynamic doseTime11 = {"id": 12, "name": "Any Time"}; + dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic route1 = {"id": 7, "name": "By Mouth"}; + dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; + dynamic route3 = {"id": 15, "name": "for INJECTION"}; + dynamic route4 = {"id": 17, "name": "Drops"}; + dynamic route5 = {"id": 18, "name": "Rub On"}; + dynamic route6 = {"id": 20, "name": "Spary"}; + dynamic route7 = {"id": 27, "name": "In Both EYES"}; + dynamic route8 = {"id": 28, "name": "In Both Ears"}; + dynamic route9 = {"id": 32, "name": "Intramuscular"}; + + frequencyList.add(frequency1); + frequencyList.add(frequency2); + frequencyList.add(frequency3); + frequencyList.add(frequency4); + frequencyList.add(frequency5); + frequencyList.add(frequency6); + frequencyList.add(frequency7); + frequencyList.add(frequency8); + doseTimeList.add(doseTime1); + doseTimeList.add(doseTime2); + doseTimeList.add(doseTime3); + doseTimeList.add(doseTime4); + doseTimeList.add(doseTime5); + doseTimeList.add(doseTime6); + doseTimeList.add(doseTime7); + doseTimeList.add(doseTime8); + doseTimeList.add(doseTime9); + doseTimeList.add(doseTime10); + doseTimeList.add(doseTime11); + doseTimeList.add(doseTime12); + routeList.add(route1); + routeList.add(route2); + routeList.add(route3); + routeList.add(route4); + routeList.add(route5); + routeList.add(route6); + routeList.add(route7); + routeList.add(route8); + routeList.add(route9); + } + Widget build(BuildContext context) { final screenSize = MediaQuery.of(context).size; final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -453,6 +530,15 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( + doseUnit: + model.prescriptionList[0].entityList[index].doseDailyUnitID + .toString(), + doseStreangth: + model.prescriptionList[0].entityList[index].doseDailyQuantity + .toString(), + duration: + model.prescriptionList[0].entityList[index].doseDurationDays + .toString(), startDate: model.prescriptionList[0].entityList[index].startDate .toString(), @@ -463,9 +549,13 @@ class _NewPrescriptionScreenState extends State { index] .doseTimingID .toString(), - frequency: - model.prescriptionList[0].entityList[index].frequencyID - .toString(), + frequency: model + .prescriptionList[ + 0] + .entityList[ + index] + .frequencyID + .toString(), rouat: model .prescriptionList[ 0] @@ -476,22 +566,13 @@ class _NewPrescriptionScreenState extends State { patient: patient, drugId: model - .prescriptionList[ - 0] - .entityList[ - index] - .medicineCode, - drugName: model - .prescriptionList[ - 0] - .entityList[ - index] - .doseDetail, - remarks: model .prescriptionList[0] .entityList[index] - .remarks, + .medicineCode, + drugName: model.prescriptionList[0].entityList[index].doseDetail, + remarks: model.prescriptionList[0].entityList[index].remarks, model: model, + enteredRemarks: model.prescriptionList[0].entityList[index].remarks, context: context); //model.postPrescription(); }, @@ -597,6 +678,10 @@ class _NewPrescriptionScreenState extends State { String rouat, String frequency, String dose, + String duration, + String doseStreangth, + String doseUnit, + String enteredRemarks, String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -605,122 +690,213 @@ class _NewPrescriptionScreenState extends State { showModalBottomSheet( context: context, isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: MediaQuery.of(context).size.height * 0.73, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 30.0, - ), - Column( - children: [ - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'route', - controller: routeController, - keyboardType: TextInputType.number, + builder: (BuildContext context) { + return StatefulBuilder(builder: (BuildContext context, + StateSetter setState /*You can rename this!*/) { + return Container( + height: MediaQuery.of(context).size.height * 0.73, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + drugName.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 30.0, + ), + Column( + children: [ + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + helpers + .showErrorToast('plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).route, + route != null ? route['name'] : null, + true), + enabled: false, + ), + ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Dose Time', - controller: doseController, - keyboardType: TextInputType.number, + SizedBox( + height: 12.0, ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: 'Frequency', - controller: frequencyController, - keyboardType: TextInputType.number, + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, + ), + ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, + SizedBox( + height: 12.0, ), - ), - SizedBox( - height: 12.0, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - Container( - margin: - EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription'.toUpperCase(), - onPressed: () { - updatePrescription( - startDate: startDate, - doseId: dose, - frequencyId: frequency, - routeId: rouat, - patient: patient, - model: model, - drugId: drugId, - remarks: remarksController.text, - route: routeController.text, - frequency: frequencyController.text, - dose: doseController.text); - Navigator.pop(context); - }, + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequencyUpdate != null + ? frequencyUpdate['name'] + : null, + true), + enabled: false, ), - ], + ), ), - ), - ], - ), - ], + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: remarks, + controller: remarksController, + maxLines: 7, + minLines: 4, + ), + ), + SizedBox( + height: 12.0, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'update prescription'.toUpperCase(), + onPressed: () { + updatePrescription( + doseUnit: doseUnit, + doseStreangth: doseStreangth, + duration: duration, + startDate: startDate, + doseId: dose, + frequencyId: frequency, + routeId: rouat, + patient: patient, + model: model, + drugId: drugId, + remarks: remarksController.text, + route: route['id'].toString(), + frequency: + frequencyUpdate['id'].toString(), + dose: doseTime['id'].toString(), + enteredRemarks: enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), + ), + ], + ), + ], + ), ), - ), - )); + )); + }); }); } @@ -735,6 +911,10 @@ class _NewPrescriptionScreenState extends State { String route, String routeId, String startDate, + String doseUnit, + String doseStreangth, + String duration, + String enteredRemarks, PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); PostPrescriptionReqModel updatePrescriptionReqModel = @@ -748,18 +928,19 @@ class _NewPrescriptionScreenState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: 9, //frequency.isNotEmpty ? int.parse(dose) : 1, + dose: int.parse( + doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: 2, + doseUnitId: int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), frequency: frequency.isNotEmpty ? int.parse(frequency) : int.parse(frequencyId), - remarks: remarks.isEmpty ? '' : remarks, + remarks: remarks.isEmpty ? enteredRemarks : remarks, approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: 2, + duration: int.parse(duration), doseStartDate: startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; @@ -773,4 +954,36 @@ class _NewPrescriptionScreenState extends State { DrAppToastMsg.showSuccesToast('Medication has been updated'); } } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 1d6bfb41..667bcc6d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -646,8 +646,7 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; controls.add( - Controls( - code: remarks.isEmpty ? 'ssss' : remarks, controlValue: 'sssssssss'), + Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'test'), ); entityList.forEach((element) { From 896078507f4ca8e0509349a81a666c53955cb709 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 20 Jan 2021 18:41:26 +0300 Subject: [PATCH 192/421] gub fixes --- lib/client/base_app_client.dart | 5 +- lib/core/service/prescription_service.dart | 55 ++++++++++++++++++- .../prescription/add_prescription_form.dart | 6 +- lib/widgets/auth/verification_methods.dart | 16 +++--- lib/widgets/otp/sms-popup.dart | 5 +- 5 files changed, 71 insertions(+), 16 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index c1438159..e38db07c 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -96,8 +96,9 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - await helpers.logout(); - helpers.showErrorToast('Your session expired Please login agian'); + onFailure(getError(parsed), statusCode); + //await helpers.logout(); + //helpers.showErrorToast('Your session expired Please login agian'); } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 6558ad6e..3f8b217a 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -101,7 +101,60 @@ class PrescriptionService extends BaseService { List prescription) async { Map request = { "Prescription": { - "objPatientInfo": {"Gender": patient.gender, "Age": patient.age}, + "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, + "objVitalSign": {"Height": "180", "Weight": "37"}, + "objPrescriptionItems": [ + { + "DrugId": "83-20-00-30-20-03-03", + "DrugName": "WARFARIN 1 MG TAB 28'S (N)", + "Dose": "1", + "DoseType": "04", + "Unit": "actuation(s)", + "FrequencyType": "1/3/Day", + "Duration": "3/Day", + "IsScreen": "true" + }, + { + "DrugId": "64-20-00-10-00-03-15", + "DrugName": "PANADOL 500 MG TAB 24'S(DIS)", + "Dose": "1", + "DoseType": "04", + "Unit": "MG", + "FrequencyType": "3/1/Day", + "Duration": "4/Day", + "RouteID": "24", + "IsScreen": "true" + } + ], + "objAllergies": { + "Allergy": { + "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"} + } + }, + "objDiagnosis": { + "Diagnosis": { + "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"} + } + }, + "IsDoctor": "false", + "IsPharmacist": "false" + }, + "IPAdress": "10.10.10.10", + "Channel": 9, + "LanguageID": 2, + "VersionID": 5.3, + "SessionID": "BlUSkYymTt", + "IsLoginForDoctorApp": true, + "PatientOutSA": 0, + "TokenID": "@dm!n", + "OutSA": true + }; + Map requestN = { + "Prescription": { + "objPatientInfo": { + "Gender": patient.gender == 1 ? 'Male' : 'Female', + "Age": patient.age + }, "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, "objPrescriptionItems": prescription[0].entityList, "objAllergies": allergy, diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 76569c3f..56877240 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -714,9 +714,9 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context) .addMedication, onPressed: () { - formKey.currentState.save(); - Navigator.pop(context); - openDrugToDrug(); + // formKey.currentState.save(); + // Navigator.pop(context); + // openDrugToDrug(); if (strength == null || route == null || frequency == null || diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index adc35982..2bf39881 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -71,6 +71,7 @@ class _VerificationMethodsState extends State { void initState() { super.initState(); _loggedUserFuture = getSharedPref(); + _getAvailableBiometrics(); } Future getSharedPref() async { @@ -499,9 +500,10 @@ class _VerificationMethodsState extends State { authenticateUser(3, BiometricType.fingerprint.index, authProv) }, child: RoundedContainer( - backgroundColor: BiometricType.fingerprint.index == 1 - ? Colors.white - : Colors.white.withOpacity(.7), + backgroundColor: + checkIfBiometricAvailable(BiometricType.fingerprint) + ? Colors.white + : Colors.white.withOpacity(.7), borderColor: Colors.grey, showBorder: true, child: Padding( @@ -566,9 +568,7 @@ class _VerificationMethodsState extends State { }) }, child: RoundedContainer( - backgroundColor: BiometricType.fingerprint.index == 1 - ? Colors.white - : Colors.white.withOpacity(.7), + backgroundColor: Colors.white, borderColor: Colors.grey, showBorder: true, child: Padding( @@ -756,11 +756,11 @@ class _VerificationMethodsState extends State { getDocProfiles(clinic, authProv); } } else { - //changeLoadingStata(false); + Navigator.pop(context); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { - //changeLoadingStata(false); + Navigator.pop(context); helpers.showErrorToast(err); }); } diff --git a/lib/widgets/otp/sms-popup.dart b/lib/widgets/otp/sms-popup.dart index dfcb33cd..fb5a9a0c 100644 --- a/lib/widgets/otp/sms-popup.dart +++ b/lib/widgets/otp/sms-popup.dart @@ -52,7 +52,7 @@ class SMSOTP { String errorMsg; ProjectViewModel projectProvider; String displayTime = ''; - + bool isClosed = false; displayDialog(BuildContext context) async { return showDialog( context: context, @@ -65,6 +65,7 @@ class SMSOTP { IconButton( icon: Icon(Icons.close), onPressed: () { + this.isClosed = true; Navigator.pop(context); this.onFailure(); }, @@ -307,7 +308,7 @@ class SMSOTP { timer = Future.delayed(Duration(seconds: 1), () { if (this.remainingTime > 0) { - startTimer(setState); + if (isClosed == false) startTimer(setState); } else { Navigator.pop(context); } From cc92fe56c66a151b541ade5707bb8129d436eff6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 20 Jan 2021 18:23:02 +0200 Subject: [PATCH 193/421] fix DA-154,DA-150 --- lib/config/localized_values.dart | 4 ++++ lib/util/translations_delegate_base.dart | 11 +++++++++++ .../subjective/update_subjective_page.dart | 2 +- .../soap_update/update_assessment_page.dart | 2 +- .../soap_update/update_objective_page.dart | 2 +- .../profile/soap_update/update_plan_page.dart | 16 ++++++++++++---- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index fa15c2cb..fdc37058 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -629,4 +629,8 @@ const Map> localizedValues = { 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, 'currentMedications': {'en': "Current Medications", 'ar':"الأدوية الحالية" }, 'noItem': {'en': "No items exists in this list", 'ar':"لا توجد عناصر في هذه القائمة" }, + 'assessmentErrorMsg': {'en': "You have to add at least one assessment.", 'ar':"يجب عليك إضافة تقييم واحد على الأقل." }, + 'examinationErrorMsg': {'en': "You have to add at least one examination.", 'ar':"يجب عليك إضافة الفحص واحد على الأقل." }, + 'progressNoteErrorMsg': {'en': "You have to add progress Note.", 'ar':"يجب عليك إضافة ملاحظة التقدم." }, + 'chiefComplaintErrorMsg': {'en': "You have to add chief complaint fields correctly .", 'ar':"يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 9e1e1516..2becf826 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1021,6 +1021,17 @@ class TranslationBase { localizedValues['currentMedications'][locale.languageCode]; String get noItem => localizedValues['noItem'][locale.languageCode]; + + String get assessmentErrorMsg => + localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => + localizedValues['examinationErrorMsg'][locale.languageCode]; + + String get progressNoteErrorMsg => + localizedValues['progressNoteErrorMsg'][locale.languageCode]; + + String get chiefComplaintErrorMsg => + localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 3e2f2d76..184b4391 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -504,7 +504,7 @@ class _UpdateSubjectivePageState extends State { } else { helpers.showErrorToast(TranslationBase .of(context) - .requiredMsg); + .chiefComplaintErrorMsg); } diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e6cb4654..007ef737 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -383,7 +383,7 @@ class _UpdateAssessmentPageState extends State { onPressed: () async { if (widget.mySelectedAssessmentList.isEmpty) { helpers.showErrorToast( - TranslationBase.of(context).requiredMsg); + TranslationBase.of(context).assessmentErrorMsg); } else { widget.changePageViewIndex(3); widget.changeLoadingState(true); diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index a5aad1bf..13ed4c51 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -416,7 +416,7 @@ class _UpdateObjectivePageState extends State { // // widget.changePageViewIndex(2); - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + helpers.showErrorToast(TranslationBase.of(context).examinationErrorMsg); } } diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 9d4a4c39..06cbfc06 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -1,10 +1,12 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/helpers.dart'; @@ -130,7 +132,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty) + if(widget.patientProgressNote==null) Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -322,7 +324,7 @@ class _UpdatePlanPageState extends State { Navigator.of(context).pop(); } } else { - helpers.showErrorToast(TranslationBase.of(context).requiredMsg); + helpers.showErrorToast(TranslationBase.of(context).progressNoteErrorMsg); } } @@ -374,7 +376,13 @@ class _UpdatePlanPageState extends State { ), AppButton( title: TranslationBase.of(context).add.toUpperCase(), - onPressed: () { + onPressed: () async{ + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; + widget.patientProgressNote.editedByName=doctorProfile.doctorName; + widget.patientProgressNote.createdOn= DateTime.now().toString() ; setState(() { print(progressNoteController.text); }); From cd95a581f06e4328b1f423d2ad9e4a7e57f0015e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 20 Jan 2021 18:35:53 +0200 Subject: [PATCH 194/421] simple changes --- .../referral/my-referral-detail-screen.dart | 251 +++++++++--------- .../profile/patient_profile_widget.dart | 20 +- 2 files changed, 149 insertions(+), 122 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 9a59747e..a0cb98b3 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -40,137 +40,146 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: model.patientArrivalList != null ? Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ProfileWelcomeWidget( - AppText( - authProvider.selectedClinicName != null - ? authProvider.selectedClinicName - : authProvider.doctorProfile.clinicDescription, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - height: 100, - ), - SizedBox( - height: 16, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), - PatientReferralItemWidget( - patientName: pendingReferral.patientName, - referralStatus: null, - isReferredTo: false, - isSameBranch: - pendingReferral.isReferralDoctorSameBranch, - referralDoctorName: - pendingReferral.referredByDoctorInfo, - clinicDescription: null, - remark: pendingReferral.remarksFromSource, - ), - SizedBox( - child: GridView.count( - childAspectRatio: 1.8, - crossAxisSpacing: 8, - mainAxisSpacing: 10, - controller: - new ScrollController(keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - crossAxisCount: 2, + body: model.patientArrivalList != null + ? Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileButton( - key: key, - // patient: patient, - // route: RADIOLOGY, - nameLine1: - TranslationBase.of(context).previewHealth, - nameLine2: - TranslationBase.of(context).summaryReport, - icon: 'radiology-1.png'), - PatientProfileButton( - key: key, - // patient: patient, - // route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - icon: 'heartbeat.png'), + ProfileWelcomeWidget( + AppText( + authProvider.selectedClinicName != null + ? authProvider.selectedClinicName + : authProvider + .doctorProfile.clinicDescription, + fontSize: SizeConfig.textMultiplier * 1.7, + color: Colors.white, + textAlign: TextAlign.center, + ), + height: 100, + ), + SizedBox( + height: 16, + ), + Padding( + padding: + const EdgeInsets.symmetric(horizontal: 16.0), + child: AppText( + TranslationBase.of(context).myReferralPatient, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), + PatientReferralItemWidget( + patientName: pendingReferral.patientName, + referralStatus: null, + isReferredTo: false, + isSameBranch: + pendingReferral.isReferralDoctorSameBranch, + referralDoctorName: + pendingReferral.referredByDoctorInfo, + clinicDescription: null, + remark: pendingReferral.remarksFromSource, + ), + SizedBox( + child: GridView.count( + childAspectRatio: 1.8, + crossAxisSpacing: 8, + mainAxisSpacing: 10, + controller: new ScrollController( + keepScrollOffset: false), + shrinkWrap: true, + padding: const EdgeInsets.all(4.0), + crossAxisCount: 2, + children: [ + PatientProfileButton( + key: key, + patient: model.patientArrivalList[0], + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context) + .previewHealth, + nameLine2: TranslationBase.of(context) + .summaryReport, + icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: model.patientArrivalList[0], + route: LAB_ORDERS, + nameLine1: + TranslationBase.of(context).lab, + nameLine2: + TranslationBase.of(context).result, + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: model.patientArrivalList[0], + route: + VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/, + nameLine1: + TranslationBase.of(context).vital, + nameLine2: + TranslationBase.of(context).signs, + icon: 'heartbeat.png'), + ], + ), + ), ], ), ), - ], - ), - ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), - child: Row( - children: [ - Expanded( - child: BorderedButton( - TranslationBase.of(context).accept, - backgroundColor: Color(0xFF4BA821), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: () { - model.responseReferral(pendingReferral, true); - }, ), ), - SizedBox( - height: 8, - ), - Expanded( - child: BorderedButton( - TranslationBase.of(context).reject, - backgroundColor: Color(0xFFB9382C), - textColor: Colors.white, - fontSize: 16, - hPadding: 8, - vPadding: 12, - handler: () { - model.responseReferral(pendingReferral, false); - }, + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), + child: Row( + children: [ + Expanded( + child: BorderedButton( + TranslationBase.of(context).accept, + backgroundColor: Color(0xFF4BA821), + textColor: Colors.white, + fontSize: 16, + hPadding: 8, + vPadding: 12, + handler: () { + model.responseReferral(pendingReferral, true); + }, + ), + ), + SizedBox( + height: 8, + ), + Expanded( + child: BorderedButton( + TranslationBase.of(context).reject, + backgroundColor: Color(0xFFB9382C), + textColor: Colors.white, + fontSize: 16, + hPadding: 8, + vPadding: 12, + handler: () { + model.responseReferral(pendingReferral, false); + }, + ), + ), + ], ), ), ], + ) + : Container( + child: Center( + child: AppText( + TranslationBase.of(context).patientNoDetailErrMsg, + color: HexColor("#B8382B"), + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ), ), - ), - ], - ) : Container( - child: Center( - child: AppText( - TranslationBase.of(context).patientNoDetailErrMsg, - color: HexColor("#B8382B"), - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), - ), ), ); } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 11f1572f..bab7cc84 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -18,6 +18,24 @@ import './profile_medical_info_widget.dart'; class PatientProfileWidget extends StatelessWidget { PatiantInformtion patient; + String getPatientAge(dynamic birthday){ + // https://leechy.dev/calculate-dates-diff-in-dart + DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + final now = DateTime.now(); + int years = now.year - birthDate .year; + int months = now.month - birthDate.month; + int days = now.day - birthDate.day; + if (months < 0 || (months == 0 && days < 0)) { + years--; + months += (days < 0 ? 11 : 12); + } + if (days < 0) { + final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); + days = now.difference(monthAgo).inDays + 1; + } + return "$years Yr $months Mnth $days Day"; + } + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -115,7 +133,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${patient.age}", + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${getPatientAge(patient.dateofBirth)/*patient.age*/}", fontWeight: FontWeight.normal, fontSize: 1.6 * SizeConfig.textMultiplier, ), From 53e88620ec30885cb52378a91c90acd5e66b081b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 21 Jan 2021 11:38:26 +0200 Subject: [PATCH 195/421] fix DA-230 --- lib/screens/QR_reader_screen.dart | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 825abb83..42278d40 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -135,15 +135,15 @@ class _QrReaderScreenState extends State { /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result var result = await BarcodeScanner.scan(); - // if (result.rawContent == "") { - List listOfParams = result.rawContent.split(','); - String patientType = "1"; - setState(() { - isLoading = true; - isError = false; - patientList = []; - }); - String token = await sharedPref.getString(TOKEN); + if (result.rawContent != "") { + List listOfParams = result.rawContent.split(','); + String patientType = "1"; + setState(() { + isLoading = true; + isError = false; + patientList = []; + }); + String token = await sharedPref.getString(TOKEN); // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); // patient.PatientID = 8808; @@ -213,5 +213,5 @@ class _QrReaderScreenState extends State { //DrAppToastMsg.showErrorToast(error); }); } -// } + } } From 03fa9de901bcc736bebd9f13670a03859e079ca8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 21 Jan 2021 11:57:54 +0200 Subject: [PATCH 196/421] fix DA-198 --- lib/lookups/patient_lookup.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index fa75abaa..08b6471f 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -1,8 +1,8 @@ const PATIENT_TYPE = const [ - {"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"}, - {"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"}, + {"text": "Outpatient", "text_ar": "المريض الخارجي", "val": "0"}, + {"text": "Inpatient", "text_ar": "المريض المنوم", "val": "1"}, {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, - {"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"}, + {"text": "Referred", "text_ar": "المريض المحول الي", "val": "3"}, { "text": "Referral Discharge", "text_ar": "المريض المحال المعافى", From ced4edebdedff5aa8ad66ca71b43b275a85506ae Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 14:35:28 +0200 Subject: [PATCH 197/421] patinet profile update --- .../prescription/add_prescription_form.dart | 36 ++++++++++++++ .../profile/profile_medical_info_widget.dart | 49 ++++++++++--------- 2 files changed, 63 insertions(+), 22 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 7b7535d6..44c219fb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -165,6 +165,24 @@ class _PrescriptionFormWidgetState extends State { dynamic route7 = {"id": 27, "name": "In Both EYES"}; dynamic route8 = {"id": 28, "name": "In Both Ears"}; dynamic route9 = {"id": 32, "name": "Intramuscular"}; + dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; + dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; + dynamic route12 = {"id": 15, "name": "for INJECTION"}; + dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; + dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; + dynamic route15 = {"id": 56, "name": "IRRIGATION"}; + dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; + dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; + dynamic route18 = {"id": 51, "name": "EPIDURAL"}; + dynamic route19 = {"id": 47, "name": "Parenteral"}; + dynamic route20 = {"id": 43, "name": "IM"}; + dynamic route21 = {"id": 42, "name": "IV"}; + dynamic route22 = {"id": 41, "name": "Sublingual"}; + dynamic route23 = {"id": 40, "name": "For Nebulization"}; + dynamic route24 = {"id": 39, "name": "Nasal"}; + dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; + dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; + dynamic route27 = {"id": 31, "name": "In Each Nostril"}; dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; @@ -258,6 +276,24 @@ class _PrescriptionFormWidgetState extends State { routeList.add(route7); routeList.add(route8); routeList.add(route9); + routeList.add(route10); + routeList.add(route11); + routeList.add(route12); + routeList.add(route13); + routeList.add(route14); + routeList.add(route15); + routeList.add(route16); + routeList.add(route17); + routeList.add(route18); + routeList.add(route19); + routeList.add(route20); + routeList.add(route21); + routeList.add(route22); + routeList.add(route23); + routeList.add(route24); + routeList.add(route25); + routeList.add(route26); + routeList.add(route27); strengthList.add(strength1); strengthList.add(strength2); strengthList.add(strength3); diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b243f15a..5c64c70a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -91,14 +91,17 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context).previewHealth, - nameLine2: TranslationBase.of(context).summaryReport, - icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'radiology-1.png'), + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -114,20 +117,22 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'heartbeat.png'), - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PROCEDURE, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).procedures, - icon: 'lab.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PROCEDURE, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).procedures, + icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, From a7ca7fb271353e1b8698630fbbfbfbdace7e592e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 21 Jan 2021 15:37:39 +0200 Subject: [PATCH 198/421] fix DA-151 --- .../profile/soap_update/steps_widget.dart | 4 +- .../soap_update/update_assessment_page.dart | 3 + .../soap_update/update_objective_page.dart | 57 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index ab088e36..ac5bee65 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -37,7 +37,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: index == 0 ? 70 : 50, @@ -259,7 +259,7 @@ class StepsWidget extends StatelessWidget { child: InkWell( onTap: () => changeCurrentTab(0), child: Column( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: index == 0 ? 70 : 50, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 007ef737..7bcea474 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -694,6 +694,9 @@ class _AddAssessmentDetailsState extends State { maxLines: 18, minLines: 5, controller: remarkController, + onChanged:(value) { + widget.mySelectedAssessment.remark = remarkController.text; + }, validator: (value) { if (value == null) return TranslationBase diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 13ed4c51..adf1e3d2 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -505,7 +505,7 @@ class _AddExaminationDailogState extends State { }, builder: (_, model, w) => AppScaffold( - // baseViewModel: model, + baseViewModel: model, isShowAppBar: false, body: Center( child: Container( @@ -518,41 +518,38 @@ class _AddExaminationDailogState extends State { height: 16, ), AppText( - "Examinations", + TranslationBase.of(context).physicalSystemExamination, fontWeight: FontWeight.bold, fontSize: 16, ), SizedBox( height: 16, ), - NetworkBaseView( - baseViewModel: model, - child: MasterKeyCheckboxSearchWidget( - model: model, - hintSearchText: TranslationBase.of(context).searchExamination, - buttonName: TranslationBase.of(context).addExamination, - masterList: model.physicalExaminationList, - removeHistory: (history){ - setState(() { - widget.removeExamination(history); - }); - }, - addHistory: (history){ - setState(() { - MySelectedExamination mySelectedExamination = new MySelectedExamination( - selectedExamination: history - ); - widget - .mySelectedExamination - .add( - mySelectedExamination); - }); - }, - addSelectedHistories: (){ - widget.addSelectedExamination(); - }, - isServiceSelected: (master) =>isServiceSelected(master), - ), + MasterKeyCheckboxSearchWidget( + model: model, + hintSearchText: TranslationBase.of(context).searchExamination, + buttonName: TranslationBase.of(context).addExamination, + masterList: model.physicalExaminationList, + removeHistory: (history){ + setState(() { + widget.removeExamination(history); + }); + }, + addHistory: (history){ + setState(() { + MySelectedExamination mySelectedExamination = new MySelectedExamination( + selectedExamination: history + ); + widget + .mySelectedExamination + .add( + mySelectedExamination); + }); + }, + addSelectedHistories: (){ + widget.addSelectedExamination(); + }, + isServiceSelected: (master) =>isServiceSelected(master), ), ]), ))), From 4e4e6a3600f5340430feae5ce5f650a6cc10190a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 21 Jan 2021 16:32:59 +0200 Subject: [PATCH 199/421] fix DA-151 --- lib/core/viewModel/SOAP_view_model.dart | 5 ++- .../subjective/update_history_widget.dart | 35 ++++++++----------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index d4f50ce6..2c312ade 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -92,7 +92,10 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getMasterLookup(MasterKeysService masterKeys) async { + Future getMasterLookup(MasterKeysService masterKeys, {bool isBusyLocal = false}) async { + if(isBusyLocal){ + setState(ViewState.Busy); + }else setState(ViewState.Busy); await _SOAPService.getMasterLookup(masterKeys); if (_SOAPService.hasError) { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 28f9f466..81217025 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -272,36 +272,31 @@ class _AddHistoryDialogState extends State { onModelReady: (model) async { if (model.historyFamilyList.length == 0) { await model.getMasterLookup(MasterKeysService.HistoryFamily); - setState(() { + } - }); + if (model.historySurgicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistorySurgical); + await model.getMasterLookup(MasterKeysService.HistorySports); + } + + if (model.historyMedicalList.length == 0) { + await model.getMasterLookup(MasterKeysService.HistoryMedical); } }, builder: (_, model, w) => AppScaffold( - // baseViewModel: model, + baseViewModel: model, isShowAppBar: false, body: Center( child: Container( child: FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - SizedBox( - height: 10, - ), + widthFactor: 0.9, + child: Column( + children: [ + SizedBox( + height: 10, + ), PriorityBar(onTap: (activePriority) async { widget.changePageViewIndex(activePriority); - if(activePriority ==1) { - if (model.historySurgicalList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistorySurgical); - await model.getMasterLookup(MasterKeysService.HistorySports); - } - } - if(activePriority ==2) { - if (model.historyMedicalList.length == 0) { - await model.getMasterLookup(MasterKeysService.HistoryMedical); - } - } }), SizedBox( height: 20, From 3be693337a81e063395a1a0dd87d6b2dab703315 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 21 Jan 2021 19:19:00 +0200 Subject: [PATCH 200/421] some fixes --- lib/models/patient/patiant_info_model.dart | 9 +++------ lib/widgets/patients/profile/patient_profile_widget.dart | 8 ++++---- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index f7c4b0a2..3547a73d 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -42,6 +42,7 @@ class PatiantInformtion { int patientMRN; String admissionNo; String admissionDate; + String createdOn; String roomId; String bedId; String nursingStationId; @@ -77,6 +78,7 @@ class PatiantInformtion { this.patientType, this.admissionNo, this.admissionDate, + this.createdOn, this.roomId, this.bedId, this.nursingStationId, @@ -129,6 +131,7 @@ class PatiantInformtion { patientType: json["PatientType"]?? json["patientType"], admissionNo: json["AdmissionNo"]?? json["admissionNo"], admissionDate: json["AdmissionDate"]?? json["admissionDate"], + createdOn: json["CreatedOn"]?? json["CreatedOn"], roomId: json["RoomID"]?? json["roomID"], bedId: json["BedID"]?? json["bedID"], nursingStationId: json["NursingStationID"]?? json["nursingStationID"], @@ -158,10 +161,4 @@ class PatiantInformtion { patientMRN :json['patientMRN'] ?? json['PatientMRN'], ); - - - - - - } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index bab7cc84..248d0dd2 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -254,8 +254,8 @@ class PatientProfileWidget extends StatelessWidget { ), Expanded( child: AppText( - patient.admissionDate != null - ? "${DateUtils.convertDateFromServerFormat(patient.admissionDate, 'EEEE dd, MMMM yyyy hh:mm a')}" + patient.createdOn != null + ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" : "", color: Colors.black, fontWeight: FontWeight.normal, @@ -310,10 +310,10 @@ class PatientProfileWidget extends StatelessWidget { ), ), AppText( - patient.admissionDate != null + patient.createdOn != null ? DateUtils .differenceBetweenServerDateAndCurrent( - patient.admissionDate) + patient.createdOn) : "", color: Colors.black, fontWeight: FontWeight.normal, From ba263ada448141f0b50bda98a47ebcd39bcefa30 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 21 Jan 2021 19:55:03 +0200 Subject: [PATCH 201/421] fix DA-201 --- .../model/get_medication_response_model.dart | 36 ++ lib/core/model/search_drug_request_model.dart | 8 +- lib/core/service/prescription_service.dart | 17 + lib/core/viewModel/medicine_view_model.dart | 14 + .../viewModel/prescription_view_model.dart | 1 + .../medicine/medicine_search_screen.dart | 335 +++++++++++------- 6 files changed, 274 insertions(+), 137 deletions(-) create mode 100644 lib/core/model/get_medication_response_model.dart diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/get_medication_response_model.dart new file mode 100644 index 00000000..f9df77a3 --- /dev/null +++ b/lib/core/model/get_medication_response_model.dart @@ -0,0 +1,36 @@ +class GetMedicationResponseModel { + String description; + String genericName; + int itemId; + String keywords; + dynamic price; + dynamic quantity; + + GetMedicationResponseModel( + {this.description, + this.genericName, + this.itemId, + this.keywords, + this.price, + this.quantity}); + + GetMedicationResponseModel.fromJson(Map json) { + description = json['Description']; + genericName = json['GenericName']; + itemId = json['ItemId']; + keywords = json['Keywords']; + price = json['Price']; + quantity = json['Quantity']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['GenericName'] = this.genericName; + data['ItemId'] = this.itemId; + data['Keywords'] = this.keywords; + data['Price'] = this.price; + data['Quantity'] = this.quantity; + return data; + } +} diff --git a/lib/core/model/search_drug_request_model.dart b/lib/core/model/search_drug_request_model.dart index e1cccc43..b64e7d18 100644 --- a/lib/core/model/search_drug_request_model.dart +++ b/lib/core/model/search_drug_request_model.dart @@ -1,18 +1,18 @@ class SearchDrugRequestModel { List search; - String vidaAuthTokenID; + // String vidaAuthTokenID; - SearchDrugRequestModel({this.search, this.vidaAuthTokenID}); + SearchDrugRequestModel({this.search}); SearchDrugRequestModel.fromJson(Map json) { search = json['Search'].cast(); - vidaAuthTokenID = json['VidaAuthTokenID']; + // vidaAuthTokenID = json['VidaAuthTokenID']; } Map toJson() { final Map data = new Map(); data['Search'] = this.search; - data['VidaAuthTokenID'] = this.vidaAuthTokenID; + // data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 6558ad6e..35b5372e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; @@ -16,6 +17,7 @@ class PrescriptionService extends BaseService { List _drugsList = List(); List get drugsList => _drugsList; List doctorsList = []; + List allMedicationList = []; List specialityList = []; List drugToDrug = []; @@ -59,6 +61,21 @@ class PrescriptionService extends BaseService { }, body: _drugRequestModel.toJson()); } + Future getMedicationList() async { + hasError = false; + _drugRequestModel.search =[""]; + await baseAppClient.post(SEARCH_DRUG, + onSuccess: (dynamic response, int statusCode) { + allMedicationList = []; + response['MedicationList']['entityList'].forEach((v) { + allMedicationList.add(GetMedicationResponseModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _drugRequestModel.toJson()); + } + Future postPrescription( PostPrescriptionReqModel postProcedureReqModel) async { hasError = false; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index a86f6dfb..6b780858 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart'; +import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -9,6 +11,9 @@ class MedicineViewModel extends BaseViewModel { get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmaciesList => _medicineService.pharmaciesList; + PrescriptionService _prescriptionService = locator(); + List get allMedicationList => _prescriptionService.allMedicationList; + Future getMedicineItem(String itemName) async { setState(ViewState.Busy); @@ -19,6 +24,15 @@ class MedicineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future getMedicationList() async { + setState(ViewState.Busy); + await _prescriptionService.getMedicationList(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } Future getPharmaciesList(int itemId) async { setState(ViewState.Busy); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 3e39a7fa..e7da4385 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -17,6 +17,7 @@ class PrescriptionViewModel extends BaseViewModel { List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; + List get allMedicationList => _prescriptionService.allMedicationList; Future getPrescription({int mrn}) async { hasError = false; diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 2c5b8213..5e26e65b 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,7 +1,8 @@ import 'dart:math'; -import 'package:doctor_app_flutter/config/config.dart'; +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -11,12 +12,12 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; @@ -45,6 +46,9 @@ class _MedicineSearchState extends State { bool _isInit = true; final SpeechToText speech = SpeechToText(); String lastStatus = ''; + GetMedicationResponseModel _selectedMedication; + GlobalKey key = + new GlobalKey>(); // String lastWords; List _localeNames = []; @@ -84,142 +88,206 @@ class _MedicineSearchState extends State { }); } + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown, + {IconData icon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + @override Widget build(BuildContext context) { return BaseView( - builder: (_, model, w) => AppScaffold( - appBarTitle: TranslationBase.of(context).searchMedicine, - body: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Column( - children: [ - 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, - ), - ), - Padding( - padding: const EdgeInsets.only(top: 5.0), - child: AppText( - TranslationBase.of(context).searchMedicineImageCaption, - fontSize: SizeConfig.heightMultiplier * 2, - ), - ) - ], - ), - SizedBox( - height: 15, - ), - FractionallySizedBox( - widthFactor: 0.9, + onModelReady: (model) async { + if(model.allMedicationList.isNotEmpty) + await model.getMedicationList(); + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase + .of(context) + .searchMedicine, + body: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: 0.97, + child: SingleChildScrollView( child: Column( children: [ - Container( - child: AppTextFormField( - hintText: TranslationBase.of(context) - .searchMedicineNameHere, - controller: myController, - onSaved: (value) {}, - onFieldSubmitted: (value) { - searchMedicine(context, model); - }, - textInputAction: TextInputAction.search, - // TODO return it back when it needed - // prefix: IconButton( - // icon: Icon(Icons.mic), - // color: - // lastStatus == 'listening' ? Colors.red : Colors.grey, - // onPressed: () { - // myController.text = ''; - // setState(() { - // lastStatus = 'listening'; - // }); - // - // startVoiceSearch(); - // }), - inputFormatter: ONLY_LETTERS), + 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, + ), + ), + Padding( + padding: const EdgeInsets.only(top: 5.0), + child: AppText( + TranslationBase.of(context).searchMedicineImageCaption, + fontSize: SizeConfig.heightMultiplier * 2, + ), + ) + ], ), SizedBox( height: 15, ), - Container( - child: Wrap( - alignment: WrapAlignment.center, + FractionallySizedBox( + widthFactor: 0.9, + child: Column( children: [ - // TODO change it secondary button and add loading - AppButton( - title: TranslationBase.of(context).search, - onPressed: () async{ - await searchMedicine(context, model); - - }, - ), - ], - ), - ), - - Column( - children: [ - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase - .of(context) - .youCanFind + - model.pharmacyItemsList.length - .toString() + - " " + + 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( + decoration: textFieldSelectorDecoration( TranslationBase .of(context) - .itemsInSearch, - fontWeight: FontWeight.bold, + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.description + + ('${_selectedMedication.genericName}') + : null, + true, + icon: EvaIcons.search), + enabled: false, ), - ], + ), ), - ), - Container( - height: MediaQuery - .of(context) - .size - .height * 0.35, - child: Container( - child: ListView.builder( + 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: [ + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase + .of(context) + .youCanFind + + model.pharmacyItemsList.length + .toString() + + " " + + TranslationBase + .of(context) + .itemsInSearch, + fontWeight: FontWeight.bold, + ), + ], + ), + ), + Container( + height: MediaQuery + .of(context) + .size + .height * 0.35, + child: Container( + child: ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: - model.pharmacyItemsList == - null - ? 0 - : model - .pharmacyItemsList.length, - itemBuilder: - (BuildContext context, int index) { + itemCount: model.pharmacyItemsList == null + ? 0 + : model.pharmacyItemsList.length, + itemBuilder: (BuildContext context, + int index) { return InkWell( child: MedicineItemWidget( - label: model - .pharmacyItemsList[index] - ["ItemDescription"], - url: model - .pharmacyItemsList[index] - ["ImageSRCUrl"], + label: model.pharmacyItemsList[index] + ["ItemDescription"], + url: model.pharmacyItemsList[index] + ["ImageSRCUrl"], ), onTap: () { Navigator.push( @@ -227,8 +295,8 @@ class _MedicineSearchState extends State { MaterialPageRoute( builder: (context) => PharmaciesListScreen( - itemID: model - .pharmacyItemsList[ + itemID: + model.pharmacyItemsList[ index]["ItemID"], url: model .pharmacyItemsList[ @@ -237,31 +305,32 @@ class _MedicineSearchState extends State { ); }, ); - }, - ), + }, + ), + ), + ), + ], ), - ), - ], + ], + ), ), ], ), ), - ], - ), ), ),),); } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); - if (myController.text.isNullOrEmpty()) { + if (_selectedMedication.isNullOrEmpty()) { helpers.showErrorToast(TranslationBase .of(context) .typeMedicineName); //"Type Medicine Name") return; - } - if (myController.text.length < 3) { + } else + if (_selectedMedication.description.length < 3) { helpers.showErrorToast(TranslationBase .of(context) .moreThan3Letter); @@ -270,7 +339,7 @@ class _MedicineSearchState extends State { GifLoaderDialogUtils.showMyDialog(context); - await model.getMedicineItem(myController.text); + await model.getMedicineItem(_selectedMedication.description); GifLoaderDialogUtils.hideDialog(context); } From 38d9881ed265f12466c60116b0550fa72514c741 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 20:35:56 +0200 Subject: [PATCH 202/421] Prescription date --- lib/widgets/shared/dialogs/search-drugs-dailog-list.dart | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 lib/widgets/shared/dialogs/search-drugs-dailog-list.dart diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart new file mode 100644 index 00000000..e69de29b From 4a4cd03f636109d911ed0b54f8b3afc56fb71e7d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 21 Jan 2021 20:39:09 +0200 Subject: [PATCH 203/421] Prescription date --- lib/core/service/prescription_service.dart | 4 +- lib/core/viewModel/medicine_view_model.dart | 1 - .../viewModel/prescription_view_model.dart | 6 +- lib/core/viewModel/procedure_View_model.dart | 2 +- .../prescription/add_prescription_form.dart | 161 +++++++++++++++++- .../prescription/prescription_screen.dart | 21 ++- lib/screens/procedures/procedure_screen.dart | 37 +++- .../shared/dialogs/dailog-list-select.dart | 8 +- .../dialogs/search-drugs-dailog-list.dart | 92 ++++++++++ 9 files changed, 316 insertions(+), 16 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 6558ad6e..44e34627 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -46,7 +46,9 @@ class PrescriptionService extends BaseService { }, body: _prescriptionReqModel.toJson()); } - Future getDrugs() async { + Future getDrugs({String drugName}) async { + _drugRequestModel = SearchDrugRequestModel(search: [drugName]); + hasError = false; await baseAppClient.post(SEARCH_DRUG, diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index a86f6dfb..2d87c548 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -9,7 +9,6 @@ class MedicineViewModel extends BaseViewModel { get pharmacyItemsList => _medicineService.pharmacyItemsList; get pharmaciesList => _medicineService.pharmaciesList; - Future getMedicineItem(String itemName) async { setState(ViewState.Busy); await _medicineService.getMedicineItem(itemName); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 3e39a7fa..f8f58e4f 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -60,11 +60,11 @@ class PrescriptionViewModel extends BaseViewModel { } } - Future getDrugs() async { + Future getDrugs({String drugName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); - await _prescriptionService.getDrugs(); + setState(ViewState.BusyLocal); + await _prescriptionService.getDrugs(drugName: drugName); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 5e1d8d0c..fb84f505 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -68,7 +68,7 @@ class ProcedureViewModel extends BaseViewModel { } Future updateProcedure( - PostProcedureReqModel postProcedureReqModel, int mrn) async { + {PostProcedureReqModel postProcedureReqModel, int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 44c219fb..2f8b47cb 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -21,6 +21,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -107,6 +108,12 @@ class _PrescriptionFormWidgetState extends State { TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); + final searchController = TextEditingController(); + + var notesList; + var filteredNotesList; + String textSeartch = "Amoxicillin"; + final GlobalKey formKey = GlobalKey(); final double spaceBetweenTextFileds = 12; List referToList; @@ -331,12 +338,13 @@ class _PrescriptionFormWidgetState extends State { @override Widget build(BuildContext context) { + ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getDrugs(), + onModelReady: (model) => model.getDrugs(drugName: textSeartch), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => NetworkBaseView( @@ -375,7 +383,7 @@ class _PrescriptionFormWidgetState extends State { onTap: model.drugsList != null && model.drugsList.length > 0 ? () { - ListSelectDialog dialog = + return drugDialog = ListSelectDialog( list: model.drugsList, attributeName: 'GenericName', @@ -388,17 +396,121 @@ class _PrescriptionFormWidgetState extends State { selectedDrug = selectedValue; }); }, + /* searchWidget: Row( + children: [ + Expanded( + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of( + context) + .search, + searchController.text != + null && + searchController + .text != + "" + ? searchController + .text + : null, + false, + ), + onChanged: (String str) { + textSeartch = str; + }, + controller: + searchController, + enabled: true, + ), + ), + Container( + child: InkWell( + child: Icon( + Icons.search, + color: Colors.black, + ), + onTap: () async { + Navigator.of(context) + .pop(); + await searchMedicine( + context, + model, + textSeartch); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return drugDialog; + }, + ); + }, + ), + margin: + EdgeInsets.symmetric( + horizontal: 8), + ) + ], + ),*/ ); showDialog( barrierDismissible: false, context: context, builder: (BuildContext context) { - return dialog; + return drugDialog; }, ); } : null, - child: TextField( + child: Row( + children: [ + Expanded( + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + TranslationBase.of(context) + .search, + searchController.text != null && + searchController.text != + "" + ? searchController.text + : null, + false, + ), + onChanged: (String str) { + textSeartch = str; + }, + controller: searchController, + enabled: true, + ), + ), + Container( + child: InkWell( + child: Icon( + Icons.search, + color: Colors.black, + ), + onTap: () async { + // Navigator.of(context) + // .pop(); + await searchMedicine( + context, model, textSeartch); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return drugDialog; + }, + ); + }, + ), + margin: EdgeInsets.symmetric( + horizontal: 8), + ) + ], + ), /*TextField( decoration: textFieldSelectorDecoration( TranslationBase.of(context) .searchMedicine, @@ -410,8 +522,8 @@ class _PrescriptionFormWidgetState extends State { Icons.search, color: Colors.black, )), - enabled: false, - ), + enabled: true, + ),*/ ), ), SizedBox( @@ -981,4 +1093,41 @@ class _PrescriptionFormWidgetState extends State { ); }); } + + // searchData(String str, PrescriptionViewModel model) { + // var strExist = str.length > 0 ? true : false; + // + // if (strExist) { + // filteredNotesList = null; + // filteredNotesList = model.drugsList + // .where((note) => + // note["GenericName"].toString().contains(str.toUpperCase())) + // .toList(); + // setState(() { + // notesList = filteredNotesList; + // }); + // } else { + // setState(() { + // notesList = model.drugsList; + // }); + // } + // } + + searchMedicine(context, PrescriptionViewModel model, String str) async { + FocusScope.of(context).unfocus(); + // if (searchController.text.isEmpty()) { + // helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + // //"Type Medicine Name") + // return; + // } + if (searchController.text.length < 0) { + helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + return; + } + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getDrugs(drugName: searchController.text); + GifLoaderDialogUtils.hideDialog(context); + } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index c1f00092..4d000838 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -9,6 +9,7 @@ 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/screens/prescription/add_prescription_form.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; @@ -337,7 +338,25 @@ class _NewPrescriptionScreenState extends State { child: Column( children: [ AppText( - '8\nDEC', + DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .startDate) + .day + .toString(), + color: Colors + .green, + ), + AppText( + Helpers.getMonth(model.prescriptionList[0].entityList[index].startDate != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].startDate) + .month) + : DateTime.now() + .month) + .toUpperCase(), color: Colors .green, ) diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 667bcc6d..5483ffd9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,6 +11,7 @@ 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/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -271,7 +272,36 @@ class _ProcedureScreenState extends State { child: Column( children: [ AppText( - '8\nDEC', + DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .day + .toString(), + color: + Colors.green, + ), + AppText( + Helpers.getMonth(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate != + null + ? (DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .month) + : DateTime + .now() + .month) + .toUpperCase(), color: Colors.green, ) @@ -421,6 +451,8 @@ class _ProcedureScreenState extends State { child: Icon( Icons.edit), onTap: () { + // model + // .updateProcedure(); updateProcedureForm( context, remarks: model @@ -691,7 +723,8 @@ updateProcedure( category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedures = controlsProcedure; - await model.updateProcedure(updateProcedureReqModel, patient.patientMRN); + await model.updateProcedure( + postProcedureReqModel: updateProcedureReqModel, mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index 68dce5a4..fa33a72d 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -1,3 +1,6 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -8,13 +11,15 @@ class ListSelectDialog extends StatefulWidget { final okText; final Function(dynamic) okFunction; dynamic selectedValue; + final Widget searchWidget; ListSelectDialog( {@required this.list, @required this.attributeName, @required this.attributeValueId, @required this.okText, - @required this.okFunction}); + @required this.okFunction, + this.searchWidget}); @override _ListSelectDialogState createState() => _ListSelectDialogState(); @@ -63,6 +68,7 @@ class _ListSelectDialogState extends State { child: SingleChildScrollView( child: Column( children: [ + if (widget.searchWidget != null) widget.searchWidget, ...widget.list .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), diff --git a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart index e69de29b..68dce5a4 100644 --- a/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart +++ b/lib/widgets/shared/dialogs/search-drugs-dailog-list.dart @@ -0,0 +1,92 @@ +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/material.dart'; + +class ListSelectDialog extends StatefulWidget { + final List list; + final String attributeName; + final String attributeValueId; + final okText; + final Function(dynamic) okFunction; + dynamic selectedValue; + + ListSelectDialog( + {@required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction}); + + @override + _ListSelectDialogState createState() => _ListSelectDialogState(); +} + +class _ListSelectDialogState extends State { + @override + void initState() { + super.initState(); + widget.selectedValue = widget.selectedValue ?? widget.list[0]; + } + + @override + Widget build(BuildContext context) { + return showAlertDialog(context); + } + + showAlertDialog(BuildContext context) { + // set up the buttons + Widget cancelButton = FlatButton( + child: Text(TranslationBase.of(context).cancel), + onPressed: () { + Navigator.of(context).pop(); + }); + Widget continueButton = FlatButton( + child: Text(this.widget.okText), + onPressed: () { + this.widget.okFunction(widget.selectedValue); + Navigator.of(context).pop(); + }); +// set up the AlertDialog + AlertDialog alert = AlertDialog( + // title: Text(widget.title), + content: createDialogList(), + actions: [ + cancelButton, + continueButton, + ], + ); + return alert; + } + + Widget createDialogList() { + return Container( + height: MediaQuery.of(context).size.height * 0.5, + child: SingleChildScrollView( + child: Column( + children: [ + ...widget.list + .map((item) => RadioListTile( + title: Text("${item[widget.attributeName].toString()}"), + groupValue: widget.selectedValue[widget.attributeValueId] + .toString(), + value: item[widget.attributeValueId].toString(), + activeColor: Colors.blue.shade700, + selected: item[widget.attributeValueId].toString() == + widget.selectedValue[widget.attributeValueId] + .toString(), + onChanged: (val) { + setState(() { + widget.selectedValue = item; + }); + }, + )) + .toList() + ], + ), + ), + ); + } + + static closeAlertDialog(BuildContext context) { + Navigator.of(context).pop(); + } +} From bada160cf5272b11ba75a0b48f511a2df34d0601 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 23 Jan 2021 18:22:34 +0200 Subject: [PATCH 204/421] Search Medacation --- lib/core/service/prescription_service.dart | 18 +- lib/core/viewModel/medicine_view_model.dart | 5 +- .../viewModel/prescription_view_model.dart | 15 +- .../prescription/add_prescription_form.dart | 305 +++++++----------- .../prescription/prescription_screen.dart | 16 +- 5 files changed, 153 insertions(+), 206 deletions(-) diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 807d8bc1..98c6143b 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -65,17 +65,17 @@ class PrescriptionService extends BaseService { Future getMedicationList() async { hasError = false; - _drugRequestModel.search =[""]; + _drugRequestModel.search = [""]; await baseAppClient.post(SEARCH_DRUG, onSuccess: (dynamic response, int statusCode) { - allMedicationList = []; - response['MedicationList']['entityList'].forEach((v) { - allMedicationList.add(GetMedicationResponseModel.fromJson(v)); - }); - }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; - }, body: _drugRequestModel.toJson()); + allMedicationList = []; + response['MedicationList']['entityList'].forEach((v) { + allMedicationList.add(GetMedicationResponseModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _drugRequestModel.toJson()); } Future postPrescription( diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 6b780858..23dd0306 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -12,8 +12,8 @@ class MedicineViewModel extends BaseViewModel { get pharmaciesList => _medicineService.pharmaciesList; PrescriptionService _prescriptionService = locator(); - List get allMedicationList => _prescriptionService.allMedicationList; - + List get allMedicationList => + _prescriptionService.allMedicationList; Future getMedicineItem(String itemName) async { setState(ViewState.Busy); @@ -24,6 +24,7 @@ class MedicineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + Future getMedicationList() async { setState(ViewState.Busy); await _prescriptionService.getMedicationList(); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 467a715c..34f86ffd 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; @@ -13,11 +14,13 @@ import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign- class PrescriptionViewModel extends BaseViewModel { bool hasError = false; PrescriptionService _prescriptionService = locator(); + List get allMedicationList => + _prescriptionService.allMedicationList; List get prescriptionList => _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; - List get allMedicationList => _prescriptionService.allMedicationList; + //List get allMedicationList => _prescriptionService.allMedicationList; Future getPrescription({int mrn}) async { hasError = false; @@ -46,6 +49,16 @@ class PrescriptionViewModel extends BaseViewModel { } } + Future getMedicationList() async { + setState(ViewState.Busy); + await _prescriptionService.getMedicationList(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future updatePrescription( PostPrescriptionReqModel updatePrescriptionReqModel, int mrn) async { hasError = false; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 2f8b47cb..5c1bd3b4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1,7 +1,9 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; @@ -16,6 +18,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/dynamic_elements.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; @@ -23,6 +26,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; @@ -105,6 +109,9 @@ class _PrescriptionFormWidgetState extends State { TextEditingController instructionController = TextEditingController(); DateTime selectedDate; dynamic selectedDrug; + GetMedicationResponseModel _selectedMedication; + GlobalKey key = + new GlobalKey>(); TextEditingController drugIdController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -344,7 +351,9 @@ class _PrescriptionFormWidgetState extends State { // patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getDrugs(drugName: textSeartch), + onModelReady: (model) async { + await model.getMedicationList(); + }, builder: (BuildContext context, PrescriptionViewModel model, Widget child) => NetworkBaseView( @@ -378,152 +387,73 @@ class _PrescriptionFormWidgetState extends State { //mainAxisAlignment: MainAxisAlignment.end, children: [ Container( - height: screenSize.height * 0.070, + height: MediaQuery.of(context).size.height * + 0.070, child: InkWell( - onTap: model.drugsList != null && - model.drugsList.length > 0 + onTap: model.allMedicationList != null ? () { - return drugDialog = - ListSelectDialog( - list: model.drugsList, - attributeName: 'GenericName', - attributeValueId: 'ItemId', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - selectedDrug = selectedValue; - }); - }, - /* searchWidget: Row( - children: [ - Expanded( - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( - TranslationBase.of( - context) - .search, - searchController.text != - null && - searchController - .text != - "" - ? searchController - .text - : null, - false, - ), - onChanged: (String str) { - textSeartch = str; - }, - controller: - searchController, - enabled: true, - ), - ), - Container( - child: InkWell( - child: Icon( - Icons.search, - color: Colors.black, - ), - onTap: () async { - Navigator.of(context) - .pop(); - await searchMedicine( - context, - model, - textSeartch); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return drugDialog; - }, - ); - }, - ), - margin: - EdgeInsets.symmetric( - horizontal: 8), - ) - ], - ),*/ - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return drugDialog; - }, - ); + setState(() { + _selectedMedication = null; + }); } : null, - child: Row( - children: [ - Expanded( - child: TextField( - decoration: Helpers - .textFieldSelectorDecoration( + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( TranslationBase.of(context) - .search, - searchController.text != null && - searchController.text != - "" - ? searchController.text + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .genericName : null, - false, + true, ), - onChanged: (String str) { - textSeartch = str; - }, - controller: searchController, - enabled: true, - ), - ), - Container( - child: InkWell( - child: Icon( - Icons.search, - color: Colors.black, + 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( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .description + + ('${_selectedMedication.genericName}') + : null, + true, ), - onTap: () async { - // Navigator.of(context) - // .pop(); - await searchMedicine( - context, model, textSeartch); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return drugDialog; - }, - ); - }, + enabled: false, ), - margin: EdgeInsets.symmetric( - horizontal: 8), - ) - ], - ), /*TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicine, - selectedDrug != null - ? selectedDrug['GenericName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: true, - ),*/ ), ), SizedBox( @@ -603,47 +533,21 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.5, - child: InkWell( - onTap: strengthList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: strengthList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - strength = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .strength, - strength != null - ? strength['name'] - : null, - true), - enabled: false, - ), + 0.650, + child: TextFields( + hintText: TranslationBase.of(context) + .strength, + controller: strengthController, + keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty && + strengthController.text.length > + 4) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, ), ), SizedBox( @@ -652,7 +556,7 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.40, + 0.250, child: InkWell( onTap: unitsList != null ? () { @@ -958,15 +862,15 @@ class _PrescriptionFormWidgetState extends State { onPressed: () { formKey.currentState.save(); Navigator.pop(context); - openDrugToDrug(); - if (strength == null || - route == null || + //openDrugToDrug(); + if (route == null || frequency == null || indication == null || doseTime == null || duration == null || - selectedDrug == null || - selectedDate == null) { + selectedDate == null || + units == null || + _selectedMedication == null) { DrAppToastMsg.showErrorToast( "Please Fill All Fields"); return; @@ -974,7 +878,32 @@ class _PrescriptionFormWidgetState extends State { if (formKey.currentState.validate()) { Navigator.pop(context); - openDrugToDrug(); + { + postProcedure( + dose: strengthController.text, + doseUnit: + units['id'].toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: frequency['id'] + .toString(), + route: route['id'].toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController + .text, + doseTime: selectedDate); + } } { // Navigator.push( @@ -1070,7 +999,7 @@ class _PrescriptionFormWidgetState extends State { title: TranslationBase.of(context).addMedication, onPressed: () { postProcedure( - dose: strength['id'].toString(), + dose: strengthController.text, doseUnit: units['id'].toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), @@ -1079,7 +1008,7 @@ class _PrescriptionFormWidgetState extends State { frequency: frequency['id'].toString(), route: route['id'].toString(), drugId: selectedDrug['ItemId'].toString(), - strength: strength['id'].toString(), + strength: strengthController.text, indication: indicationController.text, instruction: instructionController.text, doseTime: selectedDate); diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4d000838..00fc38b8 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -754,8 +754,7 @@ class _NewPrescriptionScreenState extends State { route = selectedValue; }); if (route == null) { - helpers - .showErrorToast('plase fill'); + route = route['id']; } }, ); @@ -904,10 +903,15 @@ class _NewPrescriptionScreenState extends State { model: model, drugId: drugId, remarks: remarksController.text, - route: route['id'].toString(), - frequency: - frequencyUpdate['id'].toString(), - dose: doseTime['id'].toString(), + route: route != null + ? route['id'].toString() + : rouat, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : dose, enteredRemarks: enteredRemarks); Navigator.pop(context); }, From 1de25aae2f87074301cbe06c2f411c5500e9b893 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 01:35:15 +0200 Subject: [PATCH 205/421] fix issue on assessment design --- lib/config/localized_values.dart | 4 ++-- .../profile/soap_update/update_assessment_page.dart | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 77836895..c56f2e02 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -329,7 +329,7 @@ const Map> localizedValues = { 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, - 'appointmentNo': {'en': "Appointment #:", 'ar': '# الموعد:'}, + 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, 'refer': {'en': "REFER", 'ar': 'إحالة'}, 'rejected': {'en': "Rejected", 'ar': 'مرفوض'}, 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, @@ -582,7 +582,7 @@ const Map> localizedValues = { }, 'searchExamination': {'en': "Search Examination", 'ar': "فحص البحث"}, 'addExamination': {'en': "Add Examination", 'ar': "اضافه"}, - 'doc': {'en': "Doc :", 'ar': " د: "}, + 'doc': {'en': "Doc : ", 'ar': " د : "}, 'patientNoDetailErrMsg': { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 7bcea474..e42cfcf8 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,5 +1,6 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; @@ -8,6 +9,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/helpers.dart'; @@ -263,7 +265,7 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).dType+':', + TranslationBase.of(context).dType+' : ', fontWeight: FontWeight .bold, fontSize: 16, @@ -788,7 +790,11 @@ class _AddAssessmentDetailsState extends State { helpers .showErrorToast(model.error); } else { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; + mySelectedAssessment.doctorName = doctorProfile.doctorName; if (!isUpdate) { // widget.mySelectedAssessmentList.add(mySelectedAssessment); From f0cd33ae433708da509bcc1f459ec45fd6637168 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 02:31:27 +0200 Subject: [PATCH 206/421] fix issue on assessment design --- lib/config/localized_values.dart | 2 +- .../profile/patient_profile_widget.dart | 2 +- .../subjective/update_subjective_page.dart | 1 - .../soap_update/update_assessment_page.dart | 2 +- .../profile/soap_update/update_plan_page.dart | 18 +++++++---- lib/widgets/shared/app_scaffold_widget.dart | 30 ++++++++++--------- 6 files changed, 31 insertions(+), 24 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c56f2e02..71929250 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -7,7 +7,7 @@ const Map> localizedValues = { 'theDoctor': {'en': 'Doctor', 'ar': 'الطبيب'}, 'reply': {'en': 'Reply', 'ar': 'رد'}, 'time': {'en': 'Time', 'ar': 'الوقت'}, - 'fileNo': {'en': 'File No:', 'ar': 'رقم الملف:'}, + 'fileNo': {'en': 'File No : ', 'ar': 'رقم الملف :'}, 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, 'mySchedule': {'en': 'Schedule', 'ar': 'جدولي'}, diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index bab7cc84..67c489e7 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -94,7 +94,7 @@ class PatientProfileWidget extends StatelessWidget { fontWeight: FontWeight.bold, ), SizedBox( - width: 20, + width: 4, ), AppText( patient.patientId.toString(), diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 184b4391..a6167c43 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -522,7 +522,6 @@ class _UpdateSubjectivePageState extends State { if (postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM == null) postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM = []; - //TODO: make static value dynamic postAllergyRequestModel.listHisProgNotePatientAllergyDiseaseVM.add( ListHisProgNotePatientAllergyDiseaseVM( allergyDiseaseId: allergy.selectedAllergy.id, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e42cfcf8..e6e1a908 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -332,7 +332,7 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( - "ICD: ".toUpperCase(), + "ICD : ".toUpperCase(), fontWeight: FontWeight .bold, fontSize: 16, diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 06cbfc06..04b2b73d 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -132,7 +132,7 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(widget.patientProgressNote==null) + if(widget.patientProgressNote.planNote == null) Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), @@ -161,7 +161,7 @@ class _UpdatePlanPageState extends State { SizedBox( height: 20, ), - if (progressNoteController.text !='') + if ( widget.patientProgressNote.planNote != null) Container( margin: EdgeInsets.only(left: 5, right: 5, top: 15), @@ -308,12 +308,16 @@ class _UpdatePlanPageState extends State { patientMRN: widget.patientInfo.patientMRN, episodeId: widget.patientInfo.episodeNo, appointmentNo: widget.patientInfo.appointmentNo, - planNote: progressNoteController.text, doctorID: '', editedBy: ''); + planNote: widget.patientProgressNote.planNote, doctorID: '', editedBy: ''); if(model.patientProgressNoteList.isEmpty){ await model.postProgressNote(postProgressNoteRequestModel); }else { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + + DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + postProgressNoteRequestModel.editedBy =doctorProfile.doctorID; await model.patchProgressNote(postProgressNoteRequestModel); } @@ -335,12 +339,12 @@ class _UpdatePlanPageState extends State { context: context, builder: (context) { return FractionallySizedBox( - heightFactor: 0.5, + heightFactor: 0.6, child: Container( child: FractionallySizedBox( widthFactor: 0.9, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + child: ListView( + // crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 16, @@ -355,6 +359,7 @@ class _UpdatePlanPageState extends State { ), Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), + child: TextFields( hintText: TranslationBase.of(context).addProgressNote, fontSize: 13.5, @@ -383,6 +388,7 @@ class _UpdatePlanPageState extends State { widget.patientProgressNote.createdByName = widget.patientProgressNote.createdByName??doctorProfile.doctorName; widget.patientProgressNote.editedByName=doctorProfile.doctorName; widget.patientProgressNote.createdOn= DateTime.now().toString() ; + widget.patientProgressNote.planNote = progressNoteController.text; setState(() { print(progressNoteController.text); }); diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 4ddd7873..d60edb9f 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -1,11 +1,12 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; + import '../../widgets/shared/app_loader_widget.dart'; import 'app_texts_widget.dart'; import 'network_base_view.dart'; @@ -64,20 +65,21 @@ class AppScaffold extends StatelessWidget { children: [body, buildAppLoaderWidget(isLoading)]) : Center( child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/undraw_connected_world_wuay.png", - height: 250, - ), - AppText('No Internet Connection') - ], - ), - )); + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/undraw_connected_world_wuay.png", + height: 250, + ), + AppText('No Internet Connection') + ], + ), + ), + ); } - Widget buildAppLoaderWidget(bool isloading) { - return isloading ? AppLoaderWidget() : Container(); + Widget buildAppLoaderWidget(bool isLoading) { + return isLoading ? AppLoaderWidget() : Container(); } } From 735698ce90352e55b811f140203ae389ebfa7abf Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 24 Jan 2021 09:27:14 +0300 Subject: [PATCH 207/421] bug fixes --- lib/config/localized_values.dart | 47 ++- lib/core/service/sickleave_service.dart | 2 +- lib/core/viewModel/project_view_model.dart | 19 +- lib/screens/auth/login_screen.dart | 12 +- lib/screens/dashboard_screen.dart | 2 +- .../medical-file/medical_file_page.dart | 53 +-- .../add-rescheduleleave.dart | 2 +- .../reschedule-leaves/reschedule_leave.dart | 55 ++- lib/screens/sick-leave/add-sickleave.dart | 14 +- lib/util/helpers.dart | 2 +- lib/util/translations_delegate_base.dart | 20 +- lib/widgets/auth/login_form.dart | 78 ++-- lib/widgets/auth/verification_methods.dart | 355 +++++++++--------- lib/widgets/doctor/my_schedule_widget.dart | 45 +-- .../profile/profile_medical_info_widget.dart | 6 +- lib/widgets/shared/app_drawer_widget.dart | 11 +- 16 files changed, 349 insertions(+), 374 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index bdb4f095..d06fa211 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -587,9 +587,9 @@ const Map> localizedValues = { 'en': "There is no detail for this patient", 'ar': "لا توجد تفاصيل لهذا المريض" }, - 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, - 'normal': {'en': "Normal", 'ar':"عادي" }, - 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, + 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, + 'normal': {'en': "Normal", 'ar': "عادي"}, + 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, @@ -620,15 +620,34 @@ const Map> localizedValues = { }, 'updateProcedure': {'en': "Update Procedure", 'ar': "تحديث العملية"}, 'orderProcedure': {'en': "order procedure", 'ar': "طلب العمليات"}, - 'nameOrICD': {'en': "Name or ICD", 'ar':"الاسم او  ICD" }, - 'dType': {'en': "Type", 'ar':"النوع" }, - 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar':"أضف تفاصيل التقييم" }, - 'progressNoteSOAP': {'en': "Progress Note", 'ar':"ملاحظة التقدم" }, - 'addProgressNote': {'en': "Add Progress Note", 'ar':"أضف ملاحظة التقدم" }, - 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, - 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, - 'currentMedications': {'en': "Current Medications", 'ar':"الأدوية الحالية" }, - 'noItem': {'en': "No items exists in this list", 'ar':"لا توجد عناصر في هذه القائمة" }, - 'postUcafSuccessMsg': {'en': "UCAF request send successfully", 'ar':"تم ارسال طلب UCAF بنجاح" }, - 'vitalSignDetailEmpty': {'en': "There is no data for this vital sign", 'ar':"لا توجد بيانات لهذه العلامة الحيوية" }, + 'nameOrICD': {'en': "Name or ICD", 'ar': "الاسم او  ICD"}, + 'dType': {'en': "Type", 'ar': "النوع"}, + 'addAssessmentDetails': { + 'en': "Add Assessment Details", + 'ar': "أضف تفاصيل التقييم" + }, + 'progressNoteSOAP': {'en': "Progress Note", 'ar': "ملاحظة التقدم"}, + 'addProgressNote': {'en': "Add Progress Note", 'ar': "أضف ملاحظة التقدم"}, + 'createdBy': {'en': "Created By :", 'ar': "أضيفت : "}, + 'editedBy': {'en': "Edited By :", 'ar': "عدلت : "}, + 'currentMedications': {'en': "Current Medications", 'ar': "الأدوية الحالية"}, + 'noItem': { + 'en': "No items exists in this list", + 'ar': "لا توجد عناصر في هذه القائمة" + }, + 'postUcafSuccessMsg': { + 'en': "UCAF request send successfully", + 'ar': "تم ارسال طلب UCAF بنجاح" + }, + 'vitalSignDetailEmpty': { + 'en': "There is no data for this vital sign", + 'ar': "لا توجد بيانات لهذه العلامة الحيوية" + }, + 'onlyOfftimeHoliday': { + 'en': "You can only apply holiday or offtime from mobile app", + 'ar': "يمكنك فقط تطبيق عطلة أو إجازة من تطبيق الهاتف" + }, + 'active': {'en': "Active", 'ar': "نشيط"}, + 'hold': {'en': "Hold", 'ar': "معلق"}, + 'loading': {'en': "Loading...", 'ar': "جار التحميل..."} }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 63a7496c..15d77d5c 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -100,7 +100,7 @@ class SickLeaveService extends BaseService { hasError = true; super.error = error; }, - body: {'PatientMRN': patientMRN}, + body: {'PatientMRN': patientMRN, "Status": 0}, ); } diff --git a/lib/core/viewModel/project_view_model.dart b/lib/core/viewModel/project_view_model.dart index aed67d83..e144042e 100644 --- a/lib/core/viewModel/project_view_model.dart +++ b/lib/core/viewModel/project_view_model.dart @@ -114,18 +114,17 @@ class ProjectViewModel with ChangeNotifier { } void getProfile() async { - // Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - // DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); - // ProfileReqModel docInfo = new ProfileReqModel( - // doctorID: doctorProfile.doctorID, - // clinicID: doctorProfile.clinicID, - // license: true, - // projectID: doctorProfile.projectID, - // tokenID: '', - // languageID: 2); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: doctorProfile.clinicID, + license: true, + projectID: doctorProfile.projectID, + ); Provider.of(AppGlobal.CONTEX, listen: false) - .getDocProfiles(ProfileReqModel().toJson()) + .getDocProfiles(docInfo.toJson()) .then((res) async { sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); }).catchError((err) { diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index 1ed441e4..84121abf 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/imei_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -120,18 +121,9 @@ class _LoginsreenState extends State { ), ], ) - - // : Column( - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // AuthHeader(loginType.unknownUser), - // KnownUserLogin(), - // ], - // ), ])) ]) - : Center(child: CircularProgressIndicator()), + : Center(child: AppLoaderWidget()), ), )); } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 18ad7d8d..76f4e16e 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -116,7 +116,7 @@ class _DashboardScreenState extends State { IsLoginForDoctorApp: true, PatientOutSA: false); return BaseView( - //onModelReady: (model) => model.getDashboard(), + onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 069dfbc2..54d978e3 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -4,6 +4,7 @@ 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/screens/medical-file/medical_file_details.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/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -34,57 +35,7 @@ class _MedicalFilePageState extends State { child: Container( child: Column( children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], - ) - ], - ), - ), + PatientPageHeaderWidget(patient), Divider( height: 1.0, thickness: 1.0, diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 685259b4..b4ebecf4 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -210,7 +210,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { ], ), ), - (item.status == 1) + (item.status == 2) ? Expanded( flex: 1, child: IconButton( diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 5d546c04..f0bf122f 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -54,8 +54,8 @@ class _RescheduleLeaveScreen extends State { var clinicID; var fromTime; var toTime; - TextEditingController _controller4; - TextEditingController _controller5; + TextEditingController _controller4 = new TextEditingController(); + TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { var date = new DateTime.now(); var initialDate = id == 'fromDate' @@ -718,10 +718,16 @@ class _RescheduleLeaveScreen extends State { ? TranslationBase.of(context).update : TranslationBase.of(context).add, onPressed: () { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } } else { - addRecheduleLeave(model2); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .onlyOfftimeHoliday); } }, ), @@ -750,9 +756,21 @@ class _RescheduleLeaveScreen extends State { this.profile = p; if (widget.updateData != null) { this.clinicID = widget.updateData.clinicId; + final df = new DateFormat('HH:mm:ss'); + final dateFormat = new DateFormat('yyyy-MM-dd'); - _toDateController.text = widget.updateData.dateTimeFrom; - _toDateController2.text = widget.updateData.dateTimeTo; + _toDateController.text = + dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); + //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = + df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); + _toDateController2.text = + dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); + _controller5.text = toTime; + _controller4.text = fromTime; + toDate = _toDateController2.text; + fromDate = _toDateController.text; } }); } @@ -827,20 +845,29 @@ class _RescheduleLeaveScreen extends State { } updateRecheduleLeave(model) { - final df = new DateFormat('yyyy-MM-ddThh:mm:ss'); + final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); - + var fromDates = fromDate; + var toDates = toDate; if (offTime == '1') { - fromDate = dateFormat.format(fromDate) + 'T' + fromTime + '00'; - toDate = dateFormat.format(fromDate) + 'T' + toTime + '00'; + fromDate = df.format(DateTime.parse(fromDates)) + + 'T' + + fromTime + + ':' + + DateTime.now().second.toString(); + toDate = df.format(DateTime.parse(fromDates)) + + 'T' + + toTime + + ':' + + DateTime.now().second.toString(); } else { - fromDate = df.format(fromDate); - toDate = df.format(toDate); + fromDate = df.format(fromDates); + toDate = df.format(toDates); } Map request = { "Requisition": { - "requisitionNo": 0, + "requisitionNo": widget.updateData.requisitionNo, "requisitionType": offTime, "clinicId": this.profile['ClinicID'], "doctorId": this.profile['DoctorID'], diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index d456f2a6..93353d85 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -56,20 +56,22 @@ class AddSickLeavScreen extends StatelessWidget { item.status == 1 ? TranslationBase.of( context) - .approved + .hold : item.status == 2 ? TranslationBase.of( context) - .extended + .active : TranslationBase.of( context) - .pending, + .all, fontWeight: FontWeight.bold, color: Colors.white, ), color: item.status == 1 - ? Colors.green - : Colors.yellow[800], + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, ), Row( children: [ @@ -96,7 +98,7 @@ class AddSickLeavScreen extends StatelessWidget { ), Row(children: [ AppText( - item.remarks, + item.remarks ?? "", ) ]), ], diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a7229ca2..07709fc9 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -317,7 +317,7 @@ class Helpers { listOfHours.forEach((element) { WorkingHours workingHours = WorkingHours(); var from = element.substring( - element.indexOf('m ') + 2, element.indexOf('To') - 2); + element.indexOf('m ') + 2, element.indexOf('To') - 1); workingHours.from = from.trim(); var to = element.substring(element.indexOf('To') + 2); workingHours.to = to.trim(); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b91aea9b..13efb440 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -997,11 +997,9 @@ class TranslationBase { String get orderProcedure => localizedValues['orderProcedure'][locale.languageCode]; - String get nameOrICD => - localizedValues['nameOrICD'][locale.languageCode]; + String get nameOrICD => localizedValues['nameOrICD'][locale.languageCode]; - String get dType => - localizedValues['dType'][locale.languageCode]; + String get dType => localizedValues['dType'][locale.languageCode]; String get addAssessmentDetails => localizedValues['addAssessmentDetails'][locale.languageCode]; @@ -1012,19 +1010,21 @@ class TranslationBase { String get addProgressNote => localizedValues['addProgressNote'][locale.languageCode]; - String get createdBy => - localizedValues['createdBy'][locale.languageCode]; + String get createdBy => localizedValues['createdBy'][locale.languageCode]; - String get editedBy => - localizedValues['editedBy'][locale.languageCode]; + String get editedBy => localizedValues['editedBy'][locale.languageCode]; String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; - String get noItem => - localizedValues['noItem'][locale.languageCode]; + String get noItem => localizedValues['noItem'][locale.languageCode]; String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get onlyOfftimeHoliday => + localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get active => localizedValues['active'][locale.languageCode]; + String get hold => localizedValues['hold'][locale.languageCode]; + String get loading => localizedValues['loading'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 3aac5cdd..4f496010 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -41,7 +42,7 @@ class _LoginFormState extends State { bool _isInit = true; FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); - + HospitalViewModel projectsProv; var userInfo = UserModel( userID: '', password: '', @@ -56,24 +57,13 @@ class _LoginFormState extends State { @override void initState() { super.initState(); - initPlatformState(); - } - - @override - void didChangeDependencies() { - super.didChangeDependencies(); - authProv = Provider.of(context); - - if (_isInit) { - if (projectsList.length == 0) { - getProjectsList(); - } - } - _isInit = false; } @override Widget build(BuildContext context) { + authProv = Provider.of(context); + projectsProv = Provider.of(context); + getProjects(); return Form( key: loginFormKey, child: Container( @@ -128,25 +118,33 @@ class _LoginFormState extends State { }, ), buildSizedBox(), - TextFormField( - focusNode: focusProject, - controller: projectIdController, - onTap: () { - helpers.showCupertinoPicker( - context, projectsList, 'Name', onSelectProject); - }, - showCursor: false, - readOnly: true, - decoration: buildInputDecoration( - context, - TranslationBase.of(context).selectYourProject, - 'assets/images/password_icon.png'), - validator: (value) { - if (value.isEmpty) { - return TranslationBase.of(context).pleaseEnterYourProject; - } - return null; - }), + projectsList.length > 0 + ? TextFormField( + focusNode: focusProject, + controller: projectIdController, + onTap: () { + helpers.showCupertinoPicker( + context, projectsList, 'Name', onSelectProject); + }, + showCursor: false, + readOnly: true, + decoration: buildInputDecoration( + context, + TranslationBase.of(context).selectYourProject, + 'assets/images/password_icon.png'), + validator: (value) { + if (value.isEmpty) { + return TranslationBase.of(context) + .pleaseEnterYourProject; + } + return null; + }) + : TextFormField( + readOnly: true, + decoration: buildInputDecoration( + context, + TranslationBase.of(context).loading, + 'assets/images/password_icon.png')), buildSizedBox(), Row( mainAxisAlignment: MainAxisAlignment.end, @@ -325,8 +323,9 @@ class _LoginFormState extends State { } getProjectsList() { - HospitalViewModel projectsProv = Provider.of(context); + //showLoading(); projectsProv.getProjectsList().then((res) { + //hideLoading(); if (res['MessageStatus'] == 1) { setState(() { projectsList = res['ListProject']; @@ -371,4 +370,13 @@ class _LoginFormState extends State { hideLoading() { Navigator.pop(context); } + + getProjects() { + if (_isInit) { + if (projectsList.length == 0) { + getProjectsList(); + } + } + _isInit = false; + } } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 2bf39881..b5111704 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -118,199 +118,188 @@ class _VerificationMethodsState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - height: SizeConfig.realScreenHeight * 0.6, - child: Column( - children: [ - user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .welcomeBack + - ' ' + - user.doctorName, - fontSize: - SizeConfig.textMultiplier * 3.5, - ), - SizedBox( - height: 20, - ), - AppText( - TranslationBase.of(context) - .accountInfo, - fontSize: - SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 20, - ), - Card( - color: Colors.grey[300], - child: Row( - children: [ - Flexible( - child: ListTile( - title: Text( + // height: SizeConfig.realScreenHeight * 0.6, + child: Column( + children: [ + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .welcomeBack + + ' ' + + user.doctorName, + fontSize: + SizeConfig.textMultiplier * 3.5, + ), + SizedBox( + height: 20, + ), + AppText( + TranslationBase.of(context).accountInfo, + fontSize: + SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 20, + ), + Card( + color: Colors.grey[300], + child: Row( + children: [ + Flexible( + child: ListTile( + title: Text( + TranslationBase.of(context) + .lastLoginAt, + textAlign: TextAlign.center, + overflow: + TextOverflow.ellipsis, + ), + subtitle: Text( + user.editedOn != null + ? formatDate(Helpers + .convertStringToDate( + user.editedOn)) + : user.createdOn != null + ? formatDate(Helpers + .convertStringToDate(user + .createdOn)) + : '--', + overflow: + TextOverflow.ellipsis, + textAlign: + TextAlign.center), + )), + Flexible( + child: ListTile( + title: Text( TranslationBase.of(context) - .lastLoginAt, - textAlign: TextAlign.center, + .lastLoginWith, overflow: TextOverflow.ellipsis, - ), - subtitle: Text( - user.editedOn != null - ? formatDate(Helpers - .convertStringToDate( - user - .editedOn)) - : user.createdOn != - null - ? formatDate(Helpers - .convertStringToDate(user - .createdOn)) - : '--', - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - )), - Flexible( - child: ListTile( - title: Text( - TranslationBase.of( - context) - .lastLoginWith, - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - subtitle: Text( - getType(user.logInTypeID, - context), - overflow: - TextOverflow.ellipsis, - textAlign: - TextAlign.center), - )) - ], - )), - ], - ) - : Column( - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - this.onlySMSBox == false - ? AppText( - TranslationBase.of(context) - .verifyLoginWith, - fontSize: SizeConfig - .textMultiplier * - 3.5, - textAlign: TextAlign.left, - ) - : AppText( - TranslationBase.of(context) - .verifyFingerprint2, - fontSize: SizeConfig - .textMultiplier * - 2.5, - textAlign: TextAlign.start, - ), - ]), - user != null && isMoreOption == false - ? Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: InkWell( - onTap: () => { - authenticateUser( - 3, - BiometricType - .face - .index, - authProv) - }, - child: getButton( - user.logInTypeID, - authProv))), - Expanded( - child: - getButton(5, authProv)) - ]) - ]) - : Column( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - onlySMSBox == false - ? Row( - mainAxisAlignment: - MainAxisAlignment.center, - children: [ - Expanded( - child: getButton( - 3, authProv)), - Expanded( - child: getButton( - 4, authProv)) - ], - ) - : SizedBox(), - Row( + textAlign: + TextAlign.center), + subtitle: Text( + getType(user.logInTypeID, + context), + overflow: + TextOverflow.ellipsis, + textAlign: + TextAlign.center), + )) + ], + )), + ], + ) + : Column( + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + this.onlySMSBox == false + ? AppText( + TranslationBase.of(context) + .verifyLoginWith, + fontSize: + SizeConfig.textMultiplier * + 3.5, + textAlign: TextAlign.left, + ) + : AppText( + TranslationBase.of(context) + .verifyFingerprint2, + fontSize: + SizeConfig.textMultiplier * + 2.5, + textAlign: TextAlign.start, + ), + ]), + user != null && isMoreOption == false + ? Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( - child: - getButton(1, authProv)), + child: InkWell( + onTap: () => { + authenticateUser( + 3, + BiometricType + .face.index, + authProv) + }, + child: getButton( + user.logInTypeID, + authProv))), Expanded( - child: getButton(2, authProv)) - ], - ), - ]), - Expanded( - flex: 1, - child: Column( - mainAxisAlignment: MainAxisAlignment.end, + child: getButton(5, authProv)) + ]) + ]) + : Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + onlySMSBox == false + ? Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: getButton( + 3, authProv)), + Expanded( + child: getButton( + 4, authProv)) + ], + ) + : SizedBox(), + Row( + mainAxisAlignment: + MainAxisAlignment.center, + children: [ + Expanded( + child: getButton(1, authProv)), + Expanded( + child: getButton(2, authProv)) + ], + ), + ]), + + // ) + ], + ), + ), + Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + user != null + ? Row( children: [ - user != null - ? Row( - children: [ - Expanded( - child: Button( - title: - TranslationBase.of(context) - .useAnotherAccount, - onTap: () { - Navigator.of(context) - .pushNamed(LOGIN); - }, - )), - ], - ) - : SizedBox(), + Expanded( + child: Button( + title: TranslationBase.of(context) + .useAnotherAccount, + onTap: () { + Navigator.of(context).pushNamed(LOGIN); + }, + )), ], - ), - ) - ], - )) + ) + : SizedBox(), + ], + ), ], ), )); diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 4e4c6b8c..34ec97db 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -24,13 +24,15 @@ class MyScheduleWidget extends StatelessWidget { Column( children: [ Divider( - height: 10, + height: 1, color: Colors.grey, thickness: 1.0, ), - Text('${workingHoursTable.date.day}') ], ), + SizedBox( + height: 10, + ), Row( children: [ AppText( @@ -50,44 +52,19 @@ class MyScheduleWidget extends StatelessWidget { return Container( child: Column( children: [ - Row( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - work.from + ' - ', - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, - ), - AppText( - work.to, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), - ], - ), - ], + SizedBox( + height: 5, + ), + AppText( + work.from + ' - ' + work.to, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, ) ], ), ); }).toList(), ), - SizedBox( - width: 8, - ) ], ), ), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b243f15a..27b38ee2 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -98,7 +98,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -144,7 +146,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).list, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && selectedPatientType != 5) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 808e09dc..8a9ae52b 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -26,6 +27,7 @@ class AppDrawer extends StatefulWidget { class _AppDrawerState extends State { bool _isInit = true; Helpers helpers = new Helpers(); + ProjectViewModel projectsProvider; // @override // void didChangeDependencies() { // super.didChangeDependencies(); @@ -38,6 +40,7 @@ class _AppDrawerState extends State { @override Widget build(BuildContext context) { AuthViewModel authProvider = Provider.of(context); + projectsProvider = Provider.of(context); return RoundedContainer( child: Container( color: Colors.white, @@ -84,7 +87,13 @@ class _AppDrawerState extends State { )) : SizedBox(), AppText( - "Director of medical records", //TODO: Make The Dr Title Dynamic and check overflow issue. + projectsProvider.isArabic + ? authProvider + .doctorProfile.titleDescriptionN ?? + "" + : authProvider + .doctorProfile?.titleDescription ?? + "", fontWeight: FontWeight.normal, color: Colors.black87), RaisedButton( From cbf850da2faaf5d8c35fa64d6f6b5f069220d9c7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 11:10:09 +0200 Subject: [PATCH 208/421] fix DA-201 --- .../medicine/medicine_search_screen.dart | 87 ++++--------------- .../medicine/pharmacies_list_screen.dart | 39 ++++++--- 2 files changed, 41 insertions(+), 85 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 5e26e65b..e0102e77 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -117,7 +117,7 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if(model.allMedicationList.isNotEmpty) + if(model.allMedicationList.length == 0) await model.getMedicationList(); }, builder: (_, model, w) => @@ -214,6 +214,8 @@ class _MedicineSearchState extends State { .startsWith(input.toLowerCase()), ) : TextField( + minLines: 2, + maxLines: 2, decoration: textFieldSelectorDecoration( TranslationBase .of(context) @@ -245,72 +247,6 @@ class _MedicineSearchState extends State { ], ), ), - Column( - children: [ - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase - .of(context) - .youCanFind + - model.pharmacyItemsList.length - .toString() + - " " + - TranslationBase - .of(context) - .itemsInSearch, - fontWeight: FontWeight.bold, - ), - ], - ), - ), - Container( - height: MediaQuery - .of(context) - .size - .height * 0.35, - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: model.pharmacyItemsList == null - ? 0 - : model.pharmacyItemsList.length, - itemBuilder: (BuildContext context, - int index) { - return InkWell( - child: MedicineItemWidget( - label: model.pharmacyItemsList[index] - ["ItemDescription"], - url: model.pharmacyItemsList[index] - ["ImageSRCUrl"], - ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID: - model.pharmacyItemsList[ - index]["ItemID"], - url: model - .pharmacyItemsList[ - index]["ImageSRCUrl"]), - ), - ); - }, - ); - }, - ), - ), - ), - ], - ), ], ), ), @@ -337,10 +273,19 @@ class _MedicineSearchState extends State { return; } - GifLoaderDialogUtils.showMyDialog(context); - - await model.getMedicineItem(_selectedMedication.description); - GifLoaderDialogUtils.hideDialog(context); + // GifLoaderDialogUtils.showMyDialog(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmaciesListScreen( + itemID:_selectedMedication.itemId, + selectedMedication: _selectedMedication, + ), + ), + ); + // await model.getMedicineItem(_selectedMedication.description); + // GifLoaderDialogUtils.hideDialog(context); } diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 2433487f..d39de338 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -2,6 +2,7 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -22,9 +23,11 @@ class PharmaciesListScreen extends StatefulWidget { final int itemID; final String url; + final GetMedicationResponseModel selectedMedication; // In the constructor, require a item id. - PharmaciesListScreen({Key key, @required this.itemID, this.url}) + PharmaciesListScreen( + {Key key, @required this.itemID, this.url, this.selectedMedication}) : super(key: key); @override @@ -49,17 +52,24 @@ class _PharmaciesListState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => model.getPharmaciesList(widget.itemID), - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).pharmaciesList, - body: Container( - height: SizeConfig.screenHeight, - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ + onModelReady: (model) async { + await model.getPharmaciesList(widget.selectedMedication.itemId); + await model.getMedicineItem(widget.selectedMedication.description); + + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase + .of(context) + .pharmaciesList, + body: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ model.pharmaciesList.length > 0 ? RoundedContainer( child: Row( @@ -69,9 +79,10 @@ class _PharmaciesListState extends State { child: ClipRRect( borderRadius: BorderRadius.all(Radius.circular(7)), - child: widget.url != null + child: model.pharmacyItemsList[0] + ["ImageSRCUrl"]!= null ? Image.network( - widget.url, + model.pharmacyItemsList[0]["ImageSRCUrl"], height: SizeConfig.imageSizeMultiplier * 21, From 8c9ffc2e62b058fa09261192de3a29e9bf42018d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 14:31:00 +0200 Subject: [PATCH 209/421] fix multiple issue --- lib/core/viewModel/SOAP_view_model.dart | 13 +++++++++---- .../get_patient_arrival_list_request_model.dart | 17 +++++++++++------ lib/screens/patients/patients_screen.dart | 2 +- .../profile/patient-page-header-widget.dart | 2 +- .../subjective/update_subjective_page.dart | 8 ++++++++ .../profile/soap_update/update_soap_index.dart | 1 + 6 files changed, 31 insertions(+), 12 deletions(-) diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 2c312ade..076f379c 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -237,13 +237,18 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } - - Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP) async { - - setState(ViewState.Busy); + Future getPatientAllergy(GeneralGetReqForSOAP generalGetReqForSOAP, + {isLocalBusy = false}) async { + if (isLocalBusy) { + setState(ViewState.BusyLocal); + } else + setState(ViewState.Busy); await _SOAPService.getPatientAllergy(generalGetReqForSOAP); if (_SOAPService.hasError) { error = _SOAPService.error; + if (isLocalBusy) { + setState(ViewState.ErrorLocal); + } else setState(ViewState.Error); } else setState(ViewState.Idle); diff --git a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart index 66890a8f..1d0da9c5 100644 --- a/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart +++ b/lib/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart @@ -6,15 +6,17 @@ class GetPatientArrivalListRequestModel { int pageIndex; int pageSize; int clinicID; + int patientMRN; GetPatientArrivalListRequestModel( {this.vidaAuthTokenID, - this.from, - this.to, - this.doctorID, - this.pageIndex, - this.pageSize, - this.clinicID}); + this.from, + this.to, + this.doctorID, + this.pageIndex, + this.pageSize, + this.clinicID, + this.patientMRN}); GetPatientArrivalListRequestModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; @@ -24,6 +26,7 @@ class GetPatientArrivalListRequestModel { pageIndex = json['PageIndex']; pageSize = json['PageSize']; clinicID = json['ClinicID']; + patientMRN = json['PatientMRN']; } Map toJson() { @@ -35,6 +38,8 @@ class GetPatientArrivalListRequestModel { data['PageSize'] = this.pageSize; data['ClinicID'] = this.clinicID; data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + return data; } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 57abe393..14f68a79 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -262,7 +262,7 @@ class _PatientsScreenState extends State { GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; if (val2 == 7) { getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0); + from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID); } model diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index abd2f5ad..6457b8cb 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -91,7 +91,7 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - model.patientAllergiesList.isNotEmpty ?AppText( + model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?AppText( TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), color: Color(0xFFB9382C), fontWeight: FontWeight.bold, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index a6167c43..ea81282e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -544,6 +544,14 @@ class _UpdateSubjectivePageState extends State { await model.patchAllergy(postAllergyRequestModel); } + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: widget.patientInfo.patientMRN, + episodeId: widget.patientInfo.episodeNo, + appointmentNo: widget.patientInfo.appointmentNo, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP, isLocalBusy : true); + if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 7b68b4f3..61e5a4b4 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -37,6 +37,7 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex) { + changeLoadingState(true); _controller.jumpToPage(pageIndex); } From 00543a759a4c1632fba91de0fac7a91347ef3caa Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 24 Jan 2021 15:30:42 +0200 Subject: [PATCH 210/421] fix remarks in allergies --- assets/fonts/DoctorApp.ttf | Bin 15928 -> 16960 bytes lib/core/service/SOAP_service.dart | 2 + lib/core/viewModel/patient_view_model.dart | 14 +-- lib/icons_app/config.json | 14 +++ lib/icons_app/doctor_app_icons.dart | 94 ++++++------------ lib/models/SOAP/GetAllergiesResModel.dart | 5 +- lib/screens/dashboard_screen.dart | 2 +- .../medicine/medicine_search_screen.dart | 2 +- .../medicine/pharmacies_list_screen.dart | 2 +- .../subjective/update_subjective_page.dart | 1 + 10 files changed, 62 insertions(+), 74 deletions(-) diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 22539da0652f12c82f86a0652f0c69f2a8f697c8..7c3f1bf1f7a4bec949e74b3cd8319ed91b753cb5 100644 GIT binary patch delta 1408 zcmYjQOKcle6n%H>nTdZB+w)6okK?gpkMpzR-%L_}s~|*5irhj{1SP?3(}b!{+%}>q z6nR0UR?tPkEMNgbf>kSoP*_wbi>iE7LE-%&& zDYw?IA@??#zKnqFBK<3#x6lTc>uc*TZFTVuenEfj=<31RM>jt^jQY3HFVt)64R{hB z;C&zZp_N*FaqEVU$b=NnVnSzQ^~Bm=7u;P!DsLg_;u~9$vO)m4Xy?9G-dpG`+$9c6 z8xitT#)qVT_wL>9b4<;00Nox!nJ5lZr?i4_4Dzk>P=@K&_ps5VuXiy%q0ua8qiFcT z@YO>)A(s&~g`>FJAL3SGrtuOtB2>G#-PiWD2ioCww5_+N%~);H<`D}bHuxWgivJHl z{W#fy4_hDwQX-|+w^Wf1U;^d?j|IF)cA5fM-UO(F=&tY{J>xdcH_z>p=5(l}soigJ)r zK+WNG8FDd=i7*j0Z1VLeu9!uN<}e4-3t9qQ1q4|)az-wzXVkQ$fGkR~UItptskB*6 zvI#7MrLhUnVwzY2Hm8Zgc2HInWJ#9tkd_2y1dGAzw4RNPfGA@zK`_!f7D1~CDhZM) z3&*ffEgZ{b4VI@b<(NjEUKAqr9niohg6&qFQ}*32-ObTcYo0`wU%sVP!8w33h!c`^HAaVgn1w|@K) zeg9FBbBg!wKk$gG&B+_j*OSTmg5iGDVGWGPbW(Lbo;y=MG$>yQ*nam(iywv$l z2n1jPq<})%QhVn$yF;7bn{s-D3eN%M;wuh2WfeOsKy^Csg-diX!@~?G4Z1v3k4^IL z33<6rhvP#QyWPdD3W_2uj5L-@cUYT^b)V|-du=N3j{*JQjwNc%%x1$d8JC;Gy}cuH zd=kRh*$h}{i1~Td=JogV1%?8t@w2>CE=#anV0)`@*WxZg3;sJPvg#*Cvs%nyNG5kf-1OWRiI z$XMi7JXsyJ`dHRy9jzwgLz=_l8z17lylZIOM_E~R&{woWyPyE?p=Ec*ji-PhIvfY=Av;rXv$l$j{m{SDk8@}1 z&B;F@)!Nwc4Wu@!`C|Y|>q=pQg5c)8LIDK#iN)ISgUbtz+S&_?D{EsZ{H6Z^e1aS= delta 451 zcmYL^ze_?<6vxl;`6MeSh#Z6Dj?Rsg;G1!?hTZdQKF$OD44W_Pr9`^aur$0M29e8E+HnP3qZP_QiU_yeczN z={fD>b|16VRpen^%NabzpQyJX?_ARKgn8qlR-&ODENnE=%h|~X{gfzj0MqWa*%NgW z!wVffPHxULMc%1Fksx%}GO+P?TkqDCLsMpv*Af0xJJmk7@Nk9)MUkT%6jxlx1FDb$ zc_BMyo3#~0XQ0(4FYfvpw^MaRGXj3uB-^A*cF1noCxey+Lb3(K1Je6L;Ql|1J|Be; zVMGK4Ch=ekVT(g_DPN+(s_3vgoT=ZQ_Oj1D&7!1+@Q3oXdLIz$!>{ZYxsglumq()+ PX16$th01TS2*dLYRUvQb diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index abb832c7..d0cebe77 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -217,7 +217,9 @@ class SOAPService extends LookupService { await baseAppClient.post (GET_ALLERGY, onSuccess: (dynamic response, int statusCode) { + print("Success"); patientAllergiesList.clear(); + response['List_Allergies']['entityList'].forEach((v) { patientAllergiesList.add(GetAllergiesResModel.fromJson(v)); }); diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 2fcdc779..d12ac7f5 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/service/patient_service.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart'; -import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; @@ -56,16 +55,13 @@ class PatientViewModel extends BaseViewModel { } else { setState(ViewState.Busy); } - return _patientService.getPatientList(patient, patientType); + if (_patientService.hasError) { error = _patientService.error; - if (isBusyLocal) { - setState(ViewState.ErrorLocal); - } else { - setState(ViewState.Error); - } - } else - setState(ViewState.Idle); + setState(ViewState.Error); + } + return _patientService.getPatientList(patient, patientType); + } Future getPatientVitalSign(patient) async { diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index ede09595..15dda748 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -412,6 +412,20 @@ "leaves" ] }, + { + "uid": "4477771717c5280f9030b8e410040eda", + "css": "search_patient-1", + "code": 59465, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1142.7 436.8A165.2 165.2 0 1 0 1307.8 601.9 165.4 165.4 0 0 0 1142.7 436.8ZM1142.7 748.8A146.9 146.9 0 1 1 1289.5 601.9 147 147 0 0 1 1142.7 748.8ZM1023.4 611.1H1041.7A110.3 110.3 0 0 1 1151.8 500.9V482.7A128.5 128.5 0 0 0 1023.4 611.1ZM1476.4 883.8L1489.3 870.9 1357.9 739.4 1345 752.4 1322 729.4A219.8 219.8 0 1 0 1270.1 781.5L1293.1 804.5 1280.2 817.4 1411.4 948.7 1424.4 935.7 1306 817.3 1357.9 765.4ZM1142.6 803.9A201.9 201.9 0 1 1 1344.4 602 202.2 202.2 0 0 1 1142.6 803.9ZM1306 791.3L1284.7 770.1A220.1 220.1 0 0 0 1310.7 744.1L1332.1 765.5ZM48.4 483.9H301.4A96.4 96.4 0 0 1 276.7 346.5 305.1 305.1 0 0 1 257.9 242V201.9A201.8 201.8 0 0 1 564.5 29.2 201.8 201.8 0 0 1 871 201.8V205.4L887 177.2 957.1 299.9A80.6 80.6 0 0 1 869.7 417.5 96.9 96.9 0 0 1 785.1 499.2 226.4 226.4 0 0 1 645.1 662.2V696.2L780.4 720.8A267.4 267.4 0 0 1 999.9 983.9V999.9H129V983.9A267.4 267.4 0 0 1 348.6 720.8L483.9 696.2V662.3A224.6 224.6 0 0 1 396.8 602.3C396 602.6 395.1 602.8 394.3 603.1A92.8 92.8 0 0 1 352.9 612.9H48.4A48.4 48.4 0 0 1 0 564.5V532.3A48.4 48.4 0 0 1 48.4 483.9ZM339.5 465.8C339.3 461.1 338.7 456.4 338.7 451.7V341A64.2 64.2 0 0 0 339.5 465.7ZM838.7 242V201.9A169.6 169.6 0 0 0 575.1 60.8L564.5 67.8 554 60.8A169.6 169.6 0 0 0 290.3 201.9V242A273.2 273.2 0 0 0 302.3 322.2 96.2 96.2 0 0 1 338.7 308.1V282.4L403.2 234V193.5A32.3 32.3 0 0 1 435.5 161.3H693.5A32.3 32.3 0 0 1 725.8 193.5V233.9L790.3 282.3V307.8A95.4 95.4 0 0 1 810.8 313.9 78.8 78.8 0 0 1 817 299.9L837.7 263.6C838.3 256.4 838.7 249.2 838.7 242ZM435.5 290.4H693.6V193.5H435.5ZM887.9 387.2A47.6 47.6 0 0 0 929.3 316L887.1 242.2 844.9 315.9A47.6 47.6 0 0 0 887.6 387.1ZM838.8 403.2A79.4 79.4 0 0 1 807.4 348.1 63.2 63.2 0 0 0 790.4 340.9V451.6C790.4 456.4 790 461 789.7 465.7A64.5 64.5 0 0 0 838.7 403.2ZM758.1 451.6V298.4L725.9 274.3V290.4A32.3 32.3 0 0 1 693.6 322.6H435.5A32.3 32.3 0 0 1 403.2 290.4V274.3L370.9 298.4V451.6A195.2 195.2 0 0 0 374.4 486.4 92.8 92.8 0 0 1 394.3 493.6 60.6 60.6 0 0 0 421.2 500H532.2A48.4 48.4 0 1 1 532.2 596.7H436.9A193.2 193.2 0 0 0 758.1 451.6ZM532.3 564.5A16 16 0 1 0 532.3 532.2H516.3V564.5ZM637.4 727.6A80.7 80.7 0 0 1 583.6 771.6 64.5 64.5 0 0 0 645.1 806.4C680.7 806.4 709.6 784.7 709.6 758A36.4 36.4 0 0 0 704.4 739.7ZM161.8 967.8H967.2A235 235 0 0 0 774.7 752.6L740.8 746.5A64.8 64.8 0 0 1 742 758.2C742 802.6 698.6 838.8 645.2 838.8A102.9 102.9 0 0 1 564.6 802.6 102.9 102.9 0 0 1 483.9 838.7C430.4 838.7 387.1 802.5 387.1 758.1A65.9 65.9 0 0 1 388.2 746.4L354.4 752.6A235 235 0 0 0 161.8 967.8ZM424.5 739.9A36.4 36.4 0 0 0 419.4 758.2C419.4 784.9 448.3 806.6 483.9 806.6A64.5 64.5 0 0 0 545.4 771.8 80.6 80.6 0 0 1 491.6 727.7ZM516 677.4V693.4A48.4 48.4 0 1 0 612.8 693.4V672.1A222.6 222.6 0 0 1 516 672.1ZM379.6 574.3A92.9 92.9 0 0 1 421 564.5H483.9V532.3H421.2A93.1 93.1 0 0 1 379.9 522.5 60.6 60.6 0 0 0 352.9 516H129V580.5H352.9A60.6 60.6 0 0 0 379.9 574.3ZM32.1 564.5A16 16 0 0 0 48.1 580.5H96.8V516H48.4A16 16 0 0 0 32.4 532ZM524.9 368.4L507 341.5 410.3 406.1 428.2 432.9ZM718.5 405.8L621.8 341.3 603.9 368.1 700.6 432.7Z", + "width": 1489 + }, + "search": [ + "search_patient" + ] + }, { "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 ef01c934..7c05c223 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -1,5 +1,5 @@ /// Flutter icons DoctorApp -/// Copyright (C) 2020 by original authors @ fluttericon.com, fontello.com +/// Copyright (C) 2021 by original authors @ fluttericon.com, fontello.com /// This font was generated by FlutterIcon.com, which is derived from Fontello. /// /// To use this font, place it in your fonts/ directory and include the @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -19,64 +19,36 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const String _kFontPkg = null; + static const _kFontPkg = null; - static const IconData female_icon = - IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = - IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = - IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = - IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = - IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = - IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = - IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = - IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = - IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = - IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = - IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = - IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = - IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = - IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = - IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = - IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = - IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = - IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = - IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = - IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = - IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = - IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = - IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = - IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = - IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = - IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = - IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = - IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData leaves = - IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/models/SOAP/GetAllergiesResModel.dart b/lib/models/SOAP/GetAllergiesResModel.dart index a403bd2e..1eeca63e 100644 --- a/lib/models/SOAP/GetAllergiesResModel.dart +++ b/lib/models/SOAP/GetAllergiesResModel.dart @@ -11,6 +11,7 @@ class GetAllergiesResModel { bool isUpdatedByNurse; int severity; String severityName; + String remarks; GetAllergiesResModel( {this.allergyDiseaseId, @@ -24,7 +25,7 @@ class GetAllergiesResModel { this.isChecked, this.isUpdatedByNurse, this.severity, - this.severityName}); + this.severityName, this.remarks=''}); GetAllergiesResModel.fromJson(Map json) { allergyDiseaseId = json['allergyDiseaseId']; @@ -39,6 +40,7 @@ class GetAllergiesResModel { isUpdatedByNurse = json['isUpdatedByNurse']; severity = json['severity']; severityName = json['severityName']; + remarks = json['remarks']; } Map toJson() { @@ -55,6 +57,7 @@ class GetAllergiesResModel { data['isUpdatedByNurse'] = this.isUpdatedByNurse; data['severity'] = this.severity; data['severityName'] = this.severityName; + data['remarks'] = this.remarks; return data; } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 76f4e16e..85dd440d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -804,7 +804,7 @@ class _DashboardScreenState extends State { children: [ Center( child: Icon( - DoctorApp.search_patient, + DoctorApp.search_patient_1, size: 50, color: Colors.black, ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index e0102e77..f08f52cb 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -222,7 +222,7 @@ class _MedicineSearchState extends State { .searchMedicineNameHere, _selectedMedication != null ? _selectedMedication.description + - ('${_selectedMedication.genericName}') + (' (${_selectedMedication.genericName} )') : null, true, icon: EvaIcons.search), diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index d39de338..61bd7ad4 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -70,7 +70,7 @@ class _PharmaciesListState extends State { scrollDirection: Axis.vertical, physics: const AlwaysScrollableScrollPhysics(), children: [ - model.pharmaciesList.length > 0 + model.pharmaciesList.length > 0 && model.pharmacyItemsList.length > 0 ? RoundedContainer( child: Row( children: [ diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index ea81282e..f4ad30ab 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -181,6 +181,7 @@ class _UpdateSubjectivePageState extends State { selectedAllergy: selectedAllergy, isChecked: element.isChecked, createdBy: element.createdBy, + remark: element.remarks, selectedAllergySeverity: selectedAllergySeverity); if (selectedAllergy != null && selectedAllergySeverity != null) widget.myAllergiesList.add(mySelectedAllergy); From 7c800bdab4ae636450627ad12264cf31cc45b0a8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 24 Jan 2021 16:08:43 +0200 Subject: [PATCH 211/421] medical file fix --- lib/core/viewModel/procedure_View_model.dart | 1 + lib/screens/medical-file/medical_file_details.dart | 3 ++- lib/screens/prescription/add_prescription_form.dart | 8 ++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index fb84f505..5c253025 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -61,6 +61,7 @@ class ProcedureViewModel extends BaseViewModel { if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); + await getProcedure(mrn: mrn); } else { await getProcedure(mrn: mrn); setState(ViewState.Idle); diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 7ad1d47e..f7525391 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -638,7 +638,8 @@ class _MedicalFileDetailsState extends State { .medicalFileList[ 0] .entityList[0] - .timelines[0] + .timelines[ + encounterNumber] .timeLineEvents[0] .consulations[0] .lstProcedure[ diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5c1bd3b4..b5c248b9 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -350,13 +351,12 @@ class _PrescriptionFormWidgetState extends State { // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; - return BaseView( + return BaseView( onModelReady: (model) async { await model.getMedicationList(); }, - builder: - (BuildContext context, PrescriptionViewModel model, Widget child) => - NetworkBaseView( + builder: (BuildContext context, MedicineViewModel model, Widget child) => + NetworkBaseView( baseViewModel: model, child: DraggableScrollableSheet( initialChildSize: 0.90, From 63e8ee8dd08f6bb06f8ff6433bbcc6918d5393fb Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 25 Jan 2021 10:02:30 +0300 Subject: [PATCH 212/421] sick leave --- lib/config/config.dart | 4 +- lib/core/service/sickleave_service.dart | 14 +++---- lib/core/viewModel/hospital_view_model.dart | 5 ++- lib/core/viewModel/sick_leave_view_model.dart | 1 + .../reschedule-leaves/reschedule_leave.dart | 26 +++++++------ lib/screens/sick-leave/sick_leave.dart | 39 +++++++++++++++---- lib/widgets/auth/login_form.dart | 31 +++++++++------ 7 files changed, 78 insertions(+), 42 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 9fd3f14a..1205d14c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -26,7 +26,9 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; -const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; +//const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; +const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; + const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign'; const GET_PATIENT_VITAL_SIGN_DATA = diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 15d77d5c..8eebd23c 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -24,6 +24,8 @@ class SickLeaveService extends BaseService { dynamic get postReschedule => _postReschedule; dynamic _postReschedule; + dynamic get sickLeaveResponse => _sickLeaveResponse; + dynamic _sickLeaveResponse; Future getStatistics(appoNo, patientMRN) async { hasError = false; await baseAppClient.post( @@ -48,10 +50,8 @@ class SickLeaveService extends BaseService { await baseAppClient.post( ADD_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); - //print(response); - // _statistics = {}; - // _statistics = response['SickLeaveStatistics']; + _sickLeaveResponse = response; + return Future.value(response); }, onFailure: (String error, int statusCode) { hasError = true; @@ -72,10 +72,8 @@ class SickLeaveService extends BaseService { await baseAppClient.post( EXTEND_SICK_LEAVE, onSuccess: (dynamic response, int statusCode) { - Future.value(response); - print(response); - // _statistics = {}; - // _statistics = response['SickLeaveStatistics']; + _sickLeaveResponse = response; + return Future.value(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/hospital_view_model.dart b/lib/core/viewModel/hospital_view_model.dart index 56f03686..7865a40f 100644 --- a/lib/core/viewModel/hospital_view_model.dart +++ b/lib/core/viewModel/hospital_view_model.dart @@ -6,7 +6,7 @@ import 'package:flutter/cupertino.dart'; class HospitalViewModel with ChangeNotifier { BaseAppClient baseAppClient = BaseAppClient(); - Future getProjectsList() async { + Future getProjectsList(memberID) async { const url = GET_PROJECTS; // TODO create model or remove it if no info need var info = { @@ -17,7 +17,8 @@ class HospitalViewModel with ChangeNotifier { "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", - "IsLoginForDoctorApp": true + "IsLoginForDoctorApp": true, + "MemberID": memberID }; dynamic localRes; diff --git a/lib/core/viewModel/sick_leave_view_model.dart b/lib/core/viewModel/sick_leave_view_model.dart index 8e1c68d9..80f9ea1d 100644 --- a/lib/core/viewModel/sick_leave_view_model.dart +++ b/lib/core/viewModel/sick_leave_view_model.dart @@ -17,6 +17,7 @@ class SickLeaveViewModel extends BaseViewModel { List get coveringDoctors => _sickLeaveService.coveringDoctorsList; get getReschduleLeave => _sickLeaveService.getAllRescheduleLeave; get postSechedule => _sickLeaveService.postReschedule; + get sickleaveResponse => _sickLeaveService.sickLeaveResponse; Future addSickLeave(AddSickLeaveRequest addSickLeaveRequest) async { setState(ViewState.Busy); await _sickLeaveService.addSickLeave(addSickLeaveRequest); diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index f0bf122f..822a2181 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -52,8 +52,8 @@ class _RescheduleLeaveScreen extends State { var fromDate; var toDate; var clinicID; - var fromTime; - var toTime; + String fromTime; + String toTime; TextEditingController _controller4 = new TextEditingController(); TextEditingController _controller5 = new TextEditingController(); void _presentDatePicker(id) { @@ -764,7 +764,9 @@ class _RescheduleLeaveScreen extends State { //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); this.fromTime = df.format(DateTime.parse(widget.updateData.dateTimeFrom)); + this.fromTime = this.fromTime.substring(0, this.fromTime.length - 3); this.toTime = df.format(DateTime.parse(widget.updateData.dateTimeTo)); + this.toTime = this.toTime.substring(0, this.toTime.length - 3); _toDateController2.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeTo)); _controller5.text = toTime; @@ -820,8 +822,8 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": "", - "timeTo": "", + "timeFrom": fromTime, + "timeTo": toTime, "timeFromstr": "", "timeTostr": "" } @@ -845,17 +847,17 @@ class _RescheduleLeaveScreen extends State { } updateRecheduleLeave(model) { - final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); - final dateFormat = new DateFormat('yyyy-MM-dd'); + // final df = new DateFormat('yyyy-MM-ddTHH:MM:ss'); + final df = new DateFormat('yyyy-MM-dd'); var fromDates = fromDate; var toDates = toDate; if (offTime == '1') { - fromDate = df.format(DateTime.parse(fromDates)) + + fromDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + fromTime + ':' + DateTime.now().second.toString(); - toDate = df.format(DateTime.parse(fromDates)) + + toDate = df.format(DateTime.parse(_toDateController.text)) + 'T' + toTime + ':' + @@ -883,10 +885,10 @@ class _RescheduleLeaveScreen extends State { "weekDayId": 1, "shiftId": 1, "isOpen": true, - "timeFrom": fromTime, - "timeTo": toTime, - "timeFromstr": "", - "timeTostr": "" + "timeFrom": "", + "timeTo": "", + "timeFromstr": fromTime, + "timeTostr": toTime } ] } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index fcc641ff..b4ee3ace 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -4,7 +4,9 @@ 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/models/sickleave/add_sickleave_request.dart'; +import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/sick-leave/add-sickleave.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -116,6 +118,10 @@ class _SickLeaveScreenState extends State { borderColor: Colors.white, onChanged: (value) { addSickLeave.noOfDays = value; + if (widget.extendedData != null) { + widget.extendedData.noOfDays = + int.parse(value); + } }, hintText: widget.extendedData != null ? widget.extendedData.noOfDays @@ -163,6 +169,10 @@ class _SickLeaveScreenState extends State { inputFormatter: ONLY_DATE, onChanged: (value) { addSickLeave.startDate = value; + if (widget.extendedData != null) { + widget.extendedData.startDate = + value; + } }), ], )), @@ -323,6 +333,9 @@ class _SickLeaveScreenState extends State { .remarks), onChanged: (value) { addSickLeave.remarks = value; + if (widget.extendedData != null) { + widget.extendedData.remarks = value; + } }, ) ], @@ -338,14 +351,26 @@ class _SickLeaveScreenState extends State { title: widget.isExtended == true ? TranslationBase.of(context).extend : TranslationBase.of(context).add, - onPressed: () { + onPressed: () async { if (widget.isExtended) { - model2 - .extendSickLeave( - widget.extendedData) - .then((value) => (value) { - print(value); - }); + await model2.extendSickLeave( + widget.extendedData); + + DrAppToastMsg.showSuccesToast( + model2.sickleaveResponse[ + 'ListSickLeavesToExtent'] + ['success']); + Navigator.of(context).popUntil((route) { + return route.settings.name == + PATIENTS_PROFILE; + }); + Navigator.of(context).pushNamed( + ADD_SICKLEAVE, + arguments: { + 'patient': widget.patient + }); + //print(value); + //}); } else { _validateInputs(model2); } diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 4f496010..e78e0217 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -63,7 +63,7 @@ class _LoginFormState extends State { Widget build(BuildContext context) { authProv = Provider.of(context); projectsProv = Provider.of(context); - getProjects(); + return Form( key: loginFormKey, child: Container( @@ -88,9 +88,13 @@ class _LoginFormState extends State { onSaved: (value) { userInfo.userID = value.trim(); }, + onChanged: (value) { + userInfo.userID = value.trim(); + }, onFieldSubmitted: (_) { focusPass.nextFocus(); }, + onEditingComplete: () {}, autofocus: false, ), buildSizedBox(), @@ -114,7 +118,10 @@ class _LoginFormState extends State { onFieldSubmitted: (_) { focusPass.nextFocus(); helpers.showCupertinoPicker( - context, projectsList, 'Name', onSelectProject); + context, projectsList, 'facilityName', onSelectProject); + }, + onTap: () { + this.getProjects(userInfo.userID); }, ), buildSizedBox(), @@ -123,8 +130,8 @@ class _LoginFormState extends State { focusNode: focusProject, controller: projectIdController, onTap: () { - helpers.showCupertinoPicker( - context, projectsList, 'Name', onSelectProject); + helpers.showCupertinoPicker(context, projectsList, + 'facilityName', onSelectProject); }, showCursor: false, readOnly: true, @@ -322,13 +329,13 @@ class _LoginFormState extends State { }); } - getProjectsList() { + getProjectsList(memberID) { //showLoading(); - projectsProv.getProjectsList().then((res) { + projectsProv.getProjectsList(memberID).then((res) { //hideLoading(); if (res['MessageStatus'] == 1) { setState(() { - projectsList = res['ListProject']; + projectsList = res['ProjectInfo']; }); } else { // handel error @@ -350,8 +357,8 @@ class _LoginFormState extends State { onSelectProject(index) { setState(() { - userInfo.projectID = projectsList[index]["ID"]; - projectIdController.text = projectsList[index]['Name']; + userInfo.projectID = projectsList[index]["facilityId"]; + projectIdController.text = projectsList[index]['facilityName']; }); primaryFocus.unfocus(); @@ -371,10 +378,10 @@ class _LoginFormState extends State { Navigator.pop(context); } - getProjects() { - if (_isInit) { + getProjects(value) { + if (value != null && value != '') { if (projectsList.length == 0) { - getProjectsList(); + getProjectsList(value); } } _isInit = false; From 9ddfbd3e6692567f1f506f0c2ccacdabb5ae3886 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 25 Jan 2021 12:25:28 +0200 Subject: [PATCH 213/421] fix issue on app drawer --- lib/config/localized_values.dart | 2 +- lib/core/service/prescription_service.dart | 4 - lib/core/viewModel/patient_view_model.dart | 6 +- .../patients/patient_search_screen.dart | 15 +- lib/screens/patients/patients_screen.dart | 7 +- lib/widgets/patients/dynamic_elements.dart | 12 +- lib/widgets/shared/app_drawer_widget.dart | 225 +++++++++--------- lib/widgets/shared/drawer_item_widget.dart | 7 +- 8 files changed, 155 insertions(+), 123 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 077bd7f5..9fc39b5c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -37,7 +37,7 @@ const Map> localizedValues = { 'lab': {'en': 'Lab', 'ar': 'المختبر'}, 'result': {'en': 'Result', 'ar': 'نتيجة'}, 'todayStatistics': {'en': 'Today Statistics', 'ar': 'إحصائيات اليوم'}, - 'arrived': {'en': 'Arrived', 'ar': 'وصل'}, + 'arrived': {'en': 'Arrival Patients', 'ar': ' المرضى الواصلين'}, 'er': {'en': 'ER', 'ar': 'حالة طوارئ'}, 'walkIn': {'en': 'Walk-in', 'ar': 'ادخل'}, 'notArrived': {'en': 'Not Arrived', 'ar': 'لم يصل'}, diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 0e52b16c..f09a8779 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -24,11 +24,7 @@ class PrescriptionService extends BaseService { PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], - // vidaAuthTokenID: - // "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDAyIiwianRpI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4MDBmNmRkMTYxIiwiZW1haWwiOiIiLCJpZCI6IjEwMDIiLCJOYW1lIjoiVEVNUCAtIERPQ1RPUiIsIkVtcGxveWVlSWQiOiI0NzA5IiwiRmFjaWxpdHlHcm91cElkIjoiMDEwMjY2IiwiRmFjaWxpdHlJZCI6IjE1IiwiUGhhcmFtY3lGYWNpbGl0eUlkIjoiNTUiLCJJU19QSEFSTUFDWV9DT05ORUNURUQiOiJUcnVlIiwiRG9jdG9ySWQiOiI0NzA5IiwiU0VTU0lPTklEIjoiMjE1OTYyMDMiLCJDbGluaWNJZCI6IjEiLCJyb2xlIjpbIkhFQUQgTlVSU0VTIiwiRE9DVE9SUyIsIkhFQUQgRE9DVE9SUyIsIkFETUlOSVNUUkFUT1JTIiwiUkVDRVBUSU9OSVNUIiwiRVIgTlVSU0UiLCJJVkYgUkVDRVBUSU9OSVNUIiwiRVIgUkVDRVBUSU9OSVNUIiwiUEhBUk1BQ1kgQUNDT1VOVCBTVEFGRiIsIlBIQVJNQUNZIE5VUlNFIiwiSU5QQVRJRU5UIFBIQVJNQUNJU1QiLCJBRE1JU1NJT04gU1RBRkYiLCJBUFBST1ZBTCBTVEFGRiIsIklWRiBET0NUT1IiLCJJVkYgTlVSU0UiLCJJVkYgQ09PUkRJTkFUT1IiLCJJVkYgTEFCIFNUQUZGIiwiQ09OU0VOVCAiLCJNRURJQ0FMIFJFUE9SVCAtIFNJQ0sgTEVBVkUgTUFOQUdFUiJdLCJuYmYiOjE2MDkyNjQ2MTQsImV4cCI6MTYxMDEyODYxNCwiaWF0IjoxNjA5MjY0NjE0fQ.xCJ0jGtSFf36G8uZpdmHVoLfXDyP6e9mBpuOPSlzuio", ); PostPrescriptionReqModel _postPrescriptionReqModel = diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index d12ac7f5..70bf0899 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,18 +49,22 @@ class PatientViewModel extends BaseViewModel { _patientService.referalFrequancyList; Future getPatientList(patient, patientType, + {bool isBusyLocal = false}) async { + var localRes ; if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } + localRes = await _patientService.getPatientList(patient, patientType); if (_patientService.hasError) { error = _patientService.error; setState(ViewState.Error); + } - return _patientService.getPatientList(patient, patientType); + return localRes; } diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 52fbb677..726e5050 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -44,6 +44,8 @@ class _PatientSearchScreenState extends State { bool _autoValidate = false; bool onlyArrived = true; + bool isFormSubmitted = false; + var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -64,7 +66,9 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { - + setState(() { + isFormSubmitted = true; + }); try { if (_formKey.currentState.validate()) { @@ -73,8 +77,11 @@ class _PatientSearchScreenState extends State { if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && _selectedType == "7") { - helpers.showErrorToast("Please Choose The Dates"); + // helpers.showErrorToast("Please Choose The Dates"); } else { + setState(() { + isFormSubmitted = false; + }); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, "selectedType": _selectedType @@ -112,7 +119,7 @@ class _PatientSearchScreenState extends State { children: [ Container( child: Icon( - DoctorApp.search_patient, + DoctorApp.search_patient_1, size: 100, color: Colors.black, ), @@ -403,7 +410,7 @@ class _PatientSearchScreenState extends State { ), ), (!(_selectedType == '2' || _selectedType == '4')) - ? DynamicElements(_patientSearchFormValues) + ? DynamicElements(_patientSearchFormValues, isFormSubmitted) : SizedBox( height: 0, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 14f68a79..4fcabf07 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -273,7 +273,7 @@ class _PatientsScreenState extends State { patientType) .then((res) { setState(() { - _isLoading = false; + if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { @@ -302,10 +302,13 @@ class _PatientsScreenState extends State { responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList2 = responseModelList; _isError = false; + } else { _isError = true; - error = model.error; //res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } + + _isLoading = false; }); }).catchError((error) { setState(() { diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index e6688397..60b681d7 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -1,13 +1,15 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; 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:intl/intl.dart'; class DynamicElements extends StatefulWidget { final PatientModel _patientSearchFormValues; - DynamicElements(this._patientSearchFormValues); + final bool isFormSubmitted; + DynamicElements(this._patientSearchFormValues, this.isFormSubmitted); @override _DynamicElementsState createState() => _DynamicElementsState(); } @@ -113,6 +115,10 @@ class _DynamicElementsState extends State { ), SizedBox( + height: 5, + ), + if(widget._patientSearchFormValues.From == "0" && widget.isFormSubmitted) + CustomValidationError(),SizedBox( height: 10, ), AppTextFormField( @@ -137,6 +143,10 @@ class _DynamicElementsState extends State { } }, ), + if(widget._patientSearchFormValues.To == "0" && widget.isFormSubmitted) + CustomValidationError(),SizedBox( + height: 10, + ), ], ); }, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 8a9ae52b..11664510 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,9 +1,10 @@ +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; @@ -28,6 +29,7 @@ class _AppDrawerState extends State { bool _isInit = true; Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; + // @override // void didChangeDependencies() { // super.didChangeDependencies(); @@ -47,119 +49,126 @@ class _AppDrawerState extends State { // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ - Expanded( - flex: 4, - child: ListView(padding: EdgeInsets.zero, children: [ - Container( - height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset('assets/images/logo.png'), - margin: EdgeInsets.only(top: 10, bottom: 15), - ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, + Expanded( + flex: 4, + child: ListView(padding: EdgeInsets.zero, children: [ + Container( + height: SizeConfig.heightMultiplier * 50, + child: InkWell( + child: DrawerHeader( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Image.asset( + 'assets/images/logo.png', ), + margin: EdgeInsets.only(top: 10, bottom: 15), ), - SizedBox(height: 15), - authProvider.doctorProfile != null - ? CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: NetworkImage( - authProvider.doctorProfile.doctorImageURL), - backgroundColor: Colors.white, - ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - authProvider.doctorProfile?.doctorName, - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )) - : SizedBox(), - AppText( - projectsProvider.isArabic - ? authProvider - .doctorProfile.titleDescriptionN ?? - "" - : authProvider - .doctorProfile?.titleDescription ?? - "", - fontWeight: FontWeight.normal, - color: Colors.black87), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - }, + SizedBox( + height: 1, + child: Container( + color: Colors.black26, + ), + ), + SizedBox(height: 15), + InkWell( + onTap: (){ + Navigator.of(context).pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + children: [ + authProvider.doctorProfile != null + ? CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + backgroundImage: NetworkImage( + authProvider.doctorProfile.doctorImageURL), + backgroundColor: Colors.white, + ) + : SizedBox(), + authProvider.doctorProfile != null + ? Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + authProvider.doctorProfile?.doctorName, + fontWeight: FontWeight.bold, + color: Colors.black, + fontSize: SizeConfig.textMultiplier * 2, + )) + : SizedBox(), + AppText( + projectsProvider.isArabic + ? authProvider + .doctorProfile.titleDescriptionN ?? + "" + : authProvider + .doctorProfile?.titleDescription ?? + "", + fontWeight: FontWeight.normal, + color: Colors.black87), + ], + ), + ), + RaisedButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: Colors.red)), + child: AppText( + TranslationBase.of(context).logout, + color: Colors.white, + ), + onPressed: () async { + Navigator.pop(context); + await helpers.logout(); + }, + ), + ], ), - ], + ), ), ), - onTap: () { - //Navigator.of(context).pushNamed(PROFILE); - Navigator.of(context).pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - ), - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, + InkWell( + child: DrawerItem( + TranslationBase.of(context).settings, Icons.settings), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(SETTINGS); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).qr + + TranslationBase.of(context).reader, + DoctorApp.qr_code), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(QR_READER); + }, + ), + ]), ), - ]), - ), - Expanded( - flex: 1, - child: Column(children: [ - Container( - // This align moves the children to the bottom - child: Align( - alignment: FractionalOffset.bottomCenter, - child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], - )))) - ])) - ])), + Expanded( + flex: 1, + child: Column(children: [ + Container( + // This align moves the children to the bottom + child: Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + child: Column( + children: [ + Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 30, + ) + ], + )))) + ])) + ])), ), width: SizeConfig.realScreenWidth * 0.60, margin: 0, diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index c4fe25c1..9696aa1f 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -28,7 +28,7 @@ class _DrawerItemState extends State { return Container( margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), child: Row( - crossAxisAlignment: CrossAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ Icon( widget.icon, @@ -37,12 +37,15 @@ class _DrawerItemState extends State { ), Column( crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( widget.title, color: widget.color ?? Colors.black, // fontWeight: FontWeight.bold, - margin: 5, + // margin: 5, + marginLeft: 5, + marginRight: 5, fontSize: SizeConfig.textMultiplier * 2.3, ), AppText( From b92bc85e8f9507b51c870a34f80b6e734da648e2 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 25 Jan 2021 15:39:19 +0300 Subject: [PATCH 214/421] bug fixes --- lib/widgets/auth/login_form.dart | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index e78e0217..4709a94a 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -117,8 +117,8 @@ class _LoginFormState extends State { }, onFieldSubmitted: (_) { focusPass.nextFocus(); - helpers.showCupertinoPicker( - context, projectsList, 'facilityName', onSelectProject); + // helpers.showCupertinoPicker( + // context, projectsList, 'facilityName', onSelectProject); }, onTap: () { this.getProjects(userInfo.userID); @@ -130,8 +130,8 @@ class _LoginFormState extends State { focusNode: focusProject, controller: projectIdController, onTap: () { - helpers.showCupertinoPicker(context, projectsList, - 'facilityName', onSelectProject); + // helpers.showCupertinoPicker(context, projectsList, + // 'facilityName', onSelectProject); }, showCursor: false, readOnly: true, @@ -150,7 +150,7 @@ class _LoginFormState extends State { readOnly: true, decoration: buildInputDecoration( context, - TranslationBase.of(context).loading, + TranslationBase.of(context).pleaseEnterYourProject, 'assets/images/password_icon.png')), buildSizedBox(), Row( @@ -334,8 +334,10 @@ class _LoginFormState extends State { projectsProv.getProjectsList(memberID).then((res) { //hideLoading(); if (res['MessageStatus'] == 1) { + projectsList = res['ProjectInfo']; setState(() { - projectsList = res['ProjectInfo']; + userInfo.projectID = projectsList[0]["facilityId"]; + projectIdController.text = projectsList[0]['facilityName']; }); } else { // handel error From 68d27a451de1d9646ea8bc72e0d6aac4db42452c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 25 Jan 2021 15:15:30 +0200 Subject: [PATCH 215/421] fix general issue --- lib/config/localized_values.dart | 4 +-- lib/screens/dashboard_screen.dart | 14 ++-------- lib/screens/settings/settings_screen.dart | 5 ++-- .../profile/profile-welcome-widget.dart | 3 ++- .../subjective/update_allergies_widget.dart | 24 ++++++++--------- .../subjective/update_history_widget.dart | 26 +++++++++---------- 6 files changed, 33 insertions(+), 43 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 9fc39b5c..ad82f0eb 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -29,7 +29,7 @@ const Map> localizedValues = { 'en': 'Answer/Suggestions', 'ar': 'ملاحضات وتفاصيل العيادة' }, - 'outPatients': {'en': 'Out-Patients', 'ar': 'ةالمريض الخارجي'}, + 'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'}, 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, @@ -44,7 +44,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'}, - 'inPatient': {'en': 'In-Patient', 'ar': 'االمريض الداخلي'}, + 'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 85dd440d..fc9a8bf8 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -141,16 +141,6 @@ class _DashboardScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).welcome, - fontSize: - SizeConfig.textMultiplier * 1.7, - color: Colors.white, - ) - ], - ), SizedBox( height: 4, ), @@ -1201,8 +1191,8 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.19 - : MediaQuery.of(context).size.height * 0.35, + ? MediaQuery.of(context).size.height * 0.20 + : MediaQuery.of(context).size.height * 0.36, decoration: BoxDecoration( color: !hasBorder ? color != null diff --git a/lib/screens/settings/settings_screen.dart b/lib/screens/settings/settings_screen.dart index 7d41d662..16d53831 100644 --- a/lib/screens/settings/settings_screen.dart +++ b/lib/screens/settings/settings_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -34,7 +35,7 @@ class SettingsScreen extends StatelessWidget { child: AnimatedContainer( duration: Duration(milliseconds: 350), decoration: BoxDecoration( - color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, + color: !projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent, border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) ), child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500])) @@ -47,7 +48,7 @@ class SettingsScreen extends StatelessWidget { child: AnimatedContainer( duration: Duration(milliseconds: 350), decoration: BoxDecoration( - color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent, + color: projectsProvider.isArabic ? AppGlobal.appPrimaryColor : Colors.transparent, border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) ), child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],)) diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index fae705f4..ce05b83e 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -43,7 +43,8 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - 'Dr. ${authProvider.doctorProfile.doctorName}', + TranslationBase.of(context).dr + + ' ${authProvider.doctorProfile.doctorName}', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, color: Colors.white, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 38a0896b..df0cb683 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -83,19 +83,17 @@ class _UpdateAllergiesWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( - child: Expanded( - child: Texts( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Colors.black), - ), + child: Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), width: MediaQuery.of(context).size.width * 0.5, ), Texts( diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart index 81217025..de5d2fb2 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_history_widget.dart @@ -83,18 +83,16 @@ class _UpdateHistoryWidgetState extends State mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( - child: Expanded( - child: Texts( - projectViewModel.isArabic - ? myHistory.selectedHistory.nameAr - : myHistory.selectedHistory.nameEn, - variant: "bodyText", - textDecoration: myHistory.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Colors.black), - ), + child: Texts( + projectViewModel.isArabic + ? myHistory.selectedHistory.nameAr + : myHistory.selectedHistory.nameEn, + variant: "bodyText", + textDecoration: myHistory.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), width: MediaQuery.of(context).size.width * 0.7, ), if (myHistory.isChecked) @@ -212,7 +210,9 @@ class _PriorityBarState extends State { crossAxisAlignment: CrossAxisAlignment.center, children: _priorities.map((item,) { bool _isActive = _priorities[_activePriority] == item ? true : false; - index++; + if(index <2){ + index++; + } return Expanded( child: InkWell( child: Center( From fb8381ea6157bda8c5d40f72e4cfe96a4db77dd5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 25 Jan 2021 16:10:21 +0200 Subject: [PATCH 216/421] bugs fix --- lib/core/model/procedure/ControlsModel.dart | 18 +++ .../procedure/post_procedure_req_model.dart | 21 +-- .../update_procedure_request_model.dart | 75 ++++++++++ lib/core/service/procedure_service.dart | 6 +- lib/core/viewModel/procedure_View_model.dart | 9 +- lib/screens/base/base_view.dart | 4 +- .../prescription/add_prescription_form.dart | 139 ++++++------------ .../prescription/prescription_screen.dart | 80 +++++++++- lib/screens/procedures/procedure_screen.dart | 39 +++-- lib/util/dr_app_toast_msg.dart | 10 +- 10 files changed, 259 insertions(+), 142 deletions(-) create mode 100644 lib/core/model/procedure/ControlsModel.dart create mode 100644 lib/core/model/procedure/update_procedure_request_model.dart diff --git a/lib/core/model/procedure/ControlsModel.dart b/lib/core/model/procedure/ControlsModel.dart new file mode 100644 index 00000000..b3e8ae9c --- /dev/null +++ b/lib/core/model/procedure/ControlsModel.dart @@ -0,0 +1,18 @@ +class Controls { + String code; + String controlValue; + + Controls({this.code, this.controlValue}); + + Controls.fromJson(Map json) { + code = json['Code']; + controlValue = json['ControlValue']; + } + + Map toJson() { + final Map data = new Map(); + data['Code'] = this.code; + data['ControlValue'] = this.controlValue; + return data; + } +} diff --git a/lib/core/model/procedure/post_procedure_req_model.dart b/lib/core/model/procedure/post_procedure_req_model.dart index 52f62a11..b12563f8 100644 --- a/lib/core/model/procedure/post_procedure_req_model.dart +++ b/lib/core/model/procedure/post_procedure_req_model.dart @@ -1,3 +1,5 @@ +import 'ControlsModel.dart'; + class PostProcedureReqModel { int patientMRN; int appointmentNo; @@ -66,22 +68,3 @@ class Procedures { return data; } } - -class Controls { - String code; - String controlValue; - - Controls({this.code, this.controlValue}); - - Controls.fromJson(Map json) { - code = json['Code']; - controlValue = json['ControlValue']; - } - - Map toJson() { - final Map data = new Map(); - data['Code'] = this.code; - data['ControlValue'] = this.controlValue; - return data; - } -} diff --git a/lib/core/model/procedure/update_procedure_request_model.dart b/lib/core/model/procedure/update_procedure_request_model.dart new file mode 100644 index 00000000..aee39879 --- /dev/null +++ b/lib/core/model/procedure/update_procedure_request_model.dart @@ -0,0 +1,75 @@ +import 'ControlsModel.dart'; + +class UpdateProcedureRequestModel { + int orderNo; + int patientMRN; + int appointmentNo; + int episodeID; + int lineItemNo; + ProcedureDetail procedureDetail; + String vidaAuthTokenID; + + UpdateProcedureRequestModel( + {this.orderNo, + this.patientMRN, + this.appointmentNo, + this.episodeID, + this.lineItemNo, + this.procedureDetail, + this.vidaAuthTokenID}); + + UpdateProcedureRequestModel.fromJson(Map json) { + orderNo = json['OrderNo']; + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + lineItemNo = json['LineItemNo']; + procedureDetail = json['procedureDetail'] != null + ? new ProcedureDetail.fromJson(json['procedureDetail']) + : null; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['OrderNo'] = this.orderNo; + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['LineItemNo'] = this.lineItemNo; + if (this.procedureDetail != null) { + data['procedureDetail'] = this.procedureDetail.toJson(); + } + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} + +class ProcedureDetail { + String procedure; + String category; + List controls; + + ProcedureDetail({this.procedure, this.category, this.controls}); + + ProcedureDetail.fromJson(Map json) { + procedure = json['Procedure']; + category = json['Category']; + if (json['Controls'] != null) { + controls = new List(); + json['Controls'].forEach((v) { + controls.add(new Controls.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + data['Procedure'] = this.procedure; + data['Category'] = this.category; + if (this.controls != null) { + data['Controls'] = this.controls.map((v) => v.toJson()).toList(); + } + return data; + } +} diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 89fe6be3..515e0e50 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_re import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:flutter/foundation.dart'; @@ -104,7 +105,8 @@ class ProcedureService extends BaseService { }, body: postProcedureReqModel.toJson()); } - Future updateProcedure(PostProcedureReqModel postProcedureReqModel) async { + Future updateProcedure( + UpdateProcedureRequestModel updateProcedureRequestModel) async { hasError = false; _procedureList.clear(); await baseAppClient.post(UPDATE_PROCEDURE, @@ -113,6 +115,6 @@ class ProcedureService extends BaseService { }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; - }, body: postProcedureReqModel.toJson()); + }, body: updateProcedureRequestModel.toJson()); } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 5c253025..6be63be0 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dar import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; @@ -61,7 +62,6 @@ class ProcedureViewModel extends BaseViewModel { if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); - await getProcedure(mrn: mrn); } else { await getProcedure(mrn: mrn); setState(ViewState.Idle); @@ -69,16 +69,17 @@ class ProcedureViewModel extends BaseViewModel { } Future updateProcedure( - {PostProcedureReqModel postProcedureReqModel, int mrn}) async { + {UpdateProcedureRequestModel updateProcedureRequestModel, + int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); setState(ViewState.Busy); - await _procedureService.updateProcedure(postProcedureReqModel); + await _procedureService.updateProcedure(updateProcedureRequestModel); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); - await getProcedure(mrn: mrn); + // await getProcedure(mrn: mrn); } } diff --git a/lib/screens/base/base_view.dart b/lib/screens/base/base_view.dart index cf24b47f..7a5c93e6 100644 --- a/lib/screens/base/base_view.dart +++ b/lib/screens/base/base_view.dart @@ -33,8 +33,8 @@ class _BaseViewState extends State> { @override Widget build(BuildContext context) { - return ChangeNotifierProvider( - create: (BuildContext context) => model, + return ChangeNotifierProvider.value( + value: model, child: Consumer(builder: widget.builder), ); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 53d78b1e..c519d134 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1,6 +1,5 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; @@ -8,29 +7,21 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; -import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.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/screens/prescription/drugtodrug.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_screen.dart'; -import 'package:doctor_app_flutter/screens/prescription/prescription_warnings.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/dynamic_elements.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; -import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -198,14 +189,25 @@ class _PrescriptionFormWidgetState extends State { dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; dynamic route27 = {"id": 31, "name": "In Each Nostril"}; - dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; - dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; - dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; + dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; + dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; + dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency8 = {"id": 34, "name": "As Directed"}; + dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; + dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; + dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; + dynamic frequency12 = {"id": 20, "name": "Once a Week"}; + dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; + dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; + dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; + dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; + dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; + dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; + dynamic duration1 = {"id": 1, "name": "For 1 Day"}; dynamic duration2 = {"id": 2, "name": "For 2 Days"}; dynamic duration3 = {"id": 3, "name": "For 3 Days"}; @@ -234,6 +236,15 @@ class _PrescriptionFormWidgetState extends State { dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; + dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; + dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; + dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; + dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; + dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; + dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; + dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime21 = {"id": 11, "name": "Now"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; @@ -273,6 +284,17 @@ class _PrescriptionFormWidgetState extends State { doseTimeList.add(doseTime9); doseTimeList.add(doseTime10); doseTimeList.add(doseTime11); + doseTimeList.add(doseTime12); + doseTimeList.add(doseTime13); + doseTimeList.add(doseTime14); + doseTimeList.add(doseTime15); + doseTimeList.add(doseTime16); + doseTimeList.add(doseTime17); + doseTimeList.add(doseTime18); + doseTimeList.add(doseTime19); + doseTimeList.add(doseTime20); + doseTimeList.add(doseTime21); + doseTimeList.add(doseTime12); frequencyList.add(frequency1); frequencyList.add(frequency2); @@ -282,6 +304,16 @@ class _PrescriptionFormWidgetState extends State { frequencyList.add(frequency6); frequencyList.add(frequency7); frequencyList.add(frequency8); + frequencyList.add(frequency9); + frequencyList.add(frequency10); + frequencyList.add(frequency11); + frequencyList.add(frequency12); + frequencyList.add(frequency13); + frequencyList.add(frequency14); + frequencyList.add(frequency15); + frequencyList.add(frequency16); + frequencyList.add(frequency17); + frequencyList.add(frequency18); routeList.add(route1); routeList.add(route2); routeList.add(route3); @@ -484,46 +516,6 @@ class _PrescriptionFormWidgetState extends State { ], ), ), - // Container( - // height: screenSize.height * 0.070, - // child: InkWell( - // onTap: referToList != null - // ? () { - // ListSelectDialog dialog = - // ListSelectDialog( - // list: referToList, - // attributeName: 'name', - // attributeValueId: 'id', - // okText: - // TranslationBase.of(context) - // .ok, - // okFunction: (selectedValue) { - // setState(() { - // type = selectedValue; - // _selectedBranch = null; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: - // (BuildContext context) { - // return dialog; - // }, - // ); - // } - // : null, - // child: TextField( - // decoration: textFieldSelectorDecoration( - // TranslationBase.of(context) - // .orderType, - // type != null ? type['name'] : null, - // true), - // enabled: false, - // ), - // ), - // ), SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, @@ -863,15 +855,13 @@ class _PrescriptionFormWidgetState extends State { // formKey.currentState.save(); // Navigator.pop(context); // openDrugToDrug(); - if (strength == null || - route == null || + if (route == null || frequency == null || indication == null || doseTime == null || duration == null || selectedDate == null || - units == null || - _selectedMedication == null) { + units == null) { DrAppToastMsg.showErrorToast( "Please Fill All Fields"); return; @@ -1023,41 +1013,4 @@ class _PrescriptionFormWidgetState extends State { ); }); } - - // searchData(String str, PrescriptionViewModel model) { - // var strExist = str.length > 0 ? true : false; - // - // if (strExist) { - // filteredNotesList = null; - // filteredNotesList = model.drugsList - // .where((note) => - // note["GenericName"].toString().contains(str.toUpperCase())) - // .toList(); - // setState(() { - // notesList = filteredNotesList; - // }); - // } else { - // setState(() { - // notesList = model.drugsList; - // }); - // } - // } - - searchMedicine(context, PrescriptionViewModel model, String str) async { - FocusScope.of(context).unfocus(); - // if (searchController.text.isEmpty()) { - // helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); - // //"Type Medicine Name") - // return; - // } - if (searchController.text.length < 0) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); - return; - } - - GifLoaderDialogUtils.showMyDialog(context); - - await model.getDrugs(drugName: searchController.text); - GifLoaderDialogUtils.hideDialog(context); - } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 00fc38b8..4208c599 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -49,14 +49,24 @@ class _NewPrescriptionScreenState extends State { doseTimeList = List(); frequencyList = List(); - dynamic frequency1 = {"id": 1, "name": "2 Times a day"}; - dynamic frequency2 = {"id": 2, "name": "3 Times a day"}; - dynamic frequency3 = {"id": 3, "name": "4 Times a day"}; + dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; + dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; + dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; dynamic frequency4 = {"id": 8, "name": "As Needed"}; dynamic frequency5 = {"id": 9, "name": "Bed Time"}; dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; dynamic frequency8 = {"id": 34, "name": "As Directed"}; + dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; + dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; + dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; + dynamic frequency12 = {"id": 20, "name": "Once a Week"}; + dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; + dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; + dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; + dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; + dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; + dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; dynamic doseTime2 = {"id": 2, "name": "After Meals"}; dynamic doseTime3 = {"id": 3, "name": "With Meals"}; @@ -69,6 +79,15 @@ class _NewPrescriptionScreenState extends State { dynamic doseTime10 = {"id": 10, "name": "While wake"}; dynamic doseTime11 = {"id": 12, "name": "Any Time"}; dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; + dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; + dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; + dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; + dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; + dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; + dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; + dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime21 = {"id": 11, "name": "Now"}; dynamic route1 = {"id": 7, "name": "By Mouth"}; dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; dynamic route3 = {"id": 15, "name": "for INJECTION"}; @@ -78,6 +97,24 @@ class _NewPrescriptionScreenState extends State { dynamic route7 = {"id": 27, "name": "In Both EYES"}; dynamic route8 = {"id": 28, "name": "In Both Ears"}; dynamic route9 = {"id": 32, "name": "Intramuscular"}; + dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; + dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; + dynamic route12 = {"id": 15, "name": "for INJECTION"}; + dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; + dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; + dynamic route15 = {"id": 56, "name": "IRRIGATION"}; + dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; + dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; + dynamic route18 = {"id": 51, "name": "EPIDURAL"}; + dynamic route19 = {"id": 47, "name": "Parenteral"}; + dynamic route20 = {"id": 43, "name": "IM"}; + dynamic route21 = {"id": 42, "name": "IV"}; + dynamic route22 = {"id": 41, "name": "Sublingual"}; + dynamic route23 = {"id": 40, "name": "For Nebulization"}; + dynamic route24 = {"id": 39, "name": "Nasal"}; + dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; + dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; + dynamic route27 = {"id": 31, "name": "In Each Nostril"}; frequencyList.add(frequency1); frequencyList.add(frequency2); @@ -87,6 +124,16 @@ class _NewPrescriptionScreenState extends State { frequencyList.add(frequency6); frequencyList.add(frequency7); frequencyList.add(frequency8); + frequencyList.add(frequency9); + frequencyList.add(frequency10); + frequencyList.add(frequency11); + frequencyList.add(frequency12); + frequencyList.add(frequency13); + frequencyList.add(frequency14); + frequencyList.add(frequency15); + frequencyList.add(frequency16); + frequencyList.add(frequency17); + frequencyList.add(frequency18); doseTimeList.add(doseTime1); doseTimeList.add(doseTime2); doseTimeList.add(doseTime3); @@ -99,6 +146,15 @@ class _NewPrescriptionScreenState extends State { doseTimeList.add(doseTime10); doseTimeList.add(doseTime11); doseTimeList.add(doseTime12); + doseTimeList.add(doseTime13); + doseTimeList.add(doseTime14); + doseTimeList.add(doseTime15); + doseTimeList.add(doseTime16); + doseTimeList.add(doseTime17); + doseTimeList.add(doseTime18); + doseTimeList.add(doseTime19); + doseTimeList.add(doseTime20); + doseTimeList.add(doseTime21); routeList.add(route1); routeList.add(route2); routeList.add(route3); @@ -108,6 +164,24 @@ class _NewPrescriptionScreenState extends State { routeList.add(route7); routeList.add(route8); routeList.add(route9); + routeList.add(route10); + routeList.add(route11); + routeList.add(route12); + routeList.add(route13); + routeList.add(route14); + routeList.add(route15); + routeList.add(route16); + routeList.add(route17); + routeList.add(route18); + routeList.add(route19); + routeList.add(route20); + routeList.add(route21); + routeList.add(route22); + routeList.add(route23); + routeList.add(route24); + routeList.add(route25); + routeList.add(route26); + routeList.add(route27); } Widget build(BuildContext context) { diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 5483ffd9..b78bf65d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -2,8 +2,10 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -676,10 +678,11 @@ postProcedure( postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; - - controls.add( - Controls(code: remarks.isEmpty ? '' : remarks, controlValue: 'test'), - ); + entityList.forEach((element) { + controls.add( + Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), + ); + }); entityList.forEach((element) { controlsProcedure.add(Procedures( @@ -693,6 +696,7 @@ postProcedure( if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been added'); } @@ -704,30 +708,37 @@ updateProcedure( String procedureId, PatiantInformtion patient, String categorieId}) async { - PostProcedureReqModel updateProcedureReqModel = new PostProcedureReqModel(); + UpdateProcedureRequestModel updateProcedureReqModel = + new UpdateProcedureRequestModel(); List controls = List(); - List controlsProcedure = List(); + ProcedureDetail controlsProcedure = new ProcedureDetail(); updateProcedureReqModel.appointmentNo = patient.appointmentNo; updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.patientMRN = patient.patientMRN; + updateProcedureReqModel.lineItemNo = 1; + updateProcedureReqModel.orderNo = 0; controls.add( - Controls( - code: remarks.isEmpty ? '' : remarks, - controlValue: 'Testing', - ), + Controls(code: "02", controlValue: remarks.isEmpty ? '' : remarks), ); - controlsProcedure.add(Procedures( - category: categorieId, procedure: procedureId, controls: controls)); - updateProcedureReqModel.procedures = controlsProcedure; + + controlsProcedure.procedure = procedureId; + controlsProcedure.category = categorieId; + controlsProcedure.controls = controls; + + // controlsProcedure.add(ProcedureDetail( + // category: categorieId, procedure: procedureId, controls: controls)); + updateProcedureReqModel.procedureDetail = controlsProcedure; await model.updateProcedure( - postProcedureReqModel: updateProcedureReqModel, mrn: patient.patientMRN); + updateProcedureRequestModel: updateProcedureReqModel, + mrn: patient.patientMRN); if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); } diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index 09259b45..48addfba 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; - class DrAppToastMsg { + +class DrAppToastMsg { void showLongToast(msg) { FlutterFlexibleToast.showToast( message: msg, @@ -8,7 +9,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; ); } - static void showSuccesToast(msg) { + static void showSuccesToast(msg) { FlutterFlexibleToast.showToast( message: msg, toastLength: Toast.LENGTH_SHORT, @@ -19,7 +20,6 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; textColor: Colors.white); } - static void showErrorToast(msg) { FlutterFlexibleToast.showToast( message: msg, @@ -29,7 +29,7 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; icon: ICON.CLOSE, fontSize: 16, imageSize: 35, - timeInSeconds: 110, + timeInSeconds: 185, textColor: Colors.white); } @@ -75,4 +75,4 @@ import 'package:flutter_flexible_toast/flutter_flexible_toast.dart'; void cancelToast(msg) { FlutterFlexibleToast.cancel(); } -} \ No newline at end of file +} From 13c879654b353f377ee75dda50a495f9c149c0e6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 10:35:23 +0200 Subject: [PATCH 217/421] DA-250: fix age --- lib/screens/patients/patients_screen.dart | 6 +++--- lib/util/date-utils.dart | 18 +++++++++++++++++ .../profile/patient_profile_widget.dart | 20 ++----------------- 3 files changed, 23 insertions(+), 21 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 4fcabf07..1a55153e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.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'; @@ -615,9 +616,8 @@ class _PatientsScreenState extends State { .white, ), AppText( - item - .age - .toString(), + " ${DateUtils.getAgeByBirthday(item.dateofBirth)}", + fontSize: 1.8 * SizeConfig .textMultiplier, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index c414cd51..bfa406c6 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -216,5 +216,23 @@ class DateUtils { return 12; } } + + static String getAgeByBirthday(dynamic birthday){ + // https://leechy.dev/calculate-dates-diff-in-dart + DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + final now = DateTime.now(); + int years = now.year - birthDate .year; + int months = now.month - birthDate.month; + int days = now.day - birthDate.day; + if (months < 0 || (months == 0 && days < 0)) { + years--; + months += (days < 0 ? 11 : 12); + } + if (days < 0) { + final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); + days = now.difference(monthAgo).inDays + 1; + } + return "$years Yr $months Mnth $days Day"; + } } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 225decf4..b8fcf89c 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -18,23 +18,7 @@ import './profile_medical_info_widget.dart'; class PatientProfileWidget extends StatelessWidget { PatiantInformtion patient; - String getPatientAge(dynamic birthday){ - // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); - final now = DateTime.now(); - int years = now.year - birthDate .year; - int months = now.month - birthDate.month; - int days = now.day - birthDate.day; - if (months < 0 || (months == 0 && days < 0)) { - years--; - months += (days < 0 ? 11 : 12); - } - if (days < 0) { - final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); - days = now.difference(monthAgo).inDays + 1; - } - return "$years Yr $months Mnth $days Day"; - } + @override Widget build(BuildContext context) { @@ -133,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${getPatientAge(patient.dateofBirth)/*patient.age*/}", + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", fontWeight: FontWeight.normal, fontSize: 1.6 * SizeConfig.textMultiplier, ), From b9eaee188727fe31a69e15e8d429fa73d6080683 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 10:46:14 +0200 Subject: [PATCH 218/421] fix design --- .../profile/patient_orders_screen.dart | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index 09834d50..d193b6ef 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -128,18 +128,24 @@ class _PatientsOrdersState extends State { ), ), children: [ - Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - AppText( - notesList[index]["Notes"], - margin: 5, - ) - ], + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + notesList[index]["Notes"], + margin: 5, + ), + ], + ) + ], ), ], )); From 905818b5322c51c0fd2af2dfc7f7bfa37479c199 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 12:44:06 +0200 Subject: [PATCH 219/421] add admission no to orders --- lib/screens/patients/profile/patient_orders_screen.dart | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index d193b6ef..a7182546 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -117,6 +117,12 @@ class _PatientsOrdersState extends State { marginBottom: 5, fontWeight: FontWeight.bold, ), + AppText( + notesList[index] + ["AdmissionNo"], + marginLeft: 10, + color: Colors.grey[600], + ), AppText( convertDateFormat( notesList[index] From 913ffc30523db97ca18c3c87630113025b976231 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 15:44:22 +0200 Subject: [PATCH 220/421] Fix DA-260,DA-267 --- ios/Runner/GoogleService-Info.plist | 36 +++++++++++++++++++ lib/config/localized_values.dart | 2 +- .../soap_update/update_assessment_page.dart | 6 ++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 ios/Runner/GoogleService-Info.plist diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 00000000..0c093a2a --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,36 @@ + + + + + CLIENT_ID + 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r + API_KEY + AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs + GCM_SENDER_ID + 864393916058 + PLIST_VERSION + 1 + BUNDLE_ID + com.cloud.diplomaticquarterapp + PROJECT_ID + diplomaticquarter-d2385 + STORAGE_BUCKET + diplomaticquarter-d2385.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:864393916058:ios:13f787bbfe6051f8b97923 + DATABASE_URL + https://diplomaticquarter-d2385.firebaseio.com + + \ No newline at end of file diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ad82f0eb..1a62467c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -215,7 +215,7 @@ const Map> localizedValues = { 'en': 'Please fill all fields..!', 'ar': 'الرجاء ملأ جميع الحقول..!' }, - 'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, + 'replay2': {'en': 'Reply', 'ar': 'رد الطبيب'}, 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, 'price': {'en': 'Price', 'ar': 'السعر'}, diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index e6e1a908..bafa5af4 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -309,6 +309,12 @@ class _UpdateAssessmentPageState extends State { SizedBox( height: 6, ), + AppText( + TranslationBase.of(context).remarks, + fontWeight: FontWeight + .bold, + fontSize: 16, + ), Container( width: MediaQuery .of(context) From d7c3024baf4a86ed80c9c140dc63356b3ccaa706 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 15:44:55 +0200 Subject: [PATCH 221/421] remove GoogleService-Info.plist --- ios/Runner/GoogleService-Info.plist | 36 ----------------------------- 1 file changed, 36 deletions(-) delete mode 100644 ios/Runner/GoogleService-Info.plist diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist deleted file mode 100644 index 0c093a2a..00000000 --- a/ios/Runner/GoogleService-Info.plist +++ /dev/null @@ -1,36 +0,0 @@ - - - - - CLIENT_ID - 864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r.apps.googleusercontent.com - REVERSED_CLIENT_ID - com.googleusercontent.apps.864393916058-ekeb4s8tgfo58dutv0l54399t7ivr06r - API_KEY - AIzaSyA_6ayGCk4fly7o7eTVBrj9kuHBYHMAOfs - GCM_SENDER_ID - 864393916058 - PLIST_VERSION - 1 - BUNDLE_ID - com.cloud.diplomaticquarterapp - PROJECT_ID - diplomaticquarter-d2385 - STORAGE_BUCKET - diplomaticquarter-d2385.appspot.com - IS_ADS_ENABLED - - IS_ANALYTICS_ENABLED - - IS_APPINVITE_ENABLED - - IS_GCM_ENABLED - - IS_SIGNIN_ENABLED - - GOOGLE_APP_ID - 1:864393916058:ios:13f787bbfe6051f8b97923 - DATABASE_URL - https://diplomaticquarter-d2385.firebaseio.com - - \ No newline at end of file From c065dbbdb3b115f7f46850dd3166c09e7762e226 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 16:07:16 +0200 Subject: [PATCH 222/421] Fixed DA:266 --- lib/config/localized_values.dart | 4 ++ lib/util/translations_delegate_base.dart | 2 + .../soap_update/update_assessment_page.dart | 56 +++++++++++++++---- 3 files changed, 50 insertions(+), 12 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 1a62467c..a9498b2a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -666,4 +666,8 @@ const Map> localizedValues = { 'en': "You have to add chief complaint fields correctly .", 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, + 'ICDName': { + 'en': "ICDName", + 'ar': "اسم ال ICD" + }, }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2c3be5b1..c3c40e36 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1036,6 +1036,8 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; +String get ICDName => + localizedValues['ICDName'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index bafa5af4..61bf27f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -210,7 +210,7 @@ class _UpdateAssessmentPageState extends State { assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), @@ -225,6 +225,32 @@ class _UpdateAssessmentPageState extends State { crossAxisAlignment: CrossAxisAlignment .start, children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).ICDName +" : ", + fontWeight: FontWeight + .bold, + fontSize: 13, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.29, + child: AppText( + assessment + .selectedICD.description + .toString(), + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ), Row( mainAxisAlignment: MainAxisAlignment.start, @@ -233,7 +259,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).appointmentNo, fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( assessment @@ -248,15 +274,21 @@ class _UpdateAssessmentPageState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ + AppText( + TranslationBase.of(context).condition + " : ", + fontWeight: FontWeight + .bold, + fontSize: 13, + ), AppText( projectViewModel.isArabic?assessment .selectedDiagnosisCondition .nameAr : assessment .selectedDiagnosisCondition .nameEn, - fontWeight: FontWeight - .bold, - fontSize: 16, + fontSize: 10, + color: Colors.grey, + ), ], ), @@ -268,7 +300,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).dType+' : ', fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( projectViewModel.isArabic?assessment @@ -290,7 +322,7 @@ class _UpdateAssessmentPageState extends State { TranslationBase.of(context).doc, fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), AppText( assessment.doctorName??'', @@ -310,16 +342,16 @@ class _UpdateAssessmentPageState extends State { height: 6, ), AppText( - TranslationBase.of(context).remarks, + TranslationBase.of(context).remarks + " : ", fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), Container( width: MediaQuery .of(context) .size - .width * 0.5, + .width * 0.38, child: AppText( assessment.remark ?? "", fontSize: 10, @@ -341,7 +373,7 @@ class _UpdateAssessmentPageState extends State { "ICD : ".toUpperCase(), fontWeight: FontWeight .bold, - fontSize: 16, + fontSize: 13, ), Container( child: AppText( @@ -526,7 +558,7 @@ class _AddAssessmentDetailsState extends State { AppText( TranslationBase.of(context).addAssessmentDetails.toUpperCase(), fontWeight: FontWeight.bold, - fontSize: 16, + fontSize: 13, ), SizedBox( height: 16, From fd17fc46082dbbd60d799ef81deb2bfe844931e7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 26 Jan 2021 16:22:06 +0200 Subject: [PATCH 223/421] enforce user to add date in case referral --- lib/screens/patients/patient_search_screen.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 726e5050..39f7fe65 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -76,7 +76,9 @@ class _PatientSearchScreenState extends State { if ((_patientSearchFormValues.From == "0" || _patientSearchFormValues.To == "0") && - _selectedType == "7") { + _selectedType == "7" || ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "6") ) { // helpers.showErrorToast("Please Choose The Dates"); } else { setState(() { From ac9fd8c936c1f12a3e9c8298579be0d85fb90eb5 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 26 Jan 2021 16:53:42 +0200 Subject: [PATCH 224/421] samll fixes for labels and msges --- lib/config/localized_values.dart | 10 ++- .../viewModel/patient-referral-viewmodel.dart | 2 +- .../patient-vital-sign-viewmodel.dart | 37 +++++---- .../referral/my-referral-detail-screen.dart | 16 +++- lib/util/translations_delegate_base.dart | 4 + .../patient-referral-item-widget.dart | 82 +++++++++++++------ 6 files changed, 108 insertions(+), 43 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 602ed1b9..91401655 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -49,7 +49,7 @@ const Map> localizedValues = { 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, 'myReferralPatient': {'en': 'My Referral Patient', 'ar': 'مرضى الاحالة'}, - 'referPatient': {'en': 'Refer Patient', 'ar': 'إحالة مريض'}, + 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, @@ -666,4 +666,12 @@ const Map> localizedValues = { 'en': "You have to add chief complaint fields correctly .", 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, + 'referralStatus': { + 'en': "Referral Status : ", + 'ar': "حالة الإحالة :" + }, + 'referralRemark': { + 'en': "Referral Remark : ", + 'ar': "ملاحظة الإحالة :" + }, }; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index a1fc73fb..abe39224 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -131,7 +131,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 4e656d6d..2def78db 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-history.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import '../../locator.dart'; @@ -13,7 +14,9 @@ class VitalSignsViewModel extends BaseViewModel { VitalSignsService _vitalSignService = locator(); VitalSignData get patientVitalSigns => _vitalSignService.patientVitalSigns; - List get patientVitalSignsHistory => _vitalSignService.patientVitalSignsHistory; + + List get patientVitalSignsHistory => + _vitalSignService.patientVitalSignsHistory; String heightCm = "0"; String weightKg = "0"; @@ -34,8 +37,16 @@ class VitalSignsViewModel extends BaseViewModel { } } - Future getPatientVitalSignHistory(PatiantInformtion patient, String from, String to) async { + Future getPatientVitalSignHistory( + PatiantInformtion patient, String from, String to) async { setState(ViewState.Busy); + if (from == null || from == "0") { + from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + if (to == null || to == "0") { + to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + await _vitalSignService.getPatientVitalSignsHistory(patient, from, to); if (_vitalSignService.hasError) { error = _vitalSignService.error; @@ -48,9 +59,7 @@ class VitalSignsViewModel extends BaseViewModel { if (weightKg == "0" || weightKg == null || weightKg == 'null') { weightKg = element.weightKg.toString(); } - if (bodyMax == "0" || - bodyMax == null || - bodyMax == 'null') { + if (bodyMax == "0" || bodyMax == null || bodyMax == 'null') { bodyMax = element.bodyMassIndex.toString(); } if (temperatureCelcius == "0" || @@ -84,24 +93,24 @@ class VitalSignsViewModel extends BaseViewModel { return "Normal"; } else if (bodyMassIndex <= 30) { return "Overweight"; - } else { // > 30.0 + } else { + // > 30.0 return "Obese"; } } - String getTempratureMethod(int temperatureCelciusMethod){ - // temperatureCelciusMethod ( vital sign response field )- master 2005 - if(temperatureCelciusMethod == 1){ + String getTempratureMethod(int temperatureCelciusMethod) { + // temperatureCelciusMethod ( vital sign response field )- master 2005 + if (temperatureCelciusMethod == 1) { return "Oral"; - } else if(temperatureCelciusMethod == 2){ + } else if (temperatureCelciusMethod == 2) { return "Axilla"; - } else if(temperatureCelciusMethod == 3){ + } else if (temperatureCelciusMethod == 3) { return "Rectal"; - } else if(temperatureCelciusMethod == 4){ + } else if (temperatureCelciusMethod == 4) { return "Tympanic"; - } else if(temperatureCelciusMethod == 5){ + } else if (temperatureCelciusMethod == 5) { return "Temporal"; } } - } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index a0cb98b3..9d3c9f00 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -1,9 +1,11 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; @@ -144,8 +146,11 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: () { - model.responseReferral(pendingReferral, true); + handler: () async { + await model.responseReferral(pendingReferral, true); + if(model.state == ViewState.ErrorLocal){ + DrAppToastMsg.showErrorToast(model.error); + } }, ), ), @@ -160,8 +165,11 @@ class MyReferralDetailScreen extends StatelessWidget { fontSize: 16, hPadding: 8, vPadding: 12, - handler: () { - model.responseReferral(pendingReferral, false); + handler: () async { + await model.responseReferral(pendingReferral, true); + if(model.state == ViewState.ErrorLocal){ + DrAppToastMsg.showErrorToast(model.error); + } }, ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 2c3be5b1..43a51237 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1036,6 +1036,10 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get referralStatus => + localizedValues['referralStatus'][locale.languageCode]; + String get referralRemark => + localizedValues['referralRemark'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 17f33793..fb8276c8 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -37,25 +37,36 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ Center( child: AppText( - "${patientName}", + patientName != null ? "${patientName}" : "", color: Colors.black, fontWeight: FontWeight.bold, fontSize: 16, ), ), if (referralStatus != null) - Container( - color: Color(0xFF4BA821), - padding: EdgeInsets.all(4), - child: AppText( - referralStatus - /*referralStatus == "46" - ? TranslationBase.of(context).approved - : TranslationBase.of(context).rejected*/, - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 12, - ), + Row( + children: [ + AppText( + TranslationBase.of(context).referralStatus, + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + Container( + color: Color(0xFF4BA821), + padding: EdgeInsets.all(4), + child: AppText( + referralStatus + /*referralStatus == "46" + ? TranslationBase.of(context).approved + : TranslationBase.of(context).rejected*/ + , + color: Colors.white, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + ], ), SizedBox( height: 8, @@ -83,11 +94,26 @@ class PatientReferralItemWidget extends StatelessWidget { SizedBox( height: 8, ), - AppText( - "${TranslationBase.of(context).dr} $referralDoctorName", - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).referralDoctor} : ", + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + Expanded( + child: AppText( + referralDoctorName != null + ? "${TranslationBase.of(context).dr} $referralDoctorName" + : "", + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ), + ], ), SizedBox( height: 8, @@ -112,11 +138,21 @@ class PatientReferralItemWidget extends StatelessWidget { SizedBox( height: 8, ), - AppText( - remark, - color: Colors.grey, - fontWeight: FontWeight.normal, - fontSize: 12, + Row( + children: [ + AppText( + TranslationBase.of(context).referralRemark, + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + remark, + color: Colors.grey, + fontWeight: FontWeight.normal, + fontSize: 12, + ), + ], ), SizedBox( height: 16, From 35bc8c03a46c58799da8c764e1c94459dec198aa Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 26 Jan 2021 17:52:03 +0200 Subject: [PATCH 225/421] bug fixing --- .../medical-file/medical_file_page.dart | 178 ++--- .../prescription/add_prescription_form.dart | 34 +- .../prescription/prescription_screen.dart | 660 ++++++++++++------ lib/screens/procedures/procedure_screen.dart | 67 +- lib/util/dr_app_toast_msg.dart | 2 +- 5 files changed, 612 insertions(+), 329 deletions(-) diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 54d978e3..a5fab36e 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -41,97 +41,109 @@ class _MedicalFilePageState extends State { thickness: 1.0, color: Colors.grey, ), - if (model.medicalFileList.length != 0) - 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.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, + fontWeight: FontWeight.w700, + ), + ), + ], + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinicName + + ": ", + fontWeight: FontWeight.w700, + ), + AppText( model .medicalFileList[0] .entityList[0] .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, + .clinicName, ), - ), - ], - ), - 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, - ) - ], + ], + ), + 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.patientMRN, + )), + ); + }, ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicalFileDetails( - age: patient.age, - firstName: patient.firstName, - lastName: patient.lastName, - gender: patient.genderDescription, - encounterNumber: index, - pp: patient.patientMRN, - )), - ); - }, + ); + }) + : Center( + child: Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', ), - ); - }) + ), + ) ], ), ), diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index c519d134..1d481904 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dar import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:flutter/services.dart'; addPrescriptionForm(context, PrescriptionViewModel model, PatiantInformtion patient, prescription) { @@ -101,6 +102,7 @@ class _PrescriptionFormWidgetState extends State { TextEditingController instructionController = TextEditingController(); DateTime selectedDate; dynamic selectedDrug; + int strengthChar; GetMedicationResponseModel _selectedMedication; GlobalKey key = new GlobalKey>(); @@ -525,21 +527,33 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.650, + 0.550, child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter(4) + ], hintText: TranslationBase.of(context) .strength, controller: strengthController, keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty && - strengthController.text.length > - 4) - return TranslationBase.of(context) - .emptyMessage; - else - return null; + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, ), ), SizedBox( @@ -548,7 +562,7 @@ class _PrescriptionFormWidgetState extends State { Container( width: MediaQuery.of(context).size.width * - 0.250, + 0.350, child: InkWell( onTap: unitsList != null ? () { diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4208c599..2b71ab8e 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -22,6 +22,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; class NewPrescriptionScreen extends StatefulWidget { @@ -32,15 +33,21 @@ class NewPrescriptionScreen extends StatefulWidget { class _NewPrescriptionScreenState extends State { PersistentBottomSheetController _controller; final _scaffoldKey = GlobalKey(); + TextEditingController strengthController = TextEditingController(); int testNum = 0; + int strengthChar; PatiantInformtion patient; dynamic route; dynamic doseTime; dynamic frequencyUpdate; + dynamic updatedDuration; + dynamic units; List doseTimeList; List routeList; List frequencyList; + List durationList; + List unitsList; @override void initState() { @@ -48,7 +55,12 @@ class _NewPrescriptionScreenState extends State { routeList = List(); doseTimeList = List(); frequencyList = List(); + durationList = List(); + unitsList = List(); + dynamic unit1 = {"id": 1, "name": "MG"}; + dynamic unit2 = {"id": 2, "name": "MCG"}; + dynamic unit3 = {"id": 3, "name": "GM"}; dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; @@ -115,7 +127,39 @@ class _NewPrescriptionScreenState extends State { dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; dynamic route27 = {"id": 31, "name": "In Each Nostril"}; + dynamic duration1 = {"id": 1, "name": "For 1 Day"}; + dynamic duration2 = {"id": 2, "name": "For 2 Days"}; + dynamic duration3 = {"id": 3, "name": "For 3 Days"}; + dynamic duration4 = {"id": 4, "name": "For 4 Days"}; + dynamic duration5 = {"id": 5, "name": "For 5 Days"}; + dynamic duration6 = {"id": 6, "name": "For 6 Days"}; + dynamic duration7 = {"id": 7, "name": "For 7 Days"}; + dynamic duration8 = {"id": 8, "name": "For 8 Days"}; + dynamic duration9 = {"id": 9, "name": "For 9 Days"}; + dynamic duration10 = {"id": 10, "name": "For 10 Days"}; + dynamic duration11 = {"id": 14, "name": "For 14 Days"}; + dynamic duration12 = {"id": 21, "name": "For 21 Days"}; + dynamic duration13 = {"id": 30, "name": "For 30 Days"}; + dynamic duration14 = {"id": 45, "name": "For 45 Days"}; + dynamic duration15 = {"id": 60, "name": "For 60 Days"}; + dynamic duration16 = {"id": 90, "name": "For 90 Days"}; + durationList.add(duration1); + durationList.add(duration2); + durationList.add(duration3); + durationList.add(duration4); + durationList.add(duration5); + durationList.add(duration6); + durationList.add(duration7); + durationList.add(duration8); + durationList.add(duration9); + durationList.add(duration10); + durationList.add(duration11); + durationList.add(duration12); + durationList.add(duration13); + durationList.add(duration14); + durationList.add(duration15); + durationList.add(duration16); frequencyList.add(frequency1); frequencyList.add(frequency2); frequencyList.add(frequency3); @@ -182,6 +226,9 @@ class _NewPrescriptionScreenState extends State { routeList.add(route25); routeList.add(route26); routeList.add(route27); + unitsList.add(unit1); + unitsList.add(unit2); + unitsList.add(unit3); } Widget build(BuildContext context) { @@ -442,7 +489,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.282, + 0.295, width: MediaQuery.of( context) .size @@ -582,13 +629,18 @@ class _NewPrescriptionScreenState extends State { children: [ Expanded( child: - AppText( - model - .prescriptionList[0] - .entityList[index] - .remarks, - fontSize: - 14.0, + Container( + height: + 30, + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .remarks, + fontSize: + 11.5, + ), ), ), ], @@ -792,213 +844,389 @@ class _NewPrescriptionScreenState extends State { builder: (BuildContext context) { return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { - return Container( - height: MediaQuery.of(context).size.height * 0.73, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 30.0, - ), - Column( - children: [ - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: routeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: routeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, - route != null ? route['name'] : null, - true), - enabled: false, - ), + return DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.6, + builder: + (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + drugName.toUpperCase(), + fontWeight: FontWeight.w900, ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: doseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: doseTimeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, - doseTime != null - ? doseTime['name'] - : null, - true), - enabled: false, - ), + SizedBox( + height: 10.0, ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: frequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: frequencyList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, - frequencyUpdate != null - ? frequencyUpdate['name'] + Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * + 0.070, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.550, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter( + 4) + ], + hintText: + TranslationBase.of(context) + .strength, + controller: strengthController, + keyboardType: TextInputType.number, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + width: 10.0, + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.3200, + child: InkWell( + onTap: unitsList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: unitsList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['name'] + : null, + true), + enabled: false, + ), + ), + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, - ), - ), - SizedBox( - height: 12.0, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription'.toUpperCase(), - onPressed: () { - updatePrescription( - doseUnit: doseUnit, - doseStreangth: doseStreangth, - duration: duration, - startDate: startDate, - doseId: dose, - frequencyId: frequency, - routeId: rouat, - patient: patient, - model: model, - drugId: drugId, - remarks: remarksController.text, - route: route != null - ? route['id'].toString() - : rouat, - frequency: frequencyUpdate != null - ? frequencyUpdate['id'].toString() - : frequency, - dose: doseTime != null - ? doseTime['id'].toString() - : dose, - enteredRemarks: enteredRemarks); - Navigator.pop(context); - }, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).route, + route != null + ? route['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .frequency, + frequencyUpdate != null + ? frequencyUpdate['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: durationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: durationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .duration, + updatedDuration != null + ? updatedDuration['name'] + .toString() + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: remarks, + controller: remarksController, + maxLines: 7, + minLines: 4, + ), + ), + SizedBox( + height: 12.0, + ), + SizedBox( + height: MediaQuery.of(context).size.height * + 0.12, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'update prescription' + .toUpperCase(), + onPressed: () { + updatePrescription( + newDoseStreangth: + strengthController + .text.isNotEmpty + ? strengthController + .text + : doseStreangth, + newUnit: units != null + ? units['id'].toString() + : doseUnit, + doseUnit: doseUnit, + doseStreangth: doseStreangth, + duration: duration, + startDate: startDate, + doseId: dose, + frequencyId: frequency, + routeId: rouat, + patient: patient, + model: model, + newDuration: updatedDuration != + null + ? updatedDuration['id'] + .toString() + : duration, + drugId: drugId, + remarks: remarksController.text, + route: route != null + ? route['id'].toString() + : rouat, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'] + .toString() + : frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : dose, + enteredRemarks: enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), ), ], ), - ), - ], + ], + ), ), - ], - ), - ), - )); + )); + }); }); }); } @@ -1016,7 +1244,10 @@ class _NewPrescriptionScreenState extends State { String startDate, String doseUnit, String doseStreangth, + String newDoseStreangth, String duration, + String newDuration, + String newUnit, String enteredRemarks, PatiantInformtion patient}) async { //PrescriptionViewModel model = PrescriptionViewModel(); @@ -1031,10 +1262,13 @@ class _NewPrescriptionScreenState extends State { sss.add(PrescriptionRequestModel( covered: true, - dose: int.parse( - doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, + dose: newDoseStreangth.isNotEmpty + ? int.parse(newDoseStreangth) + : int.parse( + doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, - doseUnitId: int.parse(doseUnit), + doseUnitId: + newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), frequency: frequency.isNotEmpty ? int.parse(frequency) @@ -1043,7 +1277,9 @@ class _NewPrescriptionScreenState extends State { approvalRequired: true, icdcode10Id: "test2", doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: int.parse(duration), + duration: newDuration.isNotEmpty + ? int.parse(newDuration) + : int.parse(duration), doseStartDate: startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index b78bf65d..05850316 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -1,14 +1,14 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; -import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/screens/procedures/entity_list_checkbox_search_widget.dart'; @@ -16,17 +16,12 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; -import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -46,6 +41,7 @@ class _ProcedureScreenState extends State { } TextEditingController procedureController = TextEditingController(); + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -269,8 +265,16 @@ class _ProcedureScreenState extends State { .spaceBetween, children: [ Container( - height: 120.0, - width: 45.0, + height: MediaQuery.of( + context) + .size + .height * + 0.18, + width: MediaQuery.of( + context) + .size + .width * + 0.135, child: Column( children: [ AppText( @@ -312,8 +316,16 @@ class _ProcedureScreenState extends State { ), Expanded( child: Container( - height: 120, - width: 325.0, + height: MediaQuery.of( + context) + .size + .height * + 0.2, + width: MediaQuery.of( + context) + .size + .width * + 0.05, child: Column( children: [ Row( @@ -415,26 +427,35 @@ class _ProcedureScreenState extends State { children: [ Expanded( child: - AppText( - model - .procedureList[ - 0] - .entityList[ - index] - .remarks - .toString(), - fontSize: - 13.5, + Container( + height: MediaQuery.of(context) + .size + .height * + 0.052, + width: MediaQuery.of(context) + .size + .width * + 0.10, + child: + AppText( + model + .procedureList[0] + .entityList[index] + .remarks + .toString(), + fontSize: + 11.5, + ), ), ), ], ), SizedBox( - height: 10.0, + height: 20.0, ), Divider( - height: 5.0, + height: 1.0, thickness: 1.0, color: Colors.grey, diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index 48addfba..e4cfa65b 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -29,7 +29,7 @@ class DrAppToastMsg { icon: ICON.CLOSE, fontSize: 16, imageSize: 35, - timeInSeconds: 185, + timeInSeconds: 9000, textColor: Colors.white); } From ebc5ba7743c2d59cd40c67190e158ddab5b8a3e0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 27 Jan 2021 10:33:30 +0200 Subject: [PATCH 226/421] some fixes --- lib/config/localized_values.dart | 3 + .../patient-doctor-referral-service.dart | 5 +- .../viewModel/patient-referral-viewmodel.dart | 4 +- .../profile/UCAF/UCAF-detail-screen.dart | 19 +- .../profile/UCAF/UCAF-input-screen.dart | 43 ++-- .../referral/refer-patient-screen.dart | 55 +++-- .../vital_sign/vital_sign_details_screen.dart | 190 ++++++++++-------- lib/util/translations_delegate_base.dart | 13 ++ .../shared/dialogs/dailog-list-select.dart | 2 +- 9 files changed, 209 insertions(+), 125 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2de1f3d1..f70e13c8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -674,4 +674,7 @@ const Map> localizedValues = { 'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :" }, + 'icd': {'en': "ICD", 'ar': "التصنيف الدولي للأمراض" + // 'icd': {'en': "ICD", 'ar': " " + }, }; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 2f18540a..f452cfb6 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -32,13 +32,14 @@ class PatientReferralService extends LookupService { "Channel": 9, "TokenID": "", "SessionID": "i1UJwCTSqt", - "IsLoginForDoctorApp": true + "IsLoginForDoctorApp": true, + // "MemberID": memberID }; dynamic localRes; await baseAppClient.post(url, onSuccess: (response, statusCode) async { if (response['MessageStatus'] == 1) { - projectsList = response['ListProject']; + projectsList = response['ProjectInfo']; } else { // handel error projectsList = ListProject; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index abe39224..b9987601 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -94,8 +94,8 @@ class PatientReferralViewModel extends BaseViewModel { DoctorProfileModel doctorProfile = await getDoctorProfile(); if (doctorProfile != null) { dynamic _selectedBranch = { - "ID": doctorProfile.projectID, - "Desciption": doctorProfile.projectName + "facilityId": doctorProfile.projectID, + "facilityName": doctorProfile.projectName }; return _selectedBranch; } diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 489c462d..0831fffe 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -284,7 +284,24 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "${diagnosis.icdCode10ID} ${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", + "${diagnosisCondition != null ? model.selectedLanguage == 'ar' ? diagnosisCondition.nameAr : diagnosisCondition.nameEn : "-"}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).icd}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "${diagnosis.icdCode10ID}}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 0116ce46..1a9ac4fa 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -144,24 +144,31 @@ class _UCAFInputScreenState extends State { ), ], ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).temperature}", - fontSize: SizeConfig.textMultiplier * 1.8, - color: Colors.black, - fontWeight: FontWeight.w700, - ), - SizedBox( - width: 8, - ), - AppText( - "${model.patientVitalSigns.temperatureCelcius}(C), ${model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32}(F)", - fontSize: SizeConfig.textMultiplier * 2, - color: Colors.grey.shade800, - fontWeight: FontWeight.normal, - ), - ], + SizedBox( + width: 4, + ), + Expanded( + child: Row( + children: [ + AppText( + "${TranslationBase.of(context).temperature}", + fontSize: SizeConfig.textMultiplier * 1.8, + color: Colors.black, + fontWeight: FontWeight.w700, + ), + SizedBox( + width: 8, + ), + Expanded( + child: AppText( + "${model.patientVitalSigns.temperatureCelcius}(C), ${(model.patientVitalSigns.temperatureCelcius * (9 / 5) + 32).toStringAsFixed(2)}(F)", + fontSize: SizeConfig.textMultiplier * 2, + color: Colors.grey.shade800, + fontWeight: FontWeight.normal, + ), + ), + ], + ), ), ], ), diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 2c5311cc..04eba96e 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_loader_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -74,14 +75,14 @@ class _PatientMakeReferralScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - if (model.state == ViewState.BusyLocal) + /*if (model.state == ViewState.BusyLocal) Container( color: Colors.white, width: 50, height: 50, child: AppLoaderWidget( containerColor: Colors.white, - )), + )),*/ Column( children: [ PatientPageHeaderWidget(patient), @@ -95,17 +96,16 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? ReferralForm(model, screenSize) : PatientReferralItemWidget( - patientName: model.patientReferral[0].patientName, - referralStatus: "${model.patientReferral[0].referralStatus}", - isReferredTo: true, - isSameBranch: model.patientReferral[0] - .isReferralDoctorSameBranch, - referralDoctorName: - model.patientReferral[0].referredByDoctorInfo, - clinicDescription: null, - remark: - model.patientReferral[0].remarksFromSource - ), + patientName: model.patientReferral[0].patientName, + referralStatus: + "${model.patientReferral[0].referralStatus}", + isReferredTo: true, + isSameBranch: model + .patientReferral[0].isReferralDoctorSameBranch, + referralDoctorName: + model.patientReferral[0].referredByDoctorInfo, + clinicDescription: null, + remark: model.patientReferral[0].remarksFromSource), ], ), if (model.patientReferral.length == 0) @@ -124,7 +124,7 @@ class _PatientMakeReferralScreenState extends State { .makeReferral( patient, appointmentDate.toIso8601String(), - _selectedBranch['ID'], + _selectedBranch['facilityId'], _selectedClinic['ClinicID'], _selectedDoctor['DoctorID'], _remarksController.text) @@ -180,7 +180,12 @@ class _PatientMakeReferralScreenState extends State { model.getDoctorBranch().then((value) { _selectedBranch = value; if (_referTo['id'] == 1) { - model.getClinics(_selectedBranch['ID']); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); } }); }); @@ -217,15 +222,19 @@ class _PatientMakeReferralScreenState extends State { ? () { ListSelectDialog dialog = ListSelectDialog( list: model.branchesList, - attributeName: 'Desciption', - attributeValueId: 'ID', + attributeName: 'facilityName', + attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { _selectedBranch = selectedValue; _selectedClinic = null; _selectedDoctor = null; - model.getClinics(_selectedBranch['ID']); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinics(_selectedBranch['facilityId']) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); }); }, ); @@ -242,7 +251,7 @@ class _PatientMakeReferralScreenState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).branch, _selectedBranch != null - ? _selectedBranch['Desciption'] + ? _selectedBranch['facilityName'] : null, true), enabled: false, @@ -268,8 +277,12 @@ class _PatientMakeReferralScreenState extends State { setState(() { _selectedDoctor = null; _selectedClinic = selectedValue; - model.getClinicDoctors( - _selectedClinic['ClinicID'].toString()); + GifLoaderDialogUtils.showMyDialog(context); + model + .getClinicDoctors( + _selectedClinic['ClinicID'].toString()) + .then((_) => + GifLoaderDialogUtils.hideDialog(context)); }); }, ); diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index ad312625..45cd8d14 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/lookups/patient_lookup.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -9,13 +10,15 @@ 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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class VitalSignDetailsScreen extends StatelessWidget { - int appointmentNo; int projectID; bool isNotOneAppointment; - VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true}); + + VitalSignDetailsScreen( + {this.appointmentNo, this.projectID, this.isNotOneAppointment = true}); @override Widget build(BuildContext context) { @@ -23,10 +26,11 @@ class VitalSignDetailsScreen extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String from = routeArgs['from']; String to = routeArgs['to']; - String imageBasePath = 'assets/images/'; + String imageBasePath = 'assets/images/'; return BaseView( - onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), + onModelReady: (model) => + model.getPatientVitalSignHistory(patient, from, to), builder: (_, mode, widget) => AppScaffold( isShowAppBar: true, baseViewModel: mode, @@ -38,16 +42,19 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () =>isNotOneAppointment? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: TranslationBase.of(context).height, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context).height, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).height, @@ -58,16 +65,19 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context).weight, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).weight, imagePath: "${imageBasePath}vital_weight.png", @@ -80,17 +90,20 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BodyMeasurements, - pageTitle: TranslationBase.of(context) - .bodyMeasurements, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ): null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.BodyMeasurements, + pageTitle: TranslationBase.of(context) + .bodyMeasurements, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).body, imagePath: "${imageBasePath}vital_body_mass.png", @@ -99,21 +112,24 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: - TranslationBase.of(context).temperature, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Temperature, + pageTitle: TranslationBase.of(context) + .temperature, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: Container( child: VitalSignItem( des: TranslationBase.of(context).temperature, - imagePath: "${imageBasePath}vital_temperature.png", + imagePath: + "${imageBasePath}vital_temperature.png", lastVal: mode.temperatureCelcius, unit: TranslationBase.of(context).tempC, ), @@ -124,16 +140,19 @@ class VitalSignDetailsScreen extends StatelessWidget { Row( children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: TranslationBase.of(context).heart, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context).heart, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).heart, imagePath: "${imageBasePath}vital_heart_rate.png", @@ -142,17 +161,19 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ), InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: - TranslationBase.of(context).respirationRate, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Respiration, + pageTitle: TranslationBase.of(context) + .respirationRate, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).respirationRate, imagePath: "${imageBasePath}vital_respiration.png", @@ -166,19 +187,23 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ InkWell( - onTap: () => isNotOneAppointment ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context).bloodPressure, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ):null, + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.BloodPressure, + pageTitle: TranslationBase.of(context) + .bloodPressure, + vitalList: mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( des: TranslationBase.of(context).bloodPressure, - imagePath: "${imageBasePath}vital_blood-pressure.png", + imagePath: + "${imageBasePath}vital_blood-pressure.png", lastVal: mode.bloodPressure, unit: TranslationBase.of(context).sysDias, ), @@ -189,7 +214,12 @@ class VitalSignDetailsScreen extends StatelessWidget { ), ) : Center( - child: AppText('No Data'), + child: AppText( + TranslationBase.of(context).vitalSignEmptyMsg, + fontWeight: FontWeight.normal, + color: HexColor("#B8382B"), + fontSize: SizeConfig.textMultiplier * 2.5, + ), ), ), ); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 43a51237..a49873a7 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1013,21 +1013,30 @@ class TranslationBase { String get createdBy => localizedValues['createdBy'][locale.languageCode]; String get editedBy => localizedValues['editedBy'][locale.languageCode]; + String get currentMedications => localizedValues['currentMedications'][locale.languageCode]; + String get noItem => localizedValues['noItem'][locale.languageCode]; + String get postUcafSuccessMsg => localizedValues['postUcafSuccessMsg'][locale.languageCode]; + String get vitalSignDetailEmpty => localizedValues['vitalSignDetailEmpty'][locale.languageCode]; + String get onlyOfftimeHoliday => localizedValues['onlyOfftimeHoliday'][locale.languageCode]; + String get active => localizedValues['active'][locale.languageCode]; + String get hold => localizedValues['hold'][locale.languageCode]; + String get loading => localizedValues['loading'][locale.languageCode]; String get assessmentErrorMsg => localizedValues['assessmentErrorMsg'][locale.languageCode]; + String get examinationErrorMsg => localizedValues['examinationErrorMsg'][locale.languageCode]; @@ -1036,10 +1045,14 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; + String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; + String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + + String get icd => localizedValues['icd'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index fa33a72d..b6df1f6f 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -47,8 +47,8 @@ class _ListSelectDialogState extends State { Widget continueButton = FlatButton( child: Text(this.widget.okText), onPressed: () { - this.widget.okFunction(widget.selectedValue); Navigator.of(context).pop(); + this.widget.okFunction(widget.selectedValue); }); // set up the AlertDialog AlertDialog alert = AlertDialog( From d34744e16859a04282d162a571594e3df8a81c3b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 27 Jan 2021 11:39:48 +0300 Subject: [PATCH 227/421] bug fix --- assets/images/Doctor_app_logo.png | Bin 0 -> 9713 bytes lib/widgets/auth/login_form.dart | 11 ++++++----- 2 files changed, 6 insertions(+), 5 deletions(-) create mode 100644 assets/images/Doctor_app_logo.png diff --git a/assets/images/Doctor_app_logo.png b/assets/images/Doctor_app_logo.png new file mode 100644 index 0000000000000000000000000000000000000000..2de2d46002571791ee2343f07957e2322ae1a599 GIT binary patch literal 9713 zcmcI~c|4Tw_xF%x>_e7GVn_^G#*i&bCS>12lw=xXU&e0iyX-;~*$c_8NXV9mY#~G> zWl0)qcAm@k`}usH-|Kn(e$Vs$=kdB{=AL`5`&{Qb=UngeKIax=pm&XdmXj6&fiP%l zs2YJ!>ysCh3cM4(Jun6zGz1NE4+wFUViT%EGK6ny1@0B5`>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9;E^ z5pJ~>U(_P9eR}!Q*x^w1R^6R>zZuHZa!HL%?@OM+TXg;-YvUK3A;HGDRXX9;^xUL_ z070W?ta`b6KJPqKIx}J@Ht_B?QkTjmZf!O51jb%ki1cXQE{K4H{Nk>V-59A4l1p{k znZOjX4mkKd=3ffOnwy*N3CVH1sxe}afl;2-pq;w#D_52SXlT|}=O6q~yKdk5!@XpB zmgd_GN6Lq5M>|~897^Q@YWSAP;g&roBWV_lfoZx+xs;UD!-NOlH!RjO1A6Te-owRU zo;3IIwueTTP+nn4rtj|aO;uZ&eU)Z1mfJl}Ik8N9f*2+GS6_awR|fp(^;f@k?II-a zi8W2U`gtmE#^~iGchsUAV(A+ z3yO-UxRW@z2NqwjnbUW)&T7bf$Q7>6nv>nl@&CQsc9kh`cTHO+d;(|4LJp}Bp;O+U zsMSCGQ{Qqp@TlccpN+AxaR^?HBAg674!Jrk1s<=(b { projectIdController.text = projectsList[0]['facilityName']; }); } else { + print(res); // handel error - setState(() { - projectsList = ListProject; - }); + // setState(() { + // projectsList = ListProject; + // }); } }).catchError((err) { setState(() { - projectsList = ListProject; + print(err); }); print(err); }); @@ -386,6 +387,6 @@ class _LoginFormState extends State { getProjectsList(value); } } - _isInit = false; + //_isInit = false; } } From 2273808333ce236bb723e94a02a29af0e15b3fbe Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 27 Jan 2021 10:56:05 +0200 Subject: [PATCH 228/421] translation --- lib/screens/patients/patients_screen.dart | 2 +- lib/util/date-utils.dart | 4 ++-- lib/widgets/patients/profile/patient_profile_widget.dart | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 1a55153e..50b89148 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -616,7 +616,7 @@ class _PatientsScreenState extends State { .white, ), AppText( - " ${DateUtils.getAgeByBirthday(item.dateofBirth)}", + " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}", fontSize: 1.8 * SizeConfig diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 84b4167f..af90acf6 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -217,7 +217,7 @@ class DateUtils { } } - static String getAgeByBirthday(dynamic birthday){ + static String getAgeByBirthday(dynamic birthday, BuildContext context){ // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); final now = DateTime.now(); @@ -232,7 +232,7 @@ class DateUtils { final monthAgo = new DateTime(now.year, now.month - 1, birthDate.day); days = now.difference(monthAgo).inDays + 1; } - return "$years Yr $months Mnth $days Day"; + return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } } diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index c289431b..4834e412 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -117,7 +117,7 @@ class PatientProfileWidget extends StatelessWidget { height: 4, ), AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth)/*patient.age*/}", + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", fontWeight: FontWeight.normal, fontSize: 1.6 * SizeConfig.textMultiplier, ), From 75efcde0bca3f5c63674678e72338ef0bf93224c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 27 Jan 2021 12:30:17 +0200 Subject: [PATCH 229/421] fix ios --- android/app/google-services.json | 21 +- ios/GoogleService-Info .plist | 34 ++ ios/Podfile.lock | 378 +++++++++++++++++- ios/Runner.xcodeproj/project.pbxproj | 13 +- ios/Runner/AppDelegate.swift | 2 - ios/Runner/GoogleService-Info.plist | 34 ++ ios/Runner/Info.plist | 9 +- ios/Runner/RunnerRelease.entitlements | 8 + lib/config/localized_values.dart | 3 + lib/main.dart | 5 +- lib/screens/dashboard_screen.dart | 10 +- lib/util/translations_delegate_base.dart | 3 + .../patient-referral-item-widget.dart | 27 +- pubspec.lock | 92 ++++- pubspec.yaml | 10 +- 15 files changed, 614 insertions(+), 35 deletions(-) create mode 100644 ios/GoogleService-Info .plist create mode 100644 ios/Runner/GoogleService-Info.plist create mode 100644 ios/Runner/RunnerRelease.entitlements diff --git a/android/app/google-services.json b/android/app/google-services.json index 3c00f05c..27e5dfb1 100644 --- a/android/app/google-services.json +++ b/android/app/google-services.json @@ -1,34 +1,41 @@ { "project_info": { - "project_number": "1008895414777", - "project_id": "doctorapp-9f172", - "storage_bucket": "doctorapp-9f172.appspot.com" + "project_number": "1097451043303", + "project_id": "doctor-app-35ddc", + "storage_bucket": "doctor-app-35ddc.appspot.com" }, "client": [ { "client_info": { - "mobilesdk_app_id": "1:1008895414777:android:d00fe21d6955c21b1f6d28", + "mobilesdk_app_id": "1:1097451043303:android:f82ecce9562ecaad866542", "android_client_info": { "package_name": "com.example.doctor_app_flutter" } }, "oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", "client_type": 3 } ], "api_key": [ { - "current_key": "AIzaSyCNncEIj8ehVUSxV89rx0x1NaWp8t1YVkw" + "current_key": "AIzaSyChu44P8Dp8jtRqnoDR2mdjqKgSKQq-FPY" } ], "services": { "appinvite_service": { "other_platform_oauth_client": [ { - "client_id": "1008895414777-3mg88j5ocs5r1au7rf4sh3f4pgsri2f2.apps.googleusercontent.com", + "client_id": "1097451043303-u7bl21167fq5b7u06cqpq621psv9s3qh.apps.googleusercontent.com", "client_type": 3 + }, + { + "client_id": "1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com", + "client_type": 2, + "ios_info": { + "bundle_id": "com.hmg.doctorApp" + } } ] } diff --git a/ios/GoogleService-Info .plist b/ios/GoogleService-Info .plist new file mode 100644 index 00000000..81c3af44 --- /dev/null +++ b/ios/GoogleService-Info .plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre + API_KEY + AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo + GCM_SENDER_ID + 1097451043303 + PLIST_VERSION + 1 + BUNDLE_ID + com.hmg.doctorApp + PROJECT_ID + doctor-app-35ddc + STORAGE_BUCKET + doctor-app-35ddc.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:1097451043303:ios:0e9b87e77dcf397d866542 + + \ No newline at end of file diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 40d9a06a..aa3e21b8 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,9 +1,235 @@ PODS: + - abseil/algorithm (0.20200225.0): + - abseil/algorithm/algorithm (= 0.20200225.0) + - abseil/algorithm/container (= 0.20200225.0) + - abseil/algorithm/algorithm (0.20200225.0): + - abseil/base/config + - abseil/algorithm/container (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/base (0.20200225.0): + - abseil/base/atomic_hook (= 0.20200225.0) + - abseil/base/base (= 0.20200225.0) + - abseil/base/base_internal (= 0.20200225.0) + - abseil/base/bits (= 0.20200225.0) + - abseil/base/config (= 0.20200225.0) + - abseil/base/core_headers (= 0.20200225.0) + - abseil/base/dynamic_annotations (= 0.20200225.0) + - abseil/base/endian (= 0.20200225.0) + - abseil/base/errno_saver (= 0.20200225.0) + - abseil/base/exponential_biased (= 0.20200225.0) + - abseil/base/log_severity (= 0.20200225.0) + - abseil/base/malloc_internal (= 0.20200225.0) + - abseil/base/periodic_sampler (= 0.20200225.0) + - abseil/base/pretty_function (= 0.20200225.0) + - abseil/base/raw_logging_internal (= 0.20200225.0) + - abseil/base/spinlock_wait (= 0.20200225.0) + - abseil/base/throw_delegate (= 0.20200225.0) + - abseil/base/atomic_hook (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/base (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/log_severity + - abseil/base/raw_logging_internal + - abseil/base/spinlock_wait + - abseil/meta/type_traits + - abseil/base/base_internal (0.20200225.0): + - abseil/base/config + - abseil/meta/type_traits + - abseil/base/bits (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/config (0.20200225.0) + - abseil/base/core_headers (0.20200225.0): + - abseil/base/config + - abseil/base/dynamic_annotations (0.20200225.0) + - abseil/base/endian (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/errno_saver (0.20200225.0): + - abseil/base/config + - abseil/base/exponential_biased (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/malloc_internal (0.20200225.0): + - abseil/base/base + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/base/dynamic_annotations + - abseil/base/raw_logging_internal + - abseil/base/periodic_sampler (0.20200225.0): + - abseil/base/core_headers + - abseil/base/exponential_biased + - abseil/base/pretty_function (0.20200225.0) + - abseil/base/raw_logging_internal (0.20200225.0): + - abseil/base/atomic_hook + - abseil/base/config + - abseil/base/core_headers + - abseil/base/log_severity + - abseil/base/spinlock_wait (0.20200225.0): + - abseil/base/base_internal + - abseil/base/core_headers + - abseil/base/errno_saver + - abseil/base/throw_delegate (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/container/compressed_tuple (0.20200225.0): + - abseil/utility/utility + - abseil/container/inlined_vector (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/container/inlined_vector_internal + - abseil/memory/memory + - abseil/container/inlined_vector_internal (0.20200225.0): + - abseil/base/core_headers + - abseil/container/compressed_tuple + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/span + - abseil/memory (0.20200225.0): + - abseil/memory/memory (= 0.20200225.0) + - abseil/memory/memory (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/meta (0.20200225.0): + - abseil/meta/type_traits (= 0.20200225.0) + - abseil/meta/type_traits (0.20200225.0): + - abseil/base/config + - abseil/numeric/int128 (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/strings/internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/meta/type_traits + - abseil/strings/str_format (0.20200225.0): + - abseil/strings/str_format_internal + - abseil/strings/str_format_internal (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/types/span + - abseil/strings/strings (0.20200225.0): + - abseil/base/base + - abseil/base/bits + - abseil/base/config + - abseil/base/core_headers + - abseil/base/endian + - abseil/base/raw_logging_internal + - abseil/base/throw_delegate + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/numeric/int128 + - abseil/strings/internal + - abseil/time (0.20200225.0): + - abseil/time/internal (= 0.20200225.0) + - abseil/time/time (= 0.20200225.0) + - abseil/time/internal (0.20200225.0): + - abseil/time/internal/cctz (= 0.20200225.0) + - abseil/time/internal/cctz (0.20200225.0): + - abseil/time/internal/cctz/civil_time (= 0.20200225.0) + - abseil/time/internal/cctz/time_zone (= 0.20200225.0) + - abseil/time/internal/cctz/civil_time (0.20200225.0): + - abseil/base/config + - abseil/time/internal/cctz/time_zone (0.20200225.0): + - abseil/base/config + - abseil/time/internal/cctz/civil_time + - abseil/time/time (0.20200225.0): + - abseil/base/base + - abseil/base/core_headers + - abseil/base/raw_logging_internal + - abseil/numeric/int128 + - abseil/strings/strings + - abseil/time/internal/cctz/civil_time + - abseil/time/internal/cctz/time_zone + - abseil/types (0.20200225.0): + - abseil/types/any (= 0.20200225.0) + - abseil/types/bad_any_cast (= 0.20200225.0) + - abseil/types/bad_any_cast_impl (= 0.20200225.0) + - abseil/types/bad_optional_access (= 0.20200225.0) + - abseil/types/bad_variant_access (= 0.20200225.0) + - abseil/types/compare (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - abseil/types/span (= 0.20200225.0) + - abseil/types/variant (= 0.20200225.0) + - abseil/types/any (0.20200225.0): + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_any_cast + - abseil/utility/utility + - abseil/types/bad_any_cast (0.20200225.0): + - abseil/base/config + - abseil/types/bad_any_cast_impl + - abseil/types/bad_any_cast_impl (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/bad_optional_access (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/bad_variant_access (0.20200225.0): + - abseil/base/config + - abseil/base/raw_logging_internal + - abseil/types/compare (0.20200225.0): + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/optional (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/memory/memory + - abseil/meta/type_traits + - abseil/types/bad_optional_access + - abseil/utility/utility + - abseil/types/span (0.20200225.0): + - abseil/algorithm/algorithm + - abseil/base/core_headers + - abseil/base/throw_delegate + - abseil/meta/type_traits + - abseil/types/variant (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/base/core_headers + - abseil/meta/type_traits + - abseil/types/bad_variant_access + - abseil/utility/utility + - abseil/utility/utility (0.20200225.0): + - abseil/base/base_internal + - abseil/base/config + - abseil/meta/type_traits - Alamofire (4.9.1) - barcode_scan (0.0.1): - Flutter - MTBBarcodeScanner - SwiftProtobuf + - BoringSSL-GRPC (0.0.7): + - BoringSSL-GRPC/Implementation (= 0.0.7) + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Implementation (0.0.7): + - BoringSSL-GRPC/Interface (= 0.0.7) + - BoringSSL-GRPC/Interface (0.0.7) + - cloud_firestore (0.14.3): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Firestore (~> 6.33.0) + - firebase_core + - Flutter + - cloud_firestore_web (0.1.0): + - Flutter - connectivity (0.0.1): - Flutter - Reachability @@ -13,12 +239,40 @@ PODS: - Flutter - device_info (0.0.1): - Flutter + - Firebase/Analytics (6.33.0): + - Firebase/Core + - Firebase/Auth (6.33.0): + - Firebase/CoreOnly + - FirebaseAuth (~> 6.9.2) + - Firebase/Core (6.33.0): + - Firebase/CoreOnly + - FirebaseAnalytics (= 6.8.3) - Firebase/CoreOnly (6.33.0): - FirebaseCore (= 6.10.3) + - Firebase/Firestore (6.33.0): + - Firebase/CoreOnly + - FirebaseFirestore (~> 1.18.0) - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.3): + - Firebase/Storage (6.33.0): + - Firebase/CoreOnly + - FirebaseStorage (~> 3.9.0) + - firebase_analytics (6.2.0): + - Firebase/Analytics (~> 6.33.0) + - Firebase/CoreOnly (~> 6.33.0) + - firebase_core + - Flutter + - firebase_analytics_web (0.1.0): + - Flutter + - firebase_auth (0.18.3): + - Firebase/Auth (~> 6.33.0) + - Firebase/CoreOnly (~> 6.33.0) + - firebase_core + - Flutter + - firebase_auth_web (0.1.0): + - Flutter + - firebase_core (0.5.2): - Firebase/CoreOnly (~> 6.33.0) - Flutter - firebase_core_web (0.1.0): @@ -28,6 +282,25 @@ PODS: - Firebase/Messaging (~> 6.33.0) - firebase_core - Flutter + - firebase_storage (5.0.1): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Storage (~> 6.33.0) + - firebase_core + - Flutter + - FirebaseAnalytics (6.8.3): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleAppMeasurement (= 6.8.3) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) + - FirebaseAuth (6.9.2): + - FirebaseCore (~> 6.10) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/Environment (~> 6.7) + - GTMSessionFetcher/Core (~> 1.1) - FirebaseCore (6.10.3): - FirebaseCoreDiagnostics (~> 1.6) - GoogleUtilities/Environment (~> 6.7) @@ -37,6 +310,18 @@ PODS: - GoogleUtilities/Environment (~> 6.7) - GoogleUtilities/Logger (~> 6.7) - nanopb (~> 1.30906.0) + - FirebaseFirestore (1.18.0): + - abseil/algorithm (= 0.20200225.0) + - abseil/base (= 0.20200225.0) + - abseil/memory (= 0.20200225.0) + - abseil/meta (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/time (= 0.20200225.0) + - abseil/types (= 0.20200225.0) + - FirebaseCore (~> 6.10) + - "gRPC-C++ (~> 1.28.0)" + - leveldb-library (~> 1.22) + - nanopb (~> 1.30906.0) - FirebaseInstallations (1.7.0): - FirebaseCore (~> 6.10) - GoogleUtilities/Environment (~> 6.7) @@ -55,11 +340,20 @@ PODS: - GoogleUtilities/Reachability (~> 6.7) - GoogleUtilities/UserDefaults (~> 6.7) - Protobuf (>= 3.9.2, ~> 3.9) + - FirebaseStorage (3.9.1): + - FirebaseCore (~> 6.10) + - GTMSessionFetcher/Core (~> 1.1) - Flutter (1.0.0) - flutter_flexible_toast (0.0.1): - Flutter - flutter_plugin_android_lifecycle (0.0.1): - Flutter + - GoogleAppMeasurement (6.8.3): + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/MethodSwizzler (~> 6.7) + - GoogleUtilities/Network (~> 6.7) + - "GoogleUtilities/NSData+zlib (~> 6.7)" + - nanopb (~> 1.30906.0) - GoogleDataTransport (7.5.1): - nanopb (~> 1.30906.0) - GoogleUtilities/AppDelegateSwizzler (6.7.2): @@ -70,6 +364,8 @@ PODS: - PromisesObjC (~> 1.2) - GoogleUtilities/Logger (6.7.2): - GoogleUtilities/Environment + - GoogleUtilities/MethodSwizzler (6.7.2): + - GoogleUtilities/Logger - GoogleUtilities/Network (6.7.2): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" @@ -79,10 +375,36 @@ PODS: - GoogleUtilities/Logger - GoogleUtilities/UserDefaults (6.7.2): - GoogleUtilities/Logger + - "gRPC-C++ (1.28.2)": + - "gRPC-C++/Implementation (= 1.28.2)" + - "gRPC-C++/Interface (= 1.28.2)" + - "gRPC-C++/Implementation (1.28.2)": + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - "gRPC-C++/Interface (= 1.28.2)" + - gRPC-Core (= 1.28.2) + - "gRPC-C++/Interface (1.28.2)" + - gRPC-Core (1.28.2): + - gRPC-Core/Implementation (= 1.28.2) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Implementation (1.28.2): + - abseil/container/inlined_vector (= 0.20200225.0) + - abseil/memory/memory (= 0.20200225.0) + - abseil/strings/str_format (= 0.20200225.0) + - abseil/strings/strings (= 0.20200225.0) + - abseil/types/optional (= 0.20200225.0) + - BoringSSL-GRPC (= 0.0.7) + - gRPC-Core/Interface (= 1.28.2) + - gRPC-Core/Interface (1.28.2) + - GTMSessionFetcher/Core (1.5.0) - hexcolor (0.0.1): - Flutter - imei_plugin (0.0.1): - Flutter + - leveldb-library (1.22) - local_auth (0.0.1): - Flutter - maps_launcher (0.0.1): @@ -132,13 +454,20 @@ PODS: DEPENDENCIES: - Alamofire - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) + - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) + - cloud_firestore_web (from `.symlinks/plugins/cloud_firestore_web/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`) - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - device_info (from `.symlinks/plugins/device_info/ios`) + - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) + - firebase_analytics_web (from `.symlinks/plugins/firebase_analytics_web/ios`) + - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) + - firebase_auth_web (from `.symlinks/plugins/firebase_auth_web/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) + - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) @@ -164,15 +493,26 @@ DEPENDENCIES: SPEC REPOS: trunk: + - abseil - Alamofire + - BoringSSL-GRPC - Firebase + - FirebaseAnalytics + - FirebaseAuth - FirebaseCore - FirebaseCoreDiagnostics + - FirebaseFirestore - FirebaseInstallations - FirebaseInstanceID - FirebaseMessaging + - FirebaseStorage + - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities + - "gRPC-C++" + - gRPC-Core + - GTMSessionFetcher + - leveldb-library - MTBBarcodeScanner - nanopb - OpenTok @@ -185,6 +525,10 @@ SPEC REPOS: EXTERNAL SOURCES: barcode_scan: :path: ".symlinks/plugins/barcode_scan/ios" + cloud_firestore: + :path: ".symlinks/plugins/cloud_firestore/ios" + cloud_firestore_web: + :path: ".symlinks/plugins/cloud_firestore_web/ios" connectivity: :path: ".symlinks/plugins/connectivity/ios" connectivity_for_web: @@ -193,12 +537,22 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_macos/ios" device_info: :path: ".symlinks/plugins/device_info/ios" + firebase_analytics: + :path: ".symlinks/plugins/firebase_analytics/ios" + firebase_analytics_web: + :path: ".symlinks/plugins/firebase_analytics_web/ios" + firebase_auth: + :path: ".symlinks/plugins/firebase_auth/ios" + firebase_auth_web: + :path: ".symlinks/plugins/firebase_auth_web/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" firebase_core_web: :path: ".symlinks/plugins/firebase_core_web/ios" firebase_messaging: :path: ".symlinks/plugins/firebase_messaging/ios" + firebase_storage: + :path: ".symlinks/plugins/firebase_storage/ios" Flutter: :path: Flutter flutter_flexible_toast: @@ -243,28 +597,46 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/url_launcher_windows/ios" SPEC CHECKSUMS: + abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 + BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 + cloud_firestore: 19c6f947dd14be9d71695ea23eefde67cd8829c8 + cloud_firestore_web: 9ec3dc7f5f98de5129339802d491c1204462bfec connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 + firebase_analytics: 52ba26fcfb9cc90f76b36c4e5200cc0a7e9024eb + firebase_analytics_web: 7d539061ea4af07563a0e21044af89cab70efec0 + firebase_auth: 240419f6b00dea39c60a2a9c4379c16c4a4b02fb + firebase_auth_web: 0955c07bcc06e84af76b9d4e32e6f31518f2d7de + firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + firebase_storage: d5cf595245e1770ef7081b026f603771bf5dd547 + FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193 + FirebaseAuth: c92d49ada7948d1a23466e3db17bc4c2039dddc3 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseFirestore: adff4877869ca91a11250cc0989a6cd56bad163f FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a + FirebaseStorage: 15e0f15ef3c7fec3d1899d68623e47d4447066b4 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 + "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 + gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 + GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52 hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd + leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7 local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb @@ -292,4 +664,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index dcd750d8..f35ae084 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,6 +8,7 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; + 29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 29211E4125C172B700DD740D /* GoogleService-Info.plist */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; @@ -34,6 +35,8 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; + 29211CD725C165D600DD740D /* RunnerRelease.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = RunnerRelease.entitlements; sourceTree = ""; }; + 29211E4125C172B700DD740D /* GoogleService-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "GoogleService-Info.plist"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -108,6 +111,8 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( + 29211E4125C172B700DD740D /* GoogleService-Info.plist */, + 29211CD725C165D600DD740D /* RunnerRelease.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -204,6 +209,7 @@ files = ( 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, + 29211E4225C172B700DD740D /* GoogleService-Info.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); @@ -354,7 +360,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -437,7 +443,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -486,7 +492,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -530,6 +536,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; + CODE_SIGN_ENTITLEMENTS = Runner/RunnerRelease.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; DEVELOPMENT_TEAM = 3A359E86ZF; ENABLE_BITCODE = NO; diff --git a/ios/Runner/AppDelegate.swift b/ios/Runner/AppDelegate.swift index 4512a3b1..b97c7000 100644 --- a/ios/Runner/AppDelegate.swift +++ b/ios/Runner/AppDelegate.swift @@ -1,7 +1,6 @@ import UIKit import Flutter import OpenTok - // Created by Mohammad Aljammal & Elham Rababah on 24/06/20. // Copyright © 2020 Cloud. All rights reserved. @@ -23,7 +22,6 @@ import OpenTok _ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? ) -> Bool { - let controller : FlutterViewController = window?.rootViewController as! FlutterViewController let videoCallChannel = FlutterMethodChannel(name: "Dr.cloudSolution/videoCall", binaryMessenger: controller.binaryMessenger) diff --git a/ios/Runner/GoogleService-Info.plist b/ios/Runner/GoogleService-Info.plist new file mode 100644 index 00000000..81c3af44 --- /dev/null +++ b/ios/Runner/GoogleService-Info.plist @@ -0,0 +1,34 @@ + + + + + CLIENT_ID + 1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre.apps.googleusercontent.com + REVERSED_CLIENT_ID + com.googleusercontent.apps.1097451043303-ifgtu6ub88dlk5dmv5tm531a5s47gbre + API_KEY + AIzaSyAKPayaNaI-2RN6S4PH5W9wYExmEgoBUvo + GCM_SENDER_ID + 1097451043303 + PLIST_VERSION + 1 + BUNDLE_ID + com.hmg.doctorApp + PROJECT_ID + doctor-app-35ddc + STORAGE_BUCKET + doctor-app-35ddc.appspot.com + IS_ADS_ENABLED + + IS_ANALYTICS_ENABLED + + IS_APPINVITE_ENABLED + + IS_GCM_ENABLED + + IS_SIGNIN_ENABLED + + GOOGLE_APP_ID + 1:1097451043303:ios:0e9b87e77dcf397d866542 + + \ No newline at end of file diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index d0d77b5e..01dc72ef 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -47,10 +47,13 @@ NSCameraUsageDescription - ${PRODUCT_NAME} always camera use - + App requires access to camera incase you are interested to attach images to your Qr Code. + NSPhotoLibraryUsageDescription + Need to upload image + NSMicrophoneUsageDescription ${PRODUCT_NAME} always Microphone use - + FirebaseAppDelegateProxyEnabled + diff --git a/ios/Runner/RunnerRelease.entitlements b/ios/Runner/RunnerRelease.entitlements new file mode 100644 index 00000000..903def2a --- /dev/null +++ b/ios/Runner/RunnerRelease.entitlements @@ -0,0 +1,8 @@ + + + + + aps-environment + development + + diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0ef7fe31..eea62b2a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -677,5 +677,8 @@ const Map> localizedValues = { 'ICDName': { 'en': "ICDName", 'ar': "اسم ال ICD" + }, 'patient-name': { + 'en': "Patient Name", + 'ar': "اسم المريص" }, }; diff --git a/lib/main.dart b/lib/main.dart index 1283da1e..79994205 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:firebase_core/firebase_core.dart'; import 'package:flutter/material.dart'; import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -13,7 +14,9 @@ import './routes.dart'; import 'config/config.dart'; import 'locator.dart'; -void main() { +void main()async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(); setupLocator(); runApp(MyApp()); } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index fc9a8bf8..717dbaa6 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -64,7 +64,15 @@ class _DashboardScreenState extends State { projectsProvider = Provider.of(context); projectsProvider.getDoctorClinicsList(); - _firebaseMessaging.setAutoInitEnabled(true); + // _firebaseMessaging.setAutoInitEnabled(true); + _firebaseMessaging.requestNotificationPermissions( + const IosNotificationSettings( + sound: true, badge: true, alert: true, provisional: true)); + _firebaseMessaging.onIosSettingsRegistered + .listen((IosNotificationSettings settings) { + print("Settings registered: $settings"); + }); + _firebaseMessaging.getToken().then((String token) async { if (token != '') { DEVICE_TOKEN = token; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 01c8d90b..4d843141 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1042,6 +1042,9 @@ String get ICDName => localizedValues['referralStatus'][locale.languageCode]; String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + + String get patientName => + localizedValues['patient-name'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index fb8276c8..aaaa4e81 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -35,14 +35,7 @@ class PatientReferralItemWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Center( - child: AppText( - patientName != null ? "${patientName}" : "", - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), + if (referralStatus != null) Row( children: [ @@ -107,7 +100,7 @@ class PatientReferralItemWidget extends StatelessWidget { child: AppText( referralDoctorName != null ? "${TranslationBase.of(context).dr} $referralDoctorName" - : "", + : "-", color: Colors.black, fontWeight: FontWeight.bold, fontSize: 12, @@ -135,6 +128,22 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).patientName}: ", + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + patientName??'-', + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + ], + ), SizedBox( height: 8, ), diff --git a/pubspec.lock b/pubspec.lock index d49ad4a1..e6bd04c0 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -183,6 +183,27 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0-nullsafety.1" + cloud_firestore: + dependency: "direct main" + description: + name: cloud_firestore + url: "https://pub.dartlang.org" + source: hosted + version: "0.14.3" + cloud_firestore_platform_interface: + dependency: transitive + description: + name: cloud_firestore_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + cloud_firestore_web: + dependency: transitive + description: + name: cloud_firestore_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.2.1" code_builder: dependency: transitive description: @@ -323,27 +344,76 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.2.1" - firebase_core: + firebase: + dependency: transitive + description: + name: firebase + url: "https://pub.dartlang.org" + source: hosted + version: "7.3.3" + firebase_analytics: + dependency: "direct main" + description: + name: firebase_analytics + url: "https://pub.dartlang.org" + source: hosted + version: "6.2.0" + firebase_analytics_platform_interface: + dependency: transitive + description: + name: firebase_analytics_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.3" + firebase_analytics_web: dependency: transitive + description: + name: firebase_analytics_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.1" + firebase_auth: + dependency: "direct main" + description: + name: firebase_auth + url: "https://pub.dartlang.org" + source: hosted + version: "0.18.3" + firebase_auth_platform_interface: + dependency: transitive + description: + name: firebase_auth_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.3" + firebase_auth_web: + dependency: "direct main" + description: + name: firebase_auth_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.2" + firebase_core: + dependency: "direct main" description: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.3" + version: "0.5.2" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.1.0" + version: "2.0.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1+1" + version: "0.2.1" firebase_messaging: dependency: "direct main" description: @@ -351,6 +421,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.0.3" + firebase_storage: + dependency: "direct main" + description: + name: firebase_storage + url: "https://pub.dartlang.org" + source: hosted + version: "5.0.1" + firebase_storage_platform_interface: + dependency: transitive + description: + name: firebase_storage_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 887ac913..3b7ab800 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,8 +62,14 @@ dependencies: #chart fl_chart: ^0.12.1 - #firebase - firebase_messaging: ^7.0.0 + # Firebase + firebase_core: ^0.5.2 + firebase_analytics: ^6.2.0 + firebase_auth: 0.18.3 + firebase_auth_web: ^0.3.2 + firebase_storage: ^5.0.1 + firebase_messaging: ^7.0.3 + cloud_firestore: ^0.14.3 #GIF image flutter_gifimage: ^1.0.1 From 6820e2d0974759dbee6ce29a4bfd7a3df826aa13 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 27 Jan 2021 12:56:03 +0200 Subject: [PATCH 230/421] remark fix in allergies --- .../subjective/update_allergies_widget.dart | 26 ++++++++++++++----- .../soap_update/update_assessment_page.dart | 12 +++++---- 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index df0cb683..14718f4c 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -120,13 +120,25 @@ class _UpdateAllergiesWidgetState extends State { ), Padding( padding: const EdgeInsets.symmetric(vertical: 8), - child: Container( - width: MediaQuery.of(context).size.width * 0.6, - child: AppText( - selectedAllergy.remark ?? '', - fontSize: 10, - color: Colors.grey, - ), + child: Row( + children: [ + AppText( + selectedAllergy.remark != null || + selectedAllergy.remark == '' + ? TranslationBase.of(context).remarks + " : " + : '', + fontWeight: FontWeight.bold, + fontSize: 13, + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + child: AppText( + selectedAllergy.remark ?? '', + fontSize: 10, + color: Colors.grey, + ), + ), + ], ), ), DividerWithSpacesAround() diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 61bf27f3..9c8eaf63 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -342,11 +342,13 @@ class _UpdateAssessmentPageState extends State { height: 6, ), AppText( - TranslationBase.of(context).remarks + " : ", - fontWeight: FontWeight - .bold, - fontSize: 13, - ), + assessment.remark != null || + assessment.remark == '' + ? TranslationBase.of(context).remarks + " : " + : '', + fontWeight: FontWeight.bold, + fontSize: 13, + ), Container( width: MediaQuery .of(context) From 7b914dab331dad0d8c9985c1bd4eae022159d28e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 27 Jan 2021 13:07:26 +0200 Subject: [PATCH 231/421] fix android --- android/app/build.gradle | 8 ++-- pubspec.lock | 86 +--------------------------------------- pubspec.yaml | 9 +---- 3 files changed, 7 insertions(+), 96 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index da345fc2..af0821ee 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" android { - compileSdkVersion 29 + compileSdkVersion 30 sourceSets { main.java.srcDirs += 'src/main/kotlin' @@ -40,7 +40,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.example.doctor_app_flutter" minSdkVersion 18 - targetSdkVersion 29 + targetSdkVersion 30 versionCode flutterVersionCode.toInteger() versionName flutterVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" @@ -73,10 +73,10 @@ dependencies { implementation 'com.opentok.android:opentok-android-sdk:2.16.5' //permissions implementation 'pub.devrel:easypermissions:0.4.0' -implementation 'com.google.firebase:firebase-core:9.6.1' //retrofit implementation 'com.squareup.retrofit2:retrofit:2.6.2' implementation 'com.squareup.retrofit2:converter-gson:2.6.2' implementation 'com.squareup.okhttp3:logging-interceptor:3.14.1' - apply plugin: 'com.google.gms.google-services' + } +apply plugin: 'com.google.gms.google-services' \ No newline at end of file diff --git a/pubspec.lock b/pubspec.lock index e6bd04c0..8a1531c1 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -183,27 +183,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0-nullsafety.1" - cloud_firestore: - dependency: "direct main" - description: - name: cloud_firestore - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.3" - cloud_firestore_platform_interface: - dependency: transitive - description: - name: cloud_firestore_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.2.0" - cloud_firestore_web: - dependency: transitive - description: - name: cloud_firestore_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.1" code_builder: dependency: transitive description: @@ -344,57 +323,8 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "5.2.1" - firebase: - dependency: transitive - description: - name: firebase - url: "https://pub.dartlang.org" - source: hosted - version: "7.3.3" - firebase_analytics: - dependency: "direct main" - description: - name: firebase_analytics - url: "https://pub.dartlang.org" - source: hosted - version: "6.2.0" - firebase_analytics_platform_interface: - dependency: transitive - description: - name: firebase_analytics_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" - firebase_analytics_web: - dependency: transitive - description: - name: firebase_analytics_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.1" - firebase_auth: - dependency: "direct main" - description: - name: firebase_auth - url: "https://pub.dartlang.org" - source: hosted - version: "0.18.3" - firebase_auth_platform_interface: - dependency: transitive - description: - name: firebase_auth_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.3" - firebase_auth_web: - dependency: "direct main" - description: - name: firebase_auth_web - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.2" firebase_core: - dependency: "direct main" + dependency: transitive description: name: firebase_core url: "https://pub.dartlang.org" @@ -421,20 +351,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.0.3" - firebase_storage: - dependency: "direct main" - description: - name: firebase_storage - url: "https://pub.dartlang.org" - source: hosted - version: "5.0.1" - firebase_storage_platform_interface: - dependency: transitive - description: - name: firebase_storage_platform_interface - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" fixnum: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 3b7ab800..1e0b6734 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -62,14 +62,9 @@ dependencies: #chart fl_chart: ^0.12.1 - # Firebase - firebase_core: ^0.5.2 - firebase_analytics: ^6.2.0 - firebase_auth: 0.18.3 - firebase_auth_web: ^0.3.2 - firebase_storage: ^5.0.1 + # Firebase firebase_messaging: ^7.0.3 - cloud_firestore: ^0.14.3 + #GIF image flutter_gifimage: ^1.0.1 From 6b0e87ce55210055c6695b6ddb61811cc8d76363 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 27 Jan 2021 13:18:51 +0200 Subject: [PATCH 232/421] bugs fix --- .../medical-file/medical_file_page.dart | 4 + .../entity_list_checkbox_search_widget.dart | 81 +++++++++++-------- lib/screens/procedures/procedure_screen.dart | 9 +-- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index a5fab36e..c4553c07 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -34,6 +34,10 @@ class _MedicalFilePageState extends State { child: SingleChildScrollView( child: Container( child: Column( + // mainAxisAlignment: model.medicalFileList.length != 0 && + // model.medicalFileList != null + // ? MainAxisAlignment.start + // : MainAxisAlignment.center, children: [ PatientPageHeaderWidget(patient), Divider( diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 4f236a4b..7036bc0d 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -5,6 +5,7 @@ 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/TextFields.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; @@ -71,43 +72,53 @@ class _EntityListCheckboxSearchWidgetState SizedBox( height: 15, ), - Column( - children: items.map((historyInfo) { - return Column( - children: [ - Row( - children: [ - Checkbox( - value: widget - .isEntityListSelected(historyInfo), - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget.removeHistory(historyInfo); - } else { - widget.addHistory(historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts(historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), + items.length != 0 + ? Column( + children: items.map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: widget.isEntityListSelected( + historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget.isEntityListSelected( + historyInfo)) { + widget + .removeHistory(historyInfo); + } else { + widget.addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts( + historyInfo.procedureName, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], ), - ), - ], + DividerWithSpacesAround(), + ], + ); + }).toList(), + ) + : Center( + child: Container( + child: AppText( + "There's no procedures for this category", + color: Color(0xFFB9382C)), ), - DividerWithSpacesAround(), - ], - ); - }).toList(), - ), + ) ], ), )), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 05850316..d6d38a54 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -438,11 +438,10 @@ class _ProcedureScreenState extends State { 0.10, child: AppText( - model - .procedureList[0] - .entityList[index] - .remarks - .toString(), + model.procedureList[0].entityList[index].remarks != + null + ? model.procedureList[0].entityList[index].remarks.toString() + : "", fontSize: 11.5, ), From c2df29102917555134b2db7d65769088465162d2 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 28 Jan 2021 09:18:49 +0200 Subject: [PATCH 233/421] DA - 286 Fix --- lib/config/localized_values.dart | 9 +++- .../viewModel/patient-referral-viewmodel.dart | 50 +++++++++++++------ .../referral/my-referral-detail-screen.dart | 2 +- .../referral/referred-patient-screen.dart | 2 +- lib/util/translations_delegate_base.dart | 5 ++ .../patient-referral-item-widget.dart | 23 +++++---- pubspec.lock | 16 +++--- 7 files changed, 71 insertions(+), 36 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 06aadac0..6b6b6939 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -686,6 +686,11 @@ const Map> localizedValues = { 'months': {'en': "Months", 'ar': "أشهر"}, 'years': {'en': "Years", 'ar': "سنين"}, 'hr': {'en': "HR", 'ar': "س"}, - 'min': {'en': "Min", 'ar': "د"} - // 'icd': {'en': "ICD", 'ar': " "} + 'min': {'en': "Min", 'ar': "د"}, + 'referralStatusHold': {'en': "Hold", 'ar': "معلق"}, + 'referralStatusActive': {'en': "Active", 'ar': "نشط"}, + 'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"}, + 'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"}, + 'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"}, + // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index b9987601..5771d1db 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:flutter/cupertino.dart'; import '../../locator.dart'; @@ -40,8 +42,8 @@ class PatientReferralViewModel extends BaseViewModel { error = _referralPatientService.error; setState(ViewState.Error); } else { - if(patientReferral.length == 0){ - await getMasterLookup(MasterKeysService.physiotherapyGoals); + if (patientReferral.length == 0) { + await getMasterLookup(MasterKeysService.physiotherapyGoals); } else { setState(ViewState.Idle); } @@ -126,7 +128,8 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future responseReferral(PendingReferral pendingReferral, bool isAccepted) async { + Future responseReferral( + PendingReferral pendingReferral, bool isAccepted) async { setState(ViewState.Busy); await _referralPatientService.responseReferral(pendingReferral, isAccepted); if (_referralPatientService.hasError) { @@ -136,14 +139,11 @@ class PatientReferralViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future makeReferral(PatiantInformtion patient, - String isoStringDate, - int projectID, - int clinicID, - int doctorID, - String remarks) async { + Future makeReferral(PatiantInformtion patient, String isoStringDate, + int projectID, int clinicID, int doctorID, String remarks) async { setState(ViewState.Busy); - await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks); + await _referralPatientService.makeReferral( + patient, isoStringDate, projectID, clinicID, doctorID, remarks); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); @@ -152,18 +152,40 @@ class PatientReferralViewModel extends BaseViewModel { } } - Future getPatientDetails(String fromDate, String toDate, int patientMrn, int appointmentNo) async { + Future getPatientDetails( + String fromDate, String toDate, int patientMrn, int appointmentNo) async { setState(ViewState.Busy); - await _referralPatientService.getPatientArrivalList(toDate, fromDate: fromDate, patientMrn: patientMrn, appointmentNo: appointmentNo); + await _referralPatientService.getPatientArrivalList(toDate, + fromDate: fromDate, + patientMrn: patientMrn, + appointmentNo: appointmentNo); if (_referralPatientService.hasError) { - error = _referralPatientService.error; - setState(ViewState.Error); + error = _referralPatientService.error; + setState(ViewState.Error); } else { setState(ViewState.Idle); } } + /* * model .getPatientArrivalList()*/ + + String getReferralStatusNameByCode(int statusCode, BuildContext context) { + switch (statusCode) { + case 1: + return TranslationBase.of(context).referralStatusHold; + case 2: + return TranslationBase.of(context).referralStatusActive; + case 4: + return TranslationBase.of(context).referralStatusCancelled; + case 46: + return TranslationBase.of(context).referralStatusCompleted; + case 63: + return TranslationBase.of(context).referralStatusNotSeen; + default: + return "-"; + } + } } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 9d3c9f00..b76df591 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -42,7 +42,7 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: model.patientArrivalList != null + body: model.patientArrivalList != null && model.patientArrivalList.length > 0 ? Column( children: [ Expanded( diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index c1880908..4dc0e647 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -48,7 +48,7 @@ class ReferredPatientScreen extends StatelessWidget { patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", referralStatus: - "${model.getReferredPatientItem(index).referralStatus}", + "${model.getReferralStatusNameByCode(model.getReferredPatientItem(index).referralStatus, context)}", isReferredTo: true, isSameBranch: model .getReferredPatientItem(index) diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index fe2526bc..71409538 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1060,6 +1060,11 @@ String get ICDName => String get min => localizedValues['min'][locale.languageCode]; String get months => localizedValues['months'][locale.languageCode]; String get years => localizedValues['years'][locale.languageCode]; + String get referralStatusHold => localizedValues['referralStatusHold'][locale.languageCode]; + String get referralStatusActive => localizedValues['referralStatusActive'][locale.languageCode]; + String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; + String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; + String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index aaaa4e81..db45a015 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -70,7 +70,7 @@ class PatientReferralItemWidget extends StatelessWidget { isReferredTo ? "${TranslationBase.of(context).referTo}: " : "${TranslationBase.of(context).referredFrom}: ", - color: Colors.black, + color: Colors.grey, fontWeight: FontWeight.bold, fontSize: 12, ), @@ -78,8 +78,8 @@ class PatientReferralItemWidget extends StatelessWidget { isSameBranch ? TranslationBase.of(context).sameBranch : TranslationBase.of(context).otherBranch, - color: Colors.grey, - fontWeight: FontWeight.normal, + color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 12, ), ], @@ -116,23 +116,26 @@ class PatientReferralItemWidget extends StatelessWidget { children: [ AppText( "${TranslationBase.of(context).clinic}: ", - color: Colors.black, + color: Colors.grey, fontWeight: FontWeight.bold, fontSize: 12, ), AppText( clinicDescription, - color: Colors.grey, - fontWeight: FontWeight.normal, + color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 12, ), ], ), + SizedBox( + height: 8, + ), Row( children: [ AppText( "${TranslationBase.of(context).patientName}: ", - color: Colors.black, + color: Colors.grey, fontWeight: FontWeight.bold, fontSize: 12, ), @@ -140,7 +143,7 @@ class PatientReferralItemWidget extends StatelessWidget { patientName??'-', color: Colors.black, fontWeight: FontWeight.bold, - fontSize: 16, + fontSize: 12, ), ], ), @@ -157,8 +160,8 @@ class PatientReferralItemWidget extends StatelessWidget { ), AppText( remark, - color: Colors.grey, - fontWeight: FontWeight.normal, + color: Colors.black, + fontWeight: FontWeight.bold, fontSize: 12, ), ], diff --git a/pubspec.lock b/pubspec.lock index 8a1531c1..e51c9489 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -105,7 +105,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.13" + version: "1.11.0" build_runner_core: dependency: transitive description: @@ -329,21 +329,21 @@ packages: name: firebase_core url: "https://pub.dartlang.org" source: hosted - version: "0.5.2" + version: "0.5.3" firebase_core_platform_interface: dependency: transitive description: name: firebase_core_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.0" + version: "2.1.0" firebase_core_web: dependency: transitive description: name: firebase_core_web url: "https://pub.dartlang.org" source: hosted - version: "0.2.1" + version: "0.2.1+1" firebase_messaging: dependency: "direct main" description: @@ -510,7 +510,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -706,7 +706,7 @@ packages: name: provider url: "https://pub.dartlang.org" source: hosted - version: "4.3.2+4" + version: "4.3.3" pub_semver: dependency: transitive description: @@ -776,7 +776,7 @@ packages: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.1+3" + version: "0.0.2+2" shelf: dependency: transitive description: @@ -935,7 +935,7 @@ packages: name: web_socket_channel url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.2.0" win32: dependency: transitive description: From b9b5ec09e45f1667504438096afb7b06c6c95d45 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 28 Jan 2021 09:54:03 +0200 Subject: [PATCH 234/421] fix : DA-248 --- .../patients/profile/profile_medical_info_widget.dart | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index e839a0b9..b5b60619 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -8,7 +8,6 @@ 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/shared/dr_app_circular_progress_Indeicator.dart'; -import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -140,14 +139,6 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - if (selectedPatientType != 0 && selectedPatientType != 5) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ORDERS, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).list, - icon: 'radiology-1.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, From a64088320f26ac823947160ca82c1d28f6da2ea9 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 28 Jan 2021 10:33:12 +0200 Subject: [PATCH 235/421] DA-259 translation bug --- lib/config/localized_values.dart | 1 + .../patients/profile/referral/referred-patient-screen.dart | 2 +- lib/util/translations_delegate_base.dart | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6b6b6939..47e7ab39 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -52,6 +52,7 @@ const Map> localizedValues = { 'referPatient': {'en': 'Referral Patient', 'ar': 'إحالة مريض'}, 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, + 'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, 'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'}, diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 4dc0e647..a842e6ae 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -14,7 +14,7 @@ class ReferredPatientScreen extends StatelessWidget { onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).referPatient, + appBarTitle: TranslationBase.of(context).referredPatient, body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 71409538..77937a32 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -117,6 +117,8 @@ class TranslationBase { String get myReferredPatient => localizedValues['myReferredPatient'][locale.languageCode]; + String get referredPatient => + localizedValues['referredPatient'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; From b267342c038841a792e460763ef01dd45994887a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 28 Jan 2021 15:29:09 +0200 Subject: [PATCH 236/421] fixing issues --- .../prescription/prescription_screen.dart | 59 +- .../procedures/add-procedure-form.dart | 323 +++++++++++ lib/screens/procedures/procedure_screen.dart | 522 +----------------- lib/screens/procedures/update-procedure.dart | 209 +++++++ 4 files changed, 564 insertions(+), 549 deletions(-) create mode 100644 lib/screens/procedures/add-procedure-form.dart create mode 100644 lib/screens/procedures/update-procedure.dart diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 2b71ab8e..3dfd5bdc 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -11,6 +11,7 @@ import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.da import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; @@ -248,61 +249,7 @@ class _NewPrescriptionScreenState extends State { child: Container( child: Column( children: [ - Padding( - padding: EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + - ' ' + - patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - //if (model.prescriptionList.length > 0) - Row( - children: [ - AppText( - TranslationBase.of(context).age2, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 5.0, - ), - AppText( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], - ) - ], - ), - ), + PatientPageHeaderWidget(patient), Divider( height: 1.0, thickness: 1.0, @@ -489,7 +436,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.295, + 0.3019, width: MediaQuery.of( context) .size diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart new file mode 100644 index 00000000..81452c63 --- /dev/null +++ b/lib/screens/procedures/add-procedure-form.dart @@ -0,0 +1,323 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +import 'entity_list_checkbox_search_widget.dart'; + +postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + List controls = List(); + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + entityList.forEach((element) { + controls.add( + Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), + ); + controls.add( + Controls( + code: "ordertype", + controlValue: + orderType.toString().isNotEmpty ? orderType.toString() : '1'), + ); + }); + + entityList.forEach((element) { + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + postProcedureReqModel.procedures = controlsProcedure; + + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } +} + +void addSelectedProcedure( + context, ProcedureViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return AddSelectedProcedure( + model: model, + patient: patient, + ); + }); +} + +class AddSelectedProcedure extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + + const AddSelectedProcedure({Key key, this.model, this.patient}) + : super(key: key); + @override + _AddSelectedProcedureState createState() => + _AddSelectedProcedureState(patient: patient, model: model); +} + +class _AddSelectedProcedureState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedProcedureState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + dynamic selectedCategory; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getCategory(), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .selectProcedures + .toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 10.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + model.categoryList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.categoryList, + attributeName: 'categoryName', + attributeValueId: 'categoryId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + selectedCategory = selectedValue; + model.getProcedureCategory( + categoryName: selectedCategory[ + 'categoryName']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + //model.getProcedureCategory(); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .procedureCategorise, + selectedCategory != null + ? selectedCategory['categoryName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ), + ), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + child: Row( + children: [ + AppText( + TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 1, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 0, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + ], + ), + ), + SizedBox( + height: 15.0, + ), + TextFields( + hintText: TranslationBase.of(context).remarks, + controller: remarksController, + minLines: 3, + maxLines: 5, + ), + SizedBox( + height: 50.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addSelectedProcedures, + onPressed: () { + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index d6d38a54..9fb8510c 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -11,10 +11,13 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/screens/procedures/add-procedure-form.dart'; import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; +import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -58,57 +61,7 @@ class _ProcedureScreenState extends State { child: Container( child: Column( children: [ - Padding( - padding: EdgeInsets.all(12.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.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( - patient.age.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - AppText( - "ALLERGIC TO: FOOD, ASPIRIN", - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ), - ], - ) - ], - ), - ), + PatientPageHeaderWidget(patient), Divider( height: 1.0, thickness: 1.0, @@ -320,7 +273,7 @@ class _ProcedureScreenState extends State { context) .size .height * - 0.2, + 0.21, width: MediaQuery.of( context) .size @@ -376,6 +329,30 @@ class _ProcedureScreenState extends State { ), ], ), + Row( + children: [ + AppText( + 'Order.NO' + + " : ", + fontWeight: + FontWeight + .w700, + fontSize: + 15.0, + ), + AppText( + model + .procedureList[ + 0] + .entityList[ + index] + .orderNo + .toString(), + fontSize: + 13.0, + ), + ], + ), Row( children: [ Container( @@ -580,445 +557,4 @@ class _ProcedureScreenState extends State { )), ); } - - void updateProcedureForm(context, - {String procedureName, - PatiantInformtion patient, - String procedureId, - String remarks, - String categoreId}) { - ProcedureViewModel model = ProcedureViewModel(); - TextEditingController remarksController = TextEditingController(); - TextEditingController orderController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return Container( - height: MediaQuery.of(context).size.height * 0.55, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - child: Row( - children: [ - AppText(TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).regular), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: remarks, - controller: remarksController, - maxLines: 5, - minLines: 3, - ), - ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), - onPressed: () { - Navigator.pop(context); - updateProcedure( - categorieId: categoreId, - procedureId: procedureId, - patient: patient, - model: model, - remarks: remarksController.text); - // authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )); - }); - } -} - -postProcedure( - {ProcedureViewModel model, - String remarks, - PatiantInformtion patient, - List entityList}) async { - PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - List controls = List(); - List controlsProcedure = List(); - - postProcedureReqModel.appointmentNo = patient.appointmentNo; - - postProcedureReqModel.episodeID = patient.episodeNo; - postProcedureReqModel.patientMRN = patient.patientMRN; - entityList.forEach((element) { - controls.add( - Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), - ); - }); - - entityList.forEach((element) { - controlsProcedure.add(Procedures( - category: element.categoryID, - procedure: element.procedureId, - controls: controls)); - }); - postProcedureReqModel.procedures = controlsProcedure; - - await model.postProcedure(postProcedureReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); - } -} - -updateProcedure( - {ProcedureViewModel model, - String remarks, - String procedureId, - PatiantInformtion patient, - String categorieId}) async { - UpdateProcedureRequestModel updateProcedureReqModel = - new UpdateProcedureRequestModel(); - List controls = List(); - ProcedureDetail controlsProcedure = new ProcedureDetail(); - - updateProcedureReqModel.appointmentNo = patient.appointmentNo; - - updateProcedureReqModel.episodeID = patient.episodeNo; - updateProcedureReqModel.patientMRN = patient.patientMRN; - updateProcedureReqModel.lineItemNo = 1; - updateProcedureReqModel.orderNo = 0; - - controls.add( - Controls(code: "02", controlValue: remarks.isEmpty ? '' : remarks), - ); - - controlsProcedure.procedure = procedureId; - controlsProcedure.category = categorieId; - controlsProcedure.controls = controls; - - // controlsProcedure.add(ProcedureDetail( - // category: categorieId, procedure: procedureId, controls: controls)); - updateProcedureReqModel.procedureDetail = controlsProcedure; - - await model.updateProcedure( - updateProcedureRequestModel: updateProcedureReqModel, - mrn: patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been updated'); - } -} - -void addSelectedProcedure( - context, ProcedureViewModel model, PatiantInformtion patient) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext bc) { - return AddSelectedProcedure( - model: model, - patient: patient, - ); - }); -} - -class AddSelectedProcedure extends StatefulWidget { - final ProcedureViewModel model; - final PatiantInformtion patient; - - const AddSelectedProcedure({Key key, this.model, this.patient}) - : super(key: key); - @override - _AddSelectedProcedureState createState() => - _AddSelectedProcedureState(patient: patient, model: model); -} - -class _AddSelectedProcedureState extends State { - int selectedType; - ProcedureViewModel model; - PatiantInformtion patient; - _AddSelectedProcedureState({this.patient, this.model}); - TextEditingController procedureController = TextEditingController(); - TextEditingController remarksController = TextEditingController(); - List entityList = List(); - dynamic selectedCategory; - setSelectedType(int val) { - setState(() { - selectedType = val; - }); - } - - @override - Widget build(BuildContext context) { - final screenSize = MediaQuery.of(context).size; - return BaseView( - onModelReady: (model) => model.getCategory(), - builder: (BuildContext context, ProcedureViewModel model, Widget child) => - NetworkBaseView( - baseViewModel: model, - child: DraggableScrollableSheet( - minChildSize: 0.90, - initialChildSize: 0.95, - maxChildSize: 1.0, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: MediaQuery.of(context).size.height * 1.20, - child: Padding( - padding: EdgeInsets.all(12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .selectProcedures - .toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName']); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .procedureCategorise, - selectedCategory != null - ? selectedCategory['categoryName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ), - ), - SizedBox( - height: 15.0, - ), - Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).regular), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], - ), - ), - SizedBox( - height: 15.0, - ), - TextFields( - hintText: TranslationBase.of(context).remarks, - controller: remarksController, - minLines: 3, - maxLines: 5, - ), - SizedBox( - height: 50.0, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addSelectedProcedures, - onPressed: () { - Navigator.pop(context); - postProcedure( - entityList: entityList, - patient: patient, - model: widget.model, - remarks: remarksController.text); - }, - ), - ], - ), - ), - ], - ) - ], - ), - ), - ), - ); - }), - ), - ); - } - - bool isEntityListSelected(EntityList masterKey) { - Iterable history = entityList - .where((element) => masterKey.procedureId == element.procedureId); - if (history.length > 0) { - return true; - } - return false; - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } } diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart new file mode 100644 index 00000000..0b0a0c5a --- /dev/null +++ b/lib/screens/procedures/update-procedure.dart @@ -0,0 +1,209 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/shared/TextFields.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:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +void updateProcedureForm(context, + {String procedureName, + PatiantInformtion patient, + String orderType, + String procedureId, + String remarks, + String categoreId}) { + ProcedureViewModel model = ProcedureViewModel(); + TextEditingController remarksController = TextEditingController(); + TextEditingController orderController = TextEditingController(); + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return UpdateProcedureWidget( + procedureName: procedureName, + remarks: remarks, + remarksController: remarksController, + patient: patient, + model: model, + procedureId: procedureId, + categoryId: categoreId, + ); + }); +} + +class UpdateProcedureWidget extends StatefulWidget { + final PatiantInformtion patient; + final ProcedureViewModel model; + final String procedureName; + final String remarks; + final TextEditingController remarksController; + final String procedureId; + final String categoryId; + + UpdateProcedureWidget( + {this.model, + this.procedureName, + this.remarks, + this.remarksController, + this.patient, + this.procedureId, + this.categoryId}); + @override + _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); +} + +class _UpdateProcedureWidgetState extends State { + int selectedType = 0; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + return StatefulBuilder(builder: + (BuildContext context, StateSetter setState /*You can rename this!*/) { + return Container( + height: MediaQuery.of(context).size.height * 0.55, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.0)), + border: + Border.all(width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + controller: widget.remarksController, + maxLines: 5, + minLines: 3, + ), + ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + Navigator.pop(context); + updateProcedure( + orderType: selectedType.toString(), + categorieId: widget.categoryId, + procedureId: widget.procedureId, + patient: widget.patient, + model: widget.model, + remarks: widget.remarksController.text); + // authorizationForm(context); + }, + ), + ], + ), + ), + ], + ), + ), + )); + }); + } + + updateProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + String procedureId, + PatiantInformtion patient, + String categorieId}) async { + UpdateProcedureRequestModel updateProcedureReqModel = + new UpdateProcedureRequestModel(); + List controls = List(); + ProcedureDetail controlsProcedure = new ProcedureDetail(); + + updateProcedureReqModel.appointmentNo = patient.appointmentNo; + + updateProcedureReqModel.episodeID = patient.episodeNo; + updateProcedureReqModel.patientMRN = patient.patientMRN; + updateProcedureReqModel.lineItemNo = 1; + updateProcedureReqModel.orderNo = 0; + + controls.add( + Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), + ); + controls.add( + Controls(code: "ordertype", controlValue: "1"), + ); + + controlsProcedure.procedure = procedureId; + controlsProcedure.category = categorieId; + controlsProcedure.controls = controls; + + // controlsProcedure.add(ProcedureDetail( + // category: categorieId, procedure: procedureId, controls: controls)); + updateProcedureReqModel.procedureDetail = controlsProcedure; + + await model.updateProcedure( + updateProcedureRequestModel: updateProcedureReqModel, + mrn: patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been updated'); + } + } +} From de1d0283d234bd5a7c371ac7daad4bcda4624237 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 28 Jan 2021 15:47:08 +0200 Subject: [PATCH 237/421] some lables and translation changes and add search functionality for ListSelectDialog --- lib/config/localized_values.dart | 3 + .../referral/my-referral-detail-screen.dart | 15 ++-- .../referral/my-referral-patient-screen.dart | 14 ++-- .../referral/refer-patient-screen.dart | 73 ++++--------------- .../referral/referred-patient-screen.dart | 8 ++ lib/util/translations_delegate_base.dart | 4 + .../patient-referral-item-widget.dart | 47 +++++++++++- .../shared/dialogs/dailog-list-select.dart | 65 ++++++++++++++--- 8 files changed, 147 insertions(+), 82 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 47e7ab39..23132079 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -53,6 +53,7 @@ const Map> localizedValues = { 'myReferral': {'en': 'My Referral', 'ar': 'إحالة'}, 'myReferredPatient': {'en': 'My Referred Patient', 'ar': 'مرضاي المحالين'}, 'referredPatient': {'en': 'Referred Patient', 'ar': 'المرضى المحالين'}, + 'referredOn': {'en': 'referred On : ', 'ar': ' : تمت الإحالة في'}, 'firstName': {'en': 'First Name', 'ar': 'الاسم الاول'}, 'middleName': {'en': 'Middle Name', 'ar': 'اسم الاب'}, 'lastName': {'en': 'Last Name', 'ar': 'اسم العائلة'}, @@ -693,5 +694,7 @@ const Map> localizedValues = { 'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"}, 'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"}, 'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"}, + 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, + 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index b76df591..433fe232 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -42,7 +42,8 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: model.patientArrivalList != null && model.patientArrivalList.length > 0 + body: model.patientArrivalList != null && + model.patientArrivalList.length > 0 ? Column( children: [ Expanded( @@ -77,6 +78,7 @@ class MyReferralDetailScreen extends StatelessWidget { ), ), PatientReferralItemWidget( + "${pendingReferral.patientID}", patientName: pendingReferral.patientName, referralStatus: null, isReferredTo: false, @@ -86,6 +88,7 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral.referredByDoctorInfo, clinicDescription: null, remark: pendingReferral.remarksFromSource, + referredOn: pendingReferral.referredOn, ), SizedBox( child: GridView.count( @@ -147,8 +150,9 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, handler: () async { - await model.responseReferral(pendingReferral, true); - if(model.state == ViewState.ErrorLocal){ + await model.responseReferral( + pendingReferral, true); + if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } }, @@ -166,8 +170,9 @@ class MyReferralDetailScreen extends StatelessWidget { hPadding: 8, vPadding: 12, handler: () async { - await model.responseReferral(pendingReferral, true); - if(model.state == ViewState.ErrorLocal){ + await model.responseReferral( + pendingReferral, true); + if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); } }, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 311e2f12..ab2beaf8 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,8 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, - body: model.pendingReferral == null || - model.pendingReferral.length == 0 + body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( child: AppText( TranslationBase.of(context).referralEmptyMsg, @@ -62,6 +61,7 @@ class MyReferralPatientScreen extends StatelessWidget { ...List.generate( model.pendingReferral.length, (index) => PatientReferralItemWidget( + "${model.pendingReferral[index].patientID}", patientName: model.pendingReferral[index].patientName, referralStatus: null, isReferredTo: false, @@ -72,13 +72,13 @@ class MyReferralPatientScreen extends StatelessWidget { clinicDescription: null, remark: model.pendingReferral[index].remarksFromSource, + referredOn: model.pendingReferral[index].referredOn, infoIcon: InkWell( onTap: () { - Navigator.of(context).pushNamed( - MY_REFERRAL_DETAIL, - arguments: { - 'referral': model.pendingReferral[index] - }); + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: { + 'referral': model.pendingReferral[index] + }); }, child: Icon( Icons.info_outline, diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 04eba96e..a3d74430 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -1,17 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; -import 'package:doctor_app_flutter/models/patient/PatientArrivalEntity.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/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_loader_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/dialogs/dailog-list-select.dart'; @@ -20,8 +17,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; -import '../../../QR_reader_screen.dart'; - class PatientMakeReferralScreen extends StatefulWidget { // previous design page is: ReferPatientScreen @override @@ -96,6 +91,7 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? ReferralForm(model, screenSize) : PatientReferralItemWidget( + "${model.patientReferral[0].patientID}", patientName: model.patientReferral[0].patientName, referralStatus: "${model.patientReferral[0].referralStatus}", @@ -105,7 +101,9 @@ class _PatientMakeReferralScreenState extends State { referralDoctorName: model.patientReferral[0].referredByDoctorInfo, clinicDescription: null, - remark: model.patientReferral[0].remarksFromSource), + remark: model.patientReferral[0].remarksFromSource, + referredOn: model.patientReferral[0].referredOn, + ), ], ), if (model.patientReferral.length == 0) @@ -201,7 +199,7 @@ class _PatientMakeReferralScreenState extends State { } : null, child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).referTo, _referTo != null ? _referTo['name'] : null, true), @@ -248,7 +246,7 @@ class _PatientMakeReferralScreenState extends State { } : null, child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).branch, _selectedBranch != null ? _selectedBranch['facilityName'] @@ -272,6 +270,8 @@ class _PatientMakeReferralScreenState extends State { list: model.clinicsList, attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -296,7 +296,7 @@ class _PatientMakeReferralScreenState extends State { } : null, child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).clinic, _selectedClinic != null ? _selectedClinic['ClinicDescription'] @@ -320,6 +320,8 @@ class _PatientMakeReferralScreenState extends State { list: model.doctorsList, attributeName: 'DoctorName', attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: TranslationBase.of(context).doctorSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -337,7 +339,7 @@ class _PatientMakeReferralScreenState extends State { } : null, child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).doctor, _selectedDoctor != null ? _selectedDoctor['DoctorName'] @@ -355,7 +357,7 @@ class _PatientMakeReferralScreenState extends State { child: InkWell( onTap: () => _selectDate(context, model), child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).chooseAppointment, appointmentDate != null ? "${DateUtils.convertDateToFormat(appointmentDate, "yyyy-MM-dd")}" @@ -374,7 +376,7 @@ class _PatientMakeReferralScreenState extends State { ), Container( child: TextField( - decoration: textFieldSelectorDecoration( + decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).remarks, null, false), enabled: true, controller: _remarksController, @@ -453,49 +455,4 @@ class _PatientMakeReferralScreenState extends State { });*/ } } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } - - BoxDecoration containerBorderDecoration( - Color containerColor, Color borderColor) { - return BoxDecoration( - color: containerColor, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.all(Radius.circular(6)), - border: Border.fromBorderSide(BorderSide( - color: borderColor, - width: 2.0, - )), - ); - } } diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index a842e6ae..323a9a9b 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -45,6 +46,7 @@ class ReferredPatientScreen extends StatelessWidget { ...List.generate( model.listMyReferredPatientModel.length, (index) => PatientReferralItemWidget( + "${model.getReferredPatientItem(index).patientId}", patientName: "${model.getReferredPatientItem(index).firstName} ${model.getReferredPatientItem(index).middleName} ${model.getReferredPatientItem(index).lastName}", referralStatus: @@ -62,6 +64,12 @@ class ReferredPatientScreen extends StatelessWidget { remark: model .getReferredPatientItem(index) .referringDoctorRemarks, + referredOn: model + .getReferredPatientItem(index) + .referralDate != + null + ? DateUtils.convertDateFromServerFormat(model.getReferredPatientItem(index).referralDate, "dd/MM/yyyy") + : null, ), ), ], diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 77937a32..4963484d 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -119,6 +119,8 @@ class TranslationBase { localizedValues['myReferredPatient'][locale.languageCode]; String get referredPatient => localizedValues['referredPatient'][locale.languageCode]; + String get referredOn => + localizedValues['referredOn'][locale.languageCode]; String get firstName => localizedValues['firstName'][locale.languageCode]; @@ -1067,6 +1069,8 @@ String get ICDName => String get referralStatusCancelled => localizedValues['referralStatusCancelled'][locale.languageCode]; String get referralStatusCompleted => localizedValues['referralStatusCompleted'][locale.languageCode]; String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; + String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; + String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index db45a015..ab89ab33 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -4,15 +4,18 @@ import 'package:flutter/material.dart'; class PatientReferralItemWidget extends StatelessWidget { final String patientName; + final String patientID; final String referralStatus; final isReferredTo; final isSameBranch; final String referralDoctorName; final String clinicDescription; final String remark; + final String referredOn; final Widget infoIcon; - PatientReferralItemWidget({ + PatientReferralItemWidget( + this.patientID, { this.patientName, this.referralStatus, this.isReferredTo = false, @@ -20,6 +23,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.referralDoctorName, this.clinicDescription, this.remark, + this.referredOn, this.infoIcon, }); @@ -35,7 +39,6 @@ class PatientReferralItemWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if (referralStatus != null) Row( children: [ @@ -131,6 +134,25 @@ class PatientReferralItemWidget extends StatelessWidget { SizedBox( height: 8, ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).patientID}: ", + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + patientID ?? '-', + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ], + ), + SizedBox( + height: 8, + ), Row( children: [ AppText( @@ -140,7 +162,7 @@ class PatientReferralItemWidget extends StatelessWidget { fontSize: 12, ), AppText( - patientName??'-', + patientName ?? '-', color: Colors.black, fontWeight: FontWeight.bold, fontSize: 12, @@ -166,6 +188,25 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), + SizedBox( + height: 8, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).referredOn, + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + referredOn ?? '-', + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ], + ), SizedBox( height: 16, ), diff --git a/lib/widgets/shared/dialogs/dailog-list-select.dart b/lib/widgets/shared/dialogs/dailog-list-select.dart index b6df1f6f..f972e790 100644 --- a/lib/widgets/shared/dialogs/dailog-list-select.dart +++ b/lib/widgets/shared/dialogs/dailog-list-select.dart @@ -2,6 +2,8 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; class ListSelectDialog extends StatefulWidget { @@ -12,24 +14,32 @@ class ListSelectDialog extends StatefulWidget { final Function(dynamic) okFunction; dynamic selectedValue; final Widget searchWidget; + final bool usingSearch; + final String hintSearchText; - ListSelectDialog( - {@required this.list, - @required this.attributeName, - @required this.attributeValueId, - @required this.okText, - @required this.okFunction, - this.searchWidget}); + ListSelectDialog({ + @required this.list, + @required this.attributeName, + @required this.attributeValueId, + @required this.okText, + @required this.okFunction, + this.searchWidget, + this.usingSearch = false, + this.hintSearchText, + }); @override _ListSelectDialogState createState() => _ListSelectDialogState(); } class _ListSelectDialogState extends State { + List items = List(); + @override void initState() { - super.initState(); widget.selectedValue = widget.selectedValue ?? widget.list[0]; + items.addAll(widget.list); + super.initState(); } @override @@ -69,7 +79,21 @@ class _ListSelectDialogState extends State { child: Column( children: [ if (widget.searchWidget != null) widget.searchWidget, - ...widget.list + if(widget.usingSearch) + Container( + height: MediaQuery.of(context).size.height * 0.070, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + widget.hintSearchText ?? TranslationBase + .of(context) + .search, null, false, suffixIcon: Icon(Icons.search,)), + enabled: true, + keyboardType: TextInputType.text, + onChanged: (value) { + filterSearchResults(value); + }, + )), + ...items .map((item) => RadioListTile( title: Text("${item[widget.attributeName].toString()}"), groupValue: widget.selectedValue[widget.attributeValueId] @@ -95,4 +119,27 @@ class _ListSelectDialogState extends State { static closeAlertDialog(BuildContext context) { Navigator.of(context).pop(); } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.list); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((item) { + if ("${item[widget.attributeName].toString()}".toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(item); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.list); + }); + } + } } From 34692b94c27a7557432724099ab96e340004ef8b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 28 Jan 2021 17:22:21 +0200 Subject: [PATCH 238/421] fix : DA-264 --- lib/config/localized_values.dart | 3 +- lib/util/translations_delegate_base.dart | 3 + .../subjective/update_allergies_widget.dart | 2 + .../subjective/update_subjective_page.dart | 26 +- .../soap_update/update_assessment_page.dart | 6 +- .../soap_update/update_objective_page.dart | 2 + .../profile/soap_update/update_plan_page.dart | 3 + lib/widgets/shared/TextFields.dart | 220 ++++++++++------ lib/widgets/shared/new_text_Field.dart | 239 ++++++++++++++++++ 9 files changed, 411 insertions(+), 93 deletions(-) create mode 100644 lib/widgets/shared/new_text_Field.dart diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 06aadac0..c045f330 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -686,6 +686,7 @@ const Map> localizedValues = { 'months': {'en': "Months", 'ar': "أشهر"}, 'years': {'en': "Years", 'ar': "سنين"}, 'hr': {'en': "HR", 'ar': "س"}, - 'min': {'en': "Min", 'ar': "د"} + 'min': {'en': "Min", 'ar': "د"}, + 'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"} // 'icd': {'en': "ICD", 'ar': " "} }; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index fe2526bc..a622a1b5 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1063,6 +1063,9 @@ String get ICDName => String get patientName => localizedValues['patient-name'][locale.languageCode]; + + String get appointmentNumber => + localizedValues['appointmentNumber'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 14718f4c..9e0e4e0e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -410,6 +410,8 @@ class _AddAllergiesState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( + hasLabelText: remarkController.text != ''?true:false, + showLabelText: true, hintText: TranslationBase.of(context).remarks, fontSize: 13.5, // hintColor: Colors.black, diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index f4ad30ab..95c4063e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -267,19 +267,21 @@ class _UpdateSubjectivePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: TranslationBase - .of(context) + hasLabelText: complaintsController.text != '' + ? true + : false, + hintText: TranslationBase.of(context) .addChiefComplaints, fontSize: 13.5, // hintColor: Colors.black, + showLabelText: true, fontWeight: FontWeight.w600, maxLines: 25, minLines: 13, controller: complaintsController, validator: (value) { if (value == null || value == "") - return TranslationBase - .of(context) + return TranslationBase.of(context) .emptyMessage; else if (value.length < 25) return TranslationBase @@ -296,6 +298,10 @@ class _UpdateSubjectivePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( + hasLabelText: illnessController.text != '' + ? true + : false, + showLabelText: true, hintText: TranslationBase .of(context) .historyOfPresentIllness, @@ -322,17 +328,23 @@ class _UpdateSubjectivePageState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: TranslationBase.of(context) + hasLabelText: medicationController.text != '' + ? true + : false, + showLabelText: true, + hintText: TranslationBase + .of(context) .currentMedications, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, - maxLines: 2, + maxLines: 23, minLines: 1, controller: medicationController, validator: (value) { if (value == null || value == "") - return TranslationBase.of(context) + return TranslationBase + .of(context) .emptyMessage; else return null; diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 9c8eaf63..542d4196 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -569,9 +569,11 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( - hintText: "Appointment Number", + hintText: TranslationBase.of(context).appointmentNumber, fontSize: 13.5, // hintColor: Colors.black, + hasLabelText: appointmentIdController.text != ''?true:false, + showLabelText: true, fontWeight: FontWeight.w600, readOnly: true, controller: appointmentIdController, @@ -735,6 +737,8 @@ class _AddAssessmentDetailsState extends State { fontWeight: FontWeight.w600, maxLines: 18, minLines: 5, + hasLabelText: remarkController.text != ''?true:false, + showLabelText: true, controller: remarkController, onChanged:(value) { widget.mySelectedAssessment.remark = remarkController.text; diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index adf1e3d2..93182207 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -319,6 +319,8 @@ class _UpdateObjectivePageState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( + hasLabelText: remarksController.text != ''?true:false, + showLabelText: true, hintText: TranslationBase.of(context).remarks, fontSize: 13.5, // hintColor: Colors.black, diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index 04b2b73d..e1388ef1 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -137,6 +137,7 @@ class _UpdatePlanPageState extends State { margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( + hintText: TranslationBase .of(context) .addProgressNote, @@ -361,6 +362,8 @@ class _UpdatePlanPageState extends State { margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: TextFields( + hasLabelText: progressNoteController.text != ''?true:false, + showLabelText: true, hintText: TranslationBase.of(context).addProgressNote, fontSize: 13.5, // hintColor: Colors.black, diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 20885eb3..8563bb41 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -74,7 +74,9 @@ class TextFields extends StatefulWidget { this.autoValidate = false, this.fillColor, this.hintColor, - this.onTapTextFields}) + this.hasBorder = true, + this.onTapTextFields, + this.hasLabelText = false, this.showLabelText= false}) : super(key: key); final String hintText; @@ -111,6 +113,9 @@ class TextFields extends StatefulWidget { final bool borderOnlyError; final Color hintColor; final Color fillColor; + final bool hasBorder; + final bool showLabelText; + bool hasLabelText; @override _TextFieldsState createState() => _TextFieldsState(); @@ -208,93 +213,140 @@ class _TextFieldsState extends State { offset: Offset(0.0, 13.0), blurRadius: focus ? 34.0 : 12.0) ]), - child: TextFormField( - onTap: widget.onTapTextFields, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - initialValue: widget.initialValue, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - counterText: "", - hintText: widget.hintText, - hintStyle: TextStyle( - fontSize: widget.fontSize, - fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme.of(context).hintColor, - ), - contentPadding: widget.padding != null - ? widget.padding - : EdgeInsets.symmetric( + child: Column( + children: [ + TextFormField( + onTap: widget.onTapTextFields, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + initialValue: widget.initialValue, + onChanged: (value){ + if(widget.showLabelText) { + if((value== null || value =='' )) { + setState(() { + widget.hasLabelText = false; + }); + }else{ + setState(() { + widget.hasLabelText = true; + }); + } + } + + + widget.onChanged(value); + } , + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + style: Theme.of(context) + .textTheme + .bodyText1 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hasLabelText ? widget.hintText : null, + labelStyle: TextStyle( + + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: widget.hintColor ?? Theme + .of(context) + .hintColor, + ), + counterText: "", + hintText: widget.hintText, + hintStyle: TextStyle( + fontSize: widget.fontSize, + fontWeight: widget.fontWeight, + color: widget.hintColor ?? Theme + .of(context) + .hintColor, + ), + contentPadding: widget.padding != null + ? widget.padding + : EdgeInsets.symmetric( vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, horizontal: 16.0), - filled: true, - fillColor: widget.bare - ? Colors.transparent - : Theme.of(context).backgroundColor, - suffixIcon: _buildSuffixIcon(), - prefixIcon: widget.prefixIcon, - errorStyle: TextStyle( - fontSize: 12.0, - fontWeight: widget.fontWeight, - height: widget.borderOnlyError ? 0.0 : null), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey, width: 1.0), - borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0), + filled: true, + fillColor: widget.bare + ? Colors.transparent + : Theme + .of(context) + .backgroundColor, + suffixIcon: _buildSuffixIcon(), + prefixIcon: widget.prefixIcon, + errorStyle: TextStyle( + fontSize: 12.0, + fontWeight: widget.fontWeight, + height: widget.borderOnlyError ? 0.0 : null), + errorBorder: OutlineInputBorder( + borderSide: widget.hasBorder ? BorderSide( + color: Theme + .of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) : BorderSide( + color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular( + widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + focusedErrorBorder: OutlineInputBorder( + borderSide: widget.hasBorder ? BorderSide( + color: Theme + .of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) : BorderSide( + color: Colors.transparent, width: 0), + borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), + focusedBorder: OutlineInputBorder( + borderSide: widget.hasBorder ? BorderSide( + color: Colors.grey, width: 1.0) : BorderSide( + color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular( + widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + disabledBorder: OutlineInputBorder( + borderSide: widget.hasBorder ? BorderSide( + color: Colors.grey, width: 1.0) : BorderSide( + color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular( + widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)), + enabledBorder: OutlineInputBorder( + borderSide: widget.hasBorder ? BorderSide( + color: Colors.grey, width: 1.0) : BorderSide( + color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder ? BorderRadius.circular( + widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0), + ), + ), ), - ), + ], ), + )); } } diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/new_text_Field.dart new file mode 100644 index 00000000..ad9eb580 --- /dev/null +++ b/lib/widgets/shared/new_text_Field.dart @@ -0,0 +1,239 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; + +class NumberTextInputFormatter extends TextInputFormatter { + @override + TextEditingValue formatEditUpdate( + TextEditingValue oldValue, TextEditingValue newValue) { + final int newTextLength = newValue.text.length; + int selectionIndex = newValue.selection.end; + int usedSubstringIndex = 0; + final StringBuffer newText = StringBuffer(); + if (newTextLength >= 1) { + newText.write('('); + if (newValue.selection.end >= 1) selectionIndex++; + } + if (newTextLength >= 4) { + newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); + if (newValue.selection.end >= 3) selectionIndex += 2; + } + if (newTextLength >= 7) { + newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); + if (newValue.selection.end >= 6) selectionIndex++; + } + if (newTextLength >= 11) { + newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); + if (newValue.selection.end >= 10) selectionIndex++; + } + // Dump the rest. + if (newTextLength >= usedSubstringIndex) + newText.write(newValue.text.substring(usedSubstringIndex)); + return TextEditingValue( + text: newText.toString(), + selection: TextSelection.collapsed(offset: selectionIndex), + ); + } +} + +final _mobileFormatter = NumberTextInputFormatter(); + +class NewTextFields extends StatefulWidget { + NewTextFields( + {Key key, + this.type, + this.hintText, + this.suffixIcon, + this.autoFocus, + this.onChanged, + this.initialValue, + this.minLines, + this.maxLines, + this.inputFormatters, + this.padding, + this.focus = false, + this.maxLengthEnforced = true, + this.suffixIconColor, + this.inputAction, + this.onSubmit, + this.keepPadding = true, + this.textCapitalization = TextCapitalization.none, + this.controller, + this.keyboardType, + this.validator, + this.borderOnlyError = false, + this.onSaved, + this.onSuffixTap, + this.readOnly: false, + this.maxLength, + this.prefixIcon, + this.bare = false, + this.onTap, + this.fontSize = 16.0, + this.fontWeight = FontWeight.w700, + this.autoValidate = false, + this.hintColor,this.isEnabled=true}) + : super(key: key); + + final String hintText; + + // final String initialValue; + final String type; + final bool autoFocus; + final IconData suffixIcon; + final Color suffixIconColor; + final Icon prefixIcon; + final VoidCallback onTap; + final TextEditingController controller; + final TextInputType keyboardType; + final FormFieldValidator validator; + final Function onSaved; + final Function onSuffixTap; + final Function onChanged; + final Function onSubmit; + final bool readOnly; + final int maxLength; + final int minLines; + final int maxLines; + final bool maxLengthEnforced; + final bool bare; + final bool isEnabled; + final TextInputAction inputAction; + final double fontSize; + final FontWeight fontWeight; + final bool keepPadding; + final TextCapitalization textCapitalization; + final List inputFormatters; + final bool autoValidate; + final EdgeInsets padding; + final bool focus; + final bool borderOnlyError; + final Color hintColor; + final String initialValue; + @override + _NewTextFieldsState createState() => _NewTextFieldsState(); +} + +class _NewTextFieldsState extends State { + final FocusNode _focusNode = FocusNode(); + bool focus = false; + bool view = false; + + @override + void initState() { + super.initState(); + _focusNode.addListener(() { + setState(() { + focus = _focusNode.hasFocus; + }); + }); + } + + @override + void didUpdateWidget(NewTextFields oldWidget) { + if (widget.focus) _focusNode.requestFocus(); + super.didUpdateWidget(oldWidget); + } + + @override + void dispose() { + _focusNode.dispose(); + super.dispose(); + } + + + bool _determineReadOnly() { + if (widget.readOnly != null && widget.readOnly) { + _focusNode.unfocus(); + return true; + } else { + return false; + } + } + + @override + Widget build(BuildContext context) { + return AnimatedContainer( + duration: Duration(milliseconds: 300), + decoration:BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: Container( + margin: EdgeInsets.only(top: 8), + + child: TextFormField( + enabled: widget.isEnabled, + initialValue: widget.initialValue, + keyboardAppearance: Theme.of(context).brightness, + scrollPhysics: BouncingScrollPhysics(), + autovalidate: widget.autoValidate, + textCapitalization: widget.textCapitalization, + onFieldSubmitted: widget.inputAction == TextInputAction.next + ? (widget.onSubmit != null + ? widget.onSubmit + : (val) { + _focusNode.nextFocus(); + }) + : widget.onSubmit, + textInputAction: widget.inputAction, + minLines: widget.minLines ?? 1, + maxLines: widget.maxLines ?? 1, + maxLengthEnforced: widget.maxLengthEnforced, + onChanged: widget.onChanged, + focusNode: _focusNode, + maxLength: widget.maxLength ?? null, + controller: widget.controller, + keyboardType: widget.keyboardType, + readOnly: _determineReadOnly(), + obscureText: widget.type == "password" && !view ? true : false, + autofocus: widget.autoFocus ?? false, + validator: widget.validator, + onSaved: widget.onSaved, + + style: Theme.of(context) + .textTheme + .body2 + .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + inputFormatters: widget.keyboardType == TextInputType.phone + ? [ + WhitelistingTextInputFormatter.digitsOnly, + _mobileFormatter, + ] + : widget.inputFormatters, + decoration: InputDecoration( + labelText: widget.hintText, + labelStyle: TextStyle(color: Colors.black), + errorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(12.0)), + focusedErrorBorder: OutlineInputBorder( + borderSide: BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(0.5), + width: 1.0), + borderRadius: BorderRadius.circular(8.0)), + focusedBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + disabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12)), + enabledBorder: OutlineInputBorder( + borderSide: + BorderSide(color: Colors.white, width: 1.0), + borderRadius: BorderRadius.circular(12), + ), + ), + ), + ), + ); + } +} From febdadc92499f85151914f855f9ecd5ffc176c8b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 28 Jan 2021 17:28:12 +0200 Subject: [PATCH 239/421] fix : DA-264 --- lib/widgets/shared/new_text_Field.dart | 239 ------------------------- 1 file changed, 239 deletions(-) delete mode 100644 lib/widgets/shared/new_text_Field.dart diff --git a/lib/widgets/shared/new_text_Field.dart b/lib/widgets/shared/new_text_Field.dart deleted file mode 100644 index ad9eb580..00000000 --- a/lib/widgets/shared/new_text_Field.dart +++ /dev/null @@ -1,239 +0,0 @@ -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; -import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; - -class NumberTextInputFormatter extends TextInputFormatter { - @override - TextEditingValue formatEditUpdate( - TextEditingValue oldValue, TextEditingValue newValue) { - final int newTextLength = newValue.text.length; - int selectionIndex = newValue.selection.end; - int usedSubstringIndex = 0; - final StringBuffer newText = StringBuffer(); - if (newTextLength >= 1) { - newText.write('('); - if (newValue.selection.end >= 1) selectionIndex++; - } - if (newTextLength >= 4) { - newText.write(newValue.text.substring(0, usedSubstringIndex = 3) + ') '); - if (newValue.selection.end >= 3) selectionIndex += 2; - } - if (newTextLength >= 7) { - newText.write(newValue.text.substring(3, usedSubstringIndex = 6) + '-'); - if (newValue.selection.end >= 6) selectionIndex++; - } - if (newTextLength >= 11) { - newText.write(newValue.text.substring(6, usedSubstringIndex = 10) + ' '); - if (newValue.selection.end >= 10) selectionIndex++; - } - // Dump the rest. - if (newTextLength >= usedSubstringIndex) - newText.write(newValue.text.substring(usedSubstringIndex)); - return TextEditingValue( - text: newText.toString(), - selection: TextSelection.collapsed(offset: selectionIndex), - ); - } -} - -final _mobileFormatter = NumberTextInputFormatter(); - -class NewTextFields extends StatefulWidget { - NewTextFields( - {Key key, - this.type, - this.hintText, - this.suffixIcon, - this.autoFocus, - this.onChanged, - this.initialValue, - this.minLines, - this.maxLines, - this.inputFormatters, - this.padding, - this.focus = false, - this.maxLengthEnforced = true, - this.suffixIconColor, - this.inputAction, - this.onSubmit, - this.keepPadding = true, - this.textCapitalization = TextCapitalization.none, - this.controller, - this.keyboardType, - this.validator, - this.borderOnlyError = false, - this.onSaved, - this.onSuffixTap, - this.readOnly: false, - this.maxLength, - this.prefixIcon, - this.bare = false, - this.onTap, - this.fontSize = 16.0, - this.fontWeight = FontWeight.w700, - this.autoValidate = false, - this.hintColor,this.isEnabled=true}) - : super(key: key); - - final String hintText; - - // final String initialValue; - final String type; - final bool autoFocus; - final IconData suffixIcon; - final Color suffixIconColor; - final Icon prefixIcon; - final VoidCallback onTap; - final TextEditingController controller; - final TextInputType keyboardType; - final FormFieldValidator validator; - final Function onSaved; - final Function onSuffixTap; - final Function onChanged; - final Function onSubmit; - final bool readOnly; - final int maxLength; - final int minLines; - final int maxLines; - final bool maxLengthEnforced; - final bool bare; - final bool isEnabled; - final TextInputAction inputAction; - final double fontSize; - final FontWeight fontWeight; - final bool keepPadding; - final TextCapitalization textCapitalization; - final List inputFormatters; - final bool autoValidate; - final EdgeInsets padding; - final bool focus; - final bool borderOnlyError; - final Color hintColor; - final String initialValue; - @override - _NewTextFieldsState createState() => _NewTextFieldsState(); -} - -class _NewTextFieldsState extends State { - final FocusNode _focusNode = FocusNode(); - bool focus = false; - bool view = false; - - @override - void initState() { - super.initState(); - _focusNode.addListener(() { - setState(() { - focus = _focusNode.hasFocus; - }); - }); - } - - @override - void didUpdateWidget(NewTextFields oldWidget) { - if (widget.focus) _focusNode.requestFocus(); - super.didUpdateWidget(oldWidget); - } - - @override - void dispose() { - _focusNode.dispose(); - super.dispose(); - } - - - bool _determineReadOnly() { - if (widget.readOnly != null && widget.readOnly) { - _focusNode.unfocus(); - return true; - } else { - return false; - } - } - - @override - Widget build(BuildContext context) { - return AnimatedContainer( - duration: Duration(milliseconds: 300), - decoration:BoxDecoration( - borderRadius: BorderRadius.circular(12), - color: Colors.white), - child: Container( - margin: EdgeInsets.only(top: 8), - - child: TextFormField( - enabled: widget.isEnabled, - initialValue: widget.initialValue, - keyboardAppearance: Theme.of(context).brightness, - scrollPhysics: BouncingScrollPhysics(), - autovalidate: widget.autoValidate, - textCapitalization: widget.textCapitalization, - onFieldSubmitted: widget.inputAction == TextInputAction.next - ? (widget.onSubmit != null - ? widget.onSubmit - : (val) { - _focusNode.nextFocus(); - }) - : widget.onSubmit, - textInputAction: widget.inputAction, - minLines: widget.minLines ?? 1, - maxLines: widget.maxLines ?? 1, - maxLengthEnforced: widget.maxLengthEnforced, - onChanged: widget.onChanged, - focusNode: _focusNode, - maxLength: widget.maxLength ?? null, - controller: widget.controller, - keyboardType: widget.keyboardType, - readOnly: _determineReadOnly(), - obscureText: widget.type == "password" && !view ? true : false, - autofocus: widget.autoFocus ?? false, - validator: widget.validator, - onSaved: widget.onSaved, - - style: Theme.of(context) - .textTheme - .body2 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), - inputFormatters: widget.keyboardType == TextInputType.phone - ? [ - WhitelistingTextInputFormatter.digitsOnly, - _mobileFormatter, - ] - : widget.inputFormatters, - decoration: InputDecoration( - labelText: widget.hintText, - labelStyle: TextStyle(color: Colors.black), - errorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(12.0)), - focusedErrorBorder: OutlineInputBorder( - borderSide: BorderSide( - color: Theme.of(context) - .errorColor - .withOpacity(0.5), - width: 1.0), - borderRadius: BorderRadius.circular(8.0)), - focusedBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - disabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12)), - enabledBorder: OutlineInputBorder( - borderSide: - BorderSide(color: Colors.white, width: 1.0), - borderRadius: BorderRadius.circular(12), - ), - ), - ), - ), - ); - } -} From 494479f1d91862563a78cd1f7ed126b463a20f09 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 28 Jan 2021 17:32:11 +0200 Subject: [PATCH 240/421] fix : DA-264 fix merge error --- lib/config/localized_values.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 32c01444..8096b5b6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -687,13 +687,10 @@ const Map> localizedValues = { 'years': {'en': "Years", 'ar': "سنين"}, 'hr': {'en': "HR", 'ar': "س"}, 'min': {'en': "Min", 'ar': "د"}, - 'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"} - // 'icd': {'en': "ICD", 'ar': " "} - 'min': {'en': "Min", 'ar': "د"}, + 'appointmentNumber': {'en': "Appointment Number", 'ar': "رقم الموعد"}, 'referralStatusHold': {'en': "Hold", 'ar': "معلق"}, 'referralStatusActive': {'en': "Active", 'ar': "نشط"}, 'referralStatusCancelled': {'en': "Cancelled", 'ar': "ملغاة"}, 'referralStatusCompleted': {'en': "Completed", 'ar': "مكتمل"}, 'referralStatusNotSeen': {'en': "NotSeen", 'ar': "لم يرى"}, - // 'icd': {'en': "ICD", 'ar': " "}, }; From deca96f62e9bc9f91a383e0a6d26031aae82cc60 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 28 Jan 2021 21:21:51 +0200 Subject: [PATCH 241/421] bug fix --- lib/screens/prescription/prescription_screen.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 3dfd5bdc..8f53ef69 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -817,7 +817,7 @@ class _NewPrescriptionScreenState extends State { children: [ Container( height: MediaQuery.of(context).size.height * - 0.070, + 0.060, width: double.infinity, child: Row( children: [ @@ -825,7 +825,7 @@ class _NewPrescriptionScreenState extends State { width: MediaQuery.of(context) .size .width * - 0.550, + 0.500, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( @@ -863,7 +863,7 @@ class _NewPrescriptionScreenState extends State { width: MediaQuery.of(context) .size .width * - 0.3200, + 0.3700, child: InkWell( onTap: unitsList != null ? () { @@ -908,6 +908,9 @@ class _NewPrescriptionScreenState extends State { ], ), ), + SizedBox( + height: 12, + ), Container( height: MediaQuery.of(context).size.height * 0.070, From 9b5899d4e6ffe701f54c5c0371e292da2157061e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 29 Jan 2021 19:57:50 +0200 Subject: [PATCH 242/421] bug fix --- lib/screens/prescription/prescription_screen.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 8f53ef69..1f45deb1 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -1214,8 +1214,8 @@ class _NewPrescriptionScreenState extends State { covered: true, dose: newDoseStreangth.isNotEmpty ? int.parse(newDoseStreangth) - : int.parse( - doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, + : int.parse(doseStreangth), + //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), From 29de472c66d3a6d3b27173a3a11527030b49abfb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 30 Jan 2021 00:11:57 +0200 Subject: [PATCH 243/421] bug fix --- lib/core/model/medical_file_model.dart | 75 ++++++++++++++++++- .../medical-file/medical_file_details.dart | 30 ++++---- .../prescription/prescription_screen.dart | 9 ++- 3 files changed, 98 insertions(+), 16 deletions(-) diff --git a/lib/core/model/medical_file_model.dart b/lib/core/model/medical_file_model.dart index 4e9d8f3e..f2b4ce3c 100644 --- a/lib/core/model/medical_file_model.dart +++ b/lib/core/model/medical_file_model.dart @@ -169,6 +169,7 @@ class Consulations { List lstPhysicalExam; List lstProcedure; List lstMedicalHistory; + List lstCheifComplaint; Consulations( {this.admissionNo, @@ -194,7 +195,8 @@ class Consulations { this.lstAssessments, this.lstPhysicalExam, this.lstProcedure, - this.lstMedicalHistory}); + this.lstMedicalHistory, + this.lstCheifComplaint}); Consulations.fromJson(Map json) { admissionNo = json['AdmissionNo']; @@ -223,6 +225,12 @@ class Consulations { lstAssessments.add(new LstAssessments.fromJson(v)); }); } + if (json['lstCheifComplaint'] != null) { + lstCheifComplaint = new List(); + json['lstCheifComplaint'].forEach((v) { + lstCheifComplaint.add(new LstCheifComplaint.fromJson(v)); + }); + } if (json['lstPhysicalExam'] != null) { lstPhysicalExam = new List(); json['lstPhysicalExam'].forEach((v) { @@ -269,6 +277,10 @@ class Consulations { data['lstAssessments'] = this.lstAssessments.map((v) => v.toJson()).toList(); } + if (this.lstCheifComplaint != null) { + data['lstCheifComplaint'] = + this.lstCheifComplaint.map((v) => v.toJson()).toList(); + } if (this.lstPhysicalExam != null) { data['lstPhysicalExam'] = this.lstPhysicalExam.map((v) => v.toJson()).toList(); @@ -284,6 +296,67 @@ class Consulations { } } +class LstCheifComplaint { + int appointmentNo; + String cCDate; + String chiefComplaint; + String currentMedication; + int episodeID; + String hOPI; + int patientID; + String patientType; + int projectID; + String projectName; + String setupID; + String dispalyName; + + LstCheifComplaint( + {this.appointmentNo, + this.cCDate, + this.chiefComplaint, + this.currentMedication, + this.episodeID, + this.hOPI, + this.patientID, + this.patientType, + this.projectID, + this.projectName, + this.setupID, + this.dispalyName}); + + LstCheifComplaint.fromJson(Map json) { + appointmentNo = json['AppointmentNo']; + cCDate = json['CCDate']; + chiefComplaint = json['ChiefComplaint']; + currentMedication = json['CurrentMedication']; + episodeID = json['EpisodeID']; + hOPI = json['HOPI']; + patientID = json['PatientID']; + patientType = json['PatientType']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + setupID = json['SetupID']; + dispalyName = json['dispalyName']; + } + + Map toJson() { + final Map data = new Map(); + data['AppointmentNo'] = this.appointmentNo; + data['CCDate'] = this.cCDate; + data['ChiefComplaint'] = this.chiefComplaint; + data['CurrentMedication'] = this.currentMedication; + data['EpisodeID'] = this.episodeID; + data['HOPI'] = this.hOPI; + data['PatientID'] = this.patientID; + data['PatientType'] = this.patientType; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['SetupID'] = this.setupID; + data['dispalyName'] = this.dispalyName; + return data; + } +} + class LstAssessments { int appointmentNo; String condition; diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index f7525391..a148610b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -188,16 +188,18 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, + Expanded( + child: AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), ), ], ), @@ -315,7 +317,7 @@ class _MedicalFileDetailsState extends State { .timelines[encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory + .lstCheifComplaint .length, itemBuilder: (BuildContext ctxt, int index) { @@ -338,9 +340,9 @@ class _MedicalFileDetailsState extends State { encounterNumber] .timeLineEvents[0] .consulations[0] - .lstMedicalHistory[ + .lstCheifComplaint[ index] - .history + .hOPI .trim(), ), ), @@ -795,7 +797,7 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examType), + .examDesc), ], ), Row( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 1f45deb1..cef99164 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -946,7 +946,7 @@ class _NewPrescriptionScreenState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, + 'Route', route != null ? route['name'] : null, @@ -1181,6 +1181,13 @@ class _NewPrescriptionScreenState extends State { }); } + // String getName(String num) { + // dynamic x = routeList.where((i) { + // return i['id'] == int.parse(num); + // }).first(); + // return x.toString(); + // } + updatePrescription( {PrescriptionViewModel model, int drugId, From b63c7aff257be90b7f9f6adcf7eb727117cb6904 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 31 Jan 2021 10:18:52 +0200 Subject: [PATCH 244/421] Fix DA-331 vital signs uncorrect temperature value --- lib/core/service/patient-ucaf-service.dart | 2 +- .../patient/vital_sign/patient-vital-sign-data.dart | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index 38f2407b..e7ecc9f2 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -41,7 +41,7 @@ class UcafService extends LookupService { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientMRN; - // body['AppointmentNo'] = patient.appointmentNo; + body['AppointmentNo'] = patient.appointmentNo; // body['EpisodeID'] = patient.episodeNo; await baseAppClient.post( diff --git a/lib/models/patient/vital_sign/patient-vital-sign-data.dart b/lib/models/patient/vital_sign/patient-vital-sign-data.dart index b7fe77cb..57133a08 100644 --- a/lib/models/patient/vital_sign/patient-vital-sign-data.dart +++ b/lib/models/patient/vital_sign/patient-vital-sign-data.dart @@ -8,7 +8,7 @@ class VitalSignData { var bodyMassIndex; int fio2; int headCircumCm; - int heightCm; + var heightCm; int idealBodyWeightLbs; bool isPainManagementDone; bool isVitalsRequired; @@ -26,10 +26,10 @@ class VitalSignData { int respirationPattern; int sao2; int status; - int temperatureCelcius; + var temperatureCelcius; int temperatureCelciusMethod; - int waistSizeInch; - int weightKg; + var waistSizeInch; + var weightKg; VitalSignData( {this.appointmentNo, From e6527527290ff13b9f64b0c37edc4741e84fe94a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 11:00:24 +0200 Subject: [PATCH 245/421] fix : DA-334 --- ios/Podfile.lock | 378 +----------------- .../subjective/update_allergies_widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 12 +- 3 files changed, 5 insertions(+), 387 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index aa3e21b8..fb65ae25 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1,235 +1,9 @@ PODS: - - abseil/algorithm (0.20200225.0): - - abseil/algorithm/algorithm (= 0.20200225.0) - - abseil/algorithm/container (= 0.20200225.0) - - abseil/algorithm/algorithm (0.20200225.0): - - abseil/base/config - - abseil/algorithm/container (0.20200225.0): - - abseil/algorithm/algorithm - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/base (0.20200225.0): - - abseil/base/atomic_hook (= 0.20200225.0) - - abseil/base/base (= 0.20200225.0) - - abseil/base/base_internal (= 0.20200225.0) - - abseil/base/bits (= 0.20200225.0) - - abseil/base/config (= 0.20200225.0) - - abseil/base/core_headers (= 0.20200225.0) - - abseil/base/dynamic_annotations (= 0.20200225.0) - - abseil/base/endian (= 0.20200225.0) - - abseil/base/errno_saver (= 0.20200225.0) - - abseil/base/exponential_biased (= 0.20200225.0) - - abseil/base/log_severity (= 0.20200225.0) - - abseil/base/malloc_internal (= 0.20200225.0) - - abseil/base/periodic_sampler (= 0.20200225.0) - - abseil/base/pretty_function (= 0.20200225.0) - - abseil/base/raw_logging_internal (= 0.20200225.0) - - abseil/base/spinlock_wait (= 0.20200225.0) - - abseil/base/throw_delegate (= 0.20200225.0) - - abseil/base/atomic_hook (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/base (0.20200225.0): - - abseil/base/atomic_hook - - abseil/base/base_internal - - abseil/base/config - - abseil/base/core_headers - - abseil/base/dynamic_annotations - - abseil/base/log_severity - - abseil/base/raw_logging_internal - - abseil/base/spinlock_wait - - abseil/meta/type_traits - - abseil/base/base_internal (0.20200225.0): - - abseil/base/config - - abseil/meta/type_traits - - abseil/base/bits (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/config (0.20200225.0) - - abseil/base/core_headers (0.20200225.0): - - abseil/base/config - - abseil/base/dynamic_annotations (0.20200225.0) - - abseil/base/endian (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/errno_saver (0.20200225.0): - - abseil/base/config - - abseil/base/exponential_biased (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/log_severity (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/malloc_internal (0.20200225.0): - - abseil/base/base - - abseil/base/base_internal - - abseil/base/config - - abseil/base/core_headers - - abseil/base/dynamic_annotations - - abseil/base/raw_logging_internal - - abseil/base/periodic_sampler (0.20200225.0): - - abseil/base/core_headers - - abseil/base/exponential_biased - - abseil/base/pretty_function (0.20200225.0) - - abseil/base/raw_logging_internal (0.20200225.0): - - abseil/base/atomic_hook - - abseil/base/config - - abseil/base/core_headers - - abseil/base/log_severity - - abseil/base/spinlock_wait (0.20200225.0): - - abseil/base/base_internal - - abseil/base/core_headers - - abseil/base/errno_saver - - abseil/base/throw_delegate (0.20200225.0): - - abseil/base/config - - abseil/base/raw_logging_internal - - abseil/container/compressed_tuple (0.20200225.0): - - abseil/utility/utility - - abseil/container/inlined_vector (0.20200225.0): - - abseil/algorithm/algorithm - - abseil/base/core_headers - - abseil/base/throw_delegate - - abseil/container/inlined_vector_internal - - abseil/memory/memory - - abseil/container/inlined_vector_internal (0.20200225.0): - - abseil/base/core_headers - - abseil/container/compressed_tuple - - abseil/memory/memory - - abseil/meta/type_traits - - abseil/types/span - - abseil/memory (0.20200225.0): - - abseil/memory/memory (= 0.20200225.0) - - abseil/memory/memory (0.20200225.0): - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/meta (0.20200225.0): - - abseil/meta/type_traits (= 0.20200225.0) - - abseil/meta/type_traits (0.20200225.0): - - abseil/base/config - - abseil/numeric/int128 (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/strings/internal (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/base/endian - - abseil/base/raw_logging_internal - - abseil/meta/type_traits - - abseil/strings/str_format (0.20200225.0): - - abseil/strings/str_format_internal - - abseil/strings/str_format_internal (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/numeric/int128 - - abseil/strings/strings - - abseil/types/span - - abseil/strings/strings (0.20200225.0): - - abseil/base/base - - abseil/base/bits - - abseil/base/config - - abseil/base/core_headers - - abseil/base/endian - - abseil/base/raw_logging_internal - - abseil/base/throw_delegate - - abseil/memory/memory - - abseil/meta/type_traits - - abseil/numeric/int128 - - abseil/strings/internal - - abseil/time (0.20200225.0): - - abseil/time/internal (= 0.20200225.0) - - abseil/time/time (= 0.20200225.0) - - abseil/time/internal (0.20200225.0): - - abseil/time/internal/cctz (= 0.20200225.0) - - abseil/time/internal/cctz (0.20200225.0): - - abseil/time/internal/cctz/civil_time (= 0.20200225.0) - - abseil/time/internal/cctz/time_zone (= 0.20200225.0) - - abseil/time/internal/cctz/civil_time (0.20200225.0): - - abseil/base/config - - abseil/time/internal/cctz/time_zone (0.20200225.0): - - abseil/base/config - - abseil/time/internal/cctz/civil_time - - abseil/time/time (0.20200225.0): - - abseil/base/base - - abseil/base/core_headers - - abseil/base/raw_logging_internal - - abseil/numeric/int128 - - abseil/strings/strings - - abseil/time/internal/cctz/civil_time - - abseil/time/internal/cctz/time_zone - - abseil/types (0.20200225.0): - - abseil/types/any (= 0.20200225.0) - - abseil/types/bad_any_cast (= 0.20200225.0) - - abseil/types/bad_any_cast_impl (= 0.20200225.0) - - abseil/types/bad_optional_access (= 0.20200225.0) - - abseil/types/bad_variant_access (= 0.20200225.0) - - abseil/types/compare (= 0.20200225.0) - - abseil/types/optional (= 0.20200225.0) - - abseil/types/span (= 0.20200225.0) - - abseil/types/variant (= 0.20200225.0) - - abseil/types/any (0.20200225.0): - - abseil/base/config - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/types/bad_any_cast - - abseil/utility/utility - - abseil/types/bad_any_cast (0.20200225.0): - - abseil/base/config - - abseil/types/bad_any_cast_impl - - abseil/types/bad_any_cast_impl (0.20200225.0): - - abseil/base/config - - abseil/base/raw_logging_internal - - abseil/types/bad_optional_access (0.20200225.0): - - abseil/base/config - - abseil/base/raw_logging_internal - - abseil/types/bad_variant_access (0.20200225.0): - - abseil/base/config - - abseil/base/raw_logging_internal - - abseil/types/compare (0.20200225.0): - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/types/optional (0.20200225.0): - - abseil/base/base_internal - - abseil/base/config - - abseil/base/core_headers - - abseil/memory/memory - - abseil/meta/type_traits - - abseil/types/bad_optional_access - - abseil/utility/utility - - abseil/types/span (0.20200225.0): - - abseil/algorithm/algorithm - - abseil/base/core_headers - - abseil/base/throw_delegate - - abseil/meta/type_traits - - abseil/types/variant (0.20200225.0): - - abseil/base/base_internal - - abseil/base/config - - abseil/base/core_headers - - abseil/meta/type_traits - - abseil/types/bad_variant_access - - abseil/utility/utility - - abseil/utility/utility (0.20200225.0): - - abseil/base/base_internal - - abseil/base/config - - abseil/meta/type_traits - Alamofire (4.9.1) - barcode_scan (0.0.1): - Flutter - MTBBarcodeScanner - SwiftProtobuf - - BoringSSL-GRPC (0.0.7): - - BoringSSL-GRPC/Implementation (= 0.0.7) - - BoringSSL-GRPC/Interface (= 0.0.7) - - BoringSSL-GRPC/Implementation (0.0.7): - - BoringSSL-GRPC/Interface (= 0.0.7) - - BoringSSL-GRPC/Interface (0.0.7) - - cloud_firestore (0.14.3): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Firestore (~> 6.33.0) - - firebase_core - - Flutter - - cloud_firestore_web (0.1.0): - - Flutter - connectivity (0.0.1): - Flutter - Reachability @@ -239,39 +13,11 @@ PODS: - Flutter - device_info (0.0.1): - Flutter - - Firebase/Analytics (6.33.0): - - Firebase/Core - - Firebase/Auth (6.33.0): - - Firebase/CoreOnly - - FirebaseAuth (~> 6.9.2) - - Firebase/Core (6.33.0): - - Firebase/CoreOnly - - FirebaseAnalytics (= 6.8.3) - Firebase/CoreOnly (6.33.0): - FirebaseCore (= 6.10.3) - - Firebase/Firestore (6.33.0): - - Firebase/CoreOnly - - FirebaseFirestore (~> 1.18.0) - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) - - Firebase/Storage (6.33.0): - - Firebase/CoreOnly - - FirebaseStorage (~> 3.9.0) - - firebase_analytics (6.2.0): - - Firebase/Analytics (~> 6.33.0) - - Firebase/CoreOnly (~> 6.33.0) - - firebase_core - - Flutter - - firebase_analytics_web (0.1.0): - - Flutter - - firebase_auth (0.18.3): - - Firebase/Auth (~> 6.33.0) - - Firebase/CoreOnly (~> 6.33.0) - - firebase_core - - Flutter - - firebase_auth_web (0.1.0): - - Flutter - firebase_core (0.5.2): - Firebase/CoreOnly (~> 6.33.0) - Flutter @@ -282,25 +28,6 @@ PODS: - Firebase/Messaging (~> 6.33.0) - firebase_core - Flutter - - firebase_storage (5.0.1): - - Firebase/CoreOnly (~> 6.33.0) - - Firebase/Storage (~> 6.33.0) - - firebase_core - - Flutter - - FirebaseAnalytics (6.8.3): - - FirebaseCore (~> 6.10) - - FirebaseInstallations (~> 1.6) - - GoogleAppMeasurement (= 6.8.3) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/MethodSwizzler (~> 6.7) - - GoogleUtilities/Network (~> 6.7) - - "GoogleUtilities/NSData+zlib (~> 6.7)" - - nanopb (~> 1.30906.0) - - FirebaseAuth (6.9.2): - - FirebaseCore (~> 6.10) - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/Environment (~> 6.7) - - GTMSessionFetcher/Core (~> 1.1) - FirebaseCore (6.10.3): - FirebaseCoreDiagnostics (~> 1.6) - GoogleUtilities/Environment (~> 6.7) @@ -310,18 +37,6 @@ PODS: - GoogleUtilities/Environment (~> 6.7) - GoogleUtilities/Logger (~> 6.7) - nanopb (~> 1.30906.0) - - FirebaseFirestore (1.18.0): - - abseil/algorithm (= 0.20200225.0) - - abseil/base (= 0.20200225.0) - - abseil/memory (= 0.20200225.0) - - abseil/meta (= 0.20200225.0) - - abseil/strings/strings (= 0.20200225.0) - - abseil/time (= 0.20200225.0) - - abseil/types (= 0.20200225.0) - - FirebaseCore (~> 6.10) - - "gRPC-C++ (~> 1.28.0)" - - leveldb-library (~> 1.22) - - nanopb (~> 1.30906.0) - FirebaseInstallations (1.7.0): - FirebaseCore (~> 6.10) - GoogleUtilities/Environment (~> 6.7) @@ -340,20 +55,11 @@ PODS: - GoogleUtilities/Reachability (~> 6.7) - GoogleUtilities/UserDefaults (~> 6.7) - Protobuf (>= 3.9.2, ~> 3.9) - - FirebaseStorage (3.9.1): - - FirebaseCore (~> 6.10) - - GTMSessionFetcher/Core (~> 1.1) - Flutter (1.0.0) - flutter_flexible_toast (0.0.1): - Flutter - flutter_plugin_android_lifecycle (0.0.1): - Flutter - - GoogleAppMeasurement (6.8.3): - - GoogleUtilities/AppDelegateSwizzler (~> 6.7) - - GoogleUtilities/MethodSwizzler (~> 6.7) - - GoogleUtilities/Network (~> 6.7) - - "GoogleUtilities/NSData+zlib (~> 6.7)" - - nanopb (~> 1.30906.0) - GoogleDataTransport (7.5.1): - nanopb (~> 1.30906.0) - GoogleUtilities/AppDelegateSwizzler (6.7.2): @@ -364,8 +70,6 @@ PODS: - PromisesObjC (~> 1.2) - GoogleUtilities/Logger (6.7.2): - GoogleUtilities/Environment - - GoogleUtilities/MethodSwizzler (6.7.2): - - GoogleUtilities/Logger - GoogleUtilities/Network (6.7.2): - GoogleUtilities/Logger - "GoogleUtilities/NSData+zlib" @@ -375,36 +79,10 @@ PODS: - GoogleUtilities/Logger - GoogleUtilities/UserDefaults (6.7.2): - GoogleUtilities/Logger - - "gRPC-C++ (1.28.2)": - - "gRPC-C++/Implementation (= 1.28.2)" - - "gRPC-C++/Interface (= 1.28.2)" - - "gRPC-C++/Implementation (1.28.2)": - - abseil/container/inlined_vector (= 0.20200225.0) - - abseil/memory/memory (= 0.20200225.0) - - abseil/strings/str_format (= 0.20200225.0) - - abseil/strings/strings (= 0.20200225.0) - - abseil/types/optional (= 0.20200225.0) - - "gRPC-C++/Interface (= 1.28.2)" - - gRPC-Core (= 1.28.2) - - "gRPC-C++/Interface (1.28.2)" - - gRPC-Core (1.28.2): - - gRPC-Core/Implementation (= 1.28.2) - - gRPC-Core/Interface (= 1.28.2) - - gRPC-Core/Implementation (1.28.2): - - abseil/container/inlined_vector (= 0.20200225.0) - - abseil/memory/memory (= 0.20200225.0) - - abseil/strings/str_format (= 0.20200225.0) - - abseil/strings/strings (= 0.20200225.0) - - abseil/types/optional (= 0.20200225.0) - - BoringSSL-GRPC (= 0.0.7) - - gRPC-Core/Interface (= 1.28.2) - - gRPC-Core/Interface (1.28.2) - - GTMSessionFetcher/Core (1.5.0) - hexcolor (0.0.1): - Flutter - imei_plugin (0.0.1): - Flutter - - leveldb-library (1.22) - local_auth (0.0.1): - Flutter - maps_launcher (0.0.1): @@ -422,7 +100,7 @@ PODS: - Flutter - "permission_handler (5.0.1+1)": - Flutter - - PromisesObjC (1.2.10) + - PromisesObjC (1.2.11) - Protobuf (3.13.0) - Reachability (3.2) - shared_preferences (0.0.1): @@ -454,20 +132,13 @@ PODS: DEPENDENCIES: - Alamofire - barcode_scan (from `.symlinks/plugins/barcode_scan/ios`) - - cloud_firestore (from `.symlinks/plugins/cloud_firestore/ios`) - - cloud_firestore_web (from `.symlinks/plugins/cloud_firestore_web/ios`) - connectivity (from `.symlinks/plugins/connectivity/ios`) - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - device_info (from `.symlinks/plugins/device_info/ios`) - - firebase_analytics (from `.symlinks/plugins/firebase_analytics/ios`) - - firebase_analytics_web (from `.symlinks/plugins/firebase_analytics_web/ios`) - - firebase_auth (from `.symlinks/plugins/firebase_auth/ios`) - - firebase_auth_web (from `.symlinks/plugins/firebase_auth_web/ios`) - firebase_core (from `.symlinks/plugins/firebase_core/ios`) - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - - firebase_storage (from `.symlinks/plugins/firebase_storage/ios`) - Flutter (from `Flutter`) - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) @@ -493,26 +164,15 @@ DEPENDENCIES: SPEC REPOS: trunk: - - abseil - Alamofire - - BoringSSL-GRPC - Firebase - - FirebaseAnalytics - - FirebaseAuth - FirebaseCore - FirebaseCoreDiagnostics - - FirebaseFirestore - FirebaseInstallations - FirebaseInstanceID - FirebaseMessaging - - FirebaseStorage - - GoogleAppMeasurement - GoogleDataTransport - GoogleUtilities - - "gRPC-C++" - - gRPC-Core - - GTMSessionFetcher - - leveldb-library - MTBBarcodeScanner - nanopb - OpenTok @@ -525,10 +185,6 @@ SPEC REPOS: EXTERNAL SOURCES: barcode_scan: :path: ".symlinks/plugins/barcode_scan/ios" - cloud_firestore: - :path: ".symlinks/plugins/cloud_firestore/ios" - cloud_firestore_web: - :path: ".symlinks/plugins/cloud_firestore_web/ios" connectivity: :path: ".symlinks/plugins/connectivity/ios" connectivity_for_web: @@ -537,22 +193,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_macos/ios" device_info: :path: ".symlinks/plugins/device_info/ios" - firebase_analytics: - :path: ".symlinks/plugins/firebase_analytics/ios" - firebase_analytics_web: - :path: ".symlinks/plugins/firebase_analytics_web/ios" - firebase_auth: - :path: ".symlinks/plugins/firebase_auth/ios" - firebase_auth_web: - :path: ".symlinks/plugins/firebase_auth_web/ios" firebase_core: :path: ".symlinks/plugins/firebase_core/ios" firebase_core_web: :path: ".symlinks/plugins/firebase_core_web/ios" firebase_messaging: :path: ".symlinks/plugins/firebase_messaging/ios" - firebase_storage: - :path: ".symlinks/plugins/firebase_storage/ios" Flutter: :path: Flutter flutter_flexible_toast: @@ -597,46 +243,28 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/url_launcher_windows/ios" SPEC CHECKSUMS: - abseil: 6c8eb7892aefa08d929b39f9bb108e5367e3228f Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 barcode_scan: a5c27959edfafaa0c771905bad0b29d6d39e4479 - BoringSSL-GRPC: 8edf627ee524575e2f8d19d56f068b448eea3879 - cloud_firestore: 19c6f947dd14be9d71695ea23eefde67cd8829c8 - cloud_firestore_web: 9ec3dc7f5f98de5129339802d491c1204462bfec connectivity: c4130b2985d4ef6fd26f9702e886bd5260681467 connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_analytics: 52ba26fcfb9cc90f76b36c4e5200cc0a7e9024eb - firebase_analytics_web: 7d539061ea4af07563a0e21044af89cab70efec0 - firebase_auth: 240419f6b00dea39c60a2a9c4379c16c4a4b02fb - firebase_auth_web: 0955c07bcc06e84af76b9d4e32e6f31518f2d7de firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 - firebase_storage: d5cf595245e1770ef7081b026f603771bf5dd547 - FirebaseAnalytics: 5dd088bd2e67bb9d13dbf792d1164ceaf3052193 - FirebaseAuth: c92d49ada7948d1a23466e3db17bc4c2039dddc3 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 - FirebaseFirestore: adff4877869ca91a11250cc0989a6cd56bad163f FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a - FirebaseStorage: 15e0f15ef3c7fec3d1899d68623e47d4447066b4 Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 - GoogleAppMeasurement: 966e88df9d19c15715137bb2ddaf52373f111436 GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 - "gRPC-C++": 13d8ccef97d5c3c441b7e3c529ef28ebee86fad2 - gRPC-Core: 4afa11bfbedf7cdecd04de535a9e046893404ed5 - GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52 hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd - leveldb-library: 55d93ee664b4007aac644a782d11da33fba316f7 local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb @@ -645,7 +273,7 @@ SPEC CHECKSUMS: path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 - PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151 + PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d @@ -664,4 +292,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 9e0e4e0e..086a8e1e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -124,7 +124,7 @@ class _UpdateAllergiesWidgetState extends State { children: [ AppText( selectedAllergy.remark != null || - selectedAllergy.remark == '' + selectedAllergy.remark != '' ? TranslationBase.of(context).remarks + " : " : '', fontWeight: FontWeight.bold, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 11664510..2d0812d4 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -93,22 +93,12 @@ class _AppDrawerState extends State { ? Padding( padding: EdgeInsets.only(top: 10), child: AppText( - authProvider.doctorProfile?.doctorName, + TranslationBase.of(context).dr +authProvider.doctorProfile?.doctorName, fontWeight: FontWeight.bold, color: Colors.black, fontSize: SizeConfig.textMultiplier * 2, )) : SizedBox(), - AppText( - projectsProvider.isArabic - ? authProvider - .doctorProfile.titleDescriptionN ?? - "" - : authProvider - .doctorProfile?.titleDescription ?? - "", - fontWeight: FontWeight.normal, - color: Colors.black87), ], ), ), From f84902b73bb9ca3503242dd1ab8db895ac6ae07b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 12:04:51 +0200 Subject: [PATCH 246/421] fix : DA-333 --- lib/screens/patients/patient_search_screen.dart | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 39f7fe65..1e68d196 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -472,10 +472,21 @@ class _PatientSearchScreenState extends State { ); }).toList(); }, - onChanged: (String newValue) => { + onChanged: (String newValue) { setState(() { _selectedLocation = newValue; - }) + }); + if (newValue == '1') + { + _patientSearchFormValues + .PatientOutSA = false; + } + else + { + _patientSearchFormValues + .PatientOutSA = true; + } + }, items: LOCATIONS.map((item) { !projectsProvider.isArabic From 2b07d16f00c12ad10d5228327ad79f6848c10596 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 12:45:12 +0200 Subject: [PATCH 247/421] fix : DA-303 --- lib/client/base_app_client.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e38db07c..604e6f30 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -70,7 +70,7 @@ class BaseAppClient { body['Channel'] = CHANNEL; body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; - body['PatientOutSA'] = 0; // PATIENT_OUT_SA; + body['PatientOutSA'] = body['PatientOutSA']??0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); @@ -96,9 +96,9 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - onFailure(getError(parsed), statusCode); - //await helpers.logout(); - //helpers.showErrorToast('Your session expired Please login agian'); + // onFailure(getError(parsed), statusCode); + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login agian'); } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); From cfb9ea30cb99821c87885aa7605a430668de0eb2 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 15:23:36 +0200 Subject: [PATCH 248/421] fix : DA-335 --- .../profile/profile-welcome-widget.dart | 28 +++++++++++-------- lib/widgets/shared/app_drawer_widget.dart | 20 +++++++++---- lib/widgets/shared/profile_image_widget.dart | 18 +++++++++--- 3 files changed, 45 insertions(+), 21 deletions(-) diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index ce05b83e..ac61f838 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -62,20 +62,24 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [ - Container( - decoration: BoxDecoration( - color: Theme.of(context).backgroundColor, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + + CircleAvatar( + + // radius: (52) + child: ClipRRect( + borderRadius:BorderRadius.circular(10), + + child: Image.network( + authProvider + .doctorProfile.doctorImageURL, + fit: BoxFit.fill, + width: 70, + height: 60, ), ), - height: 50, - width: 60, - child: Image.network( - authProvider.doctorProfile.doctorImageURL, -// fit: BoxFit.fill, - ), - ), + backgroundColor: Colors.transparent, + ) + ], ), ), diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 2d0812d4..a29d764e 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -83,11 +83,21 @@ class _AppDrawerState extends State { children: [ authProvider.doctorProfile != null ? CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: NetworkImage( - authProvider.doctorProfile.doctorImageURL), - backgroundColor: Colors.white, - ) + radius: + SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius:BorderRadius.circular(50), + + child: Image.network( + authProvider + .doctorProfile.doctorImageURL, + fit: BoxFit.fill, + width: 700, + ), + ), + backgroundColor: Colors.transparent, + ) : SizedBox(), authProvider.doctorProfile != null ? Padding( diff --git a/lib/widgets/shared/profile_image_widget.dart b/lib/widgets/shared/profile_image_widget.dart index db22a13a..3db93f9d 100644 --- a/lib/widgets/shared/profile_image_widget.dart +++ b/lib/widgets/shared/profile_image_widget.dart @@ -34,11 +34,21 @@ class ProfileImageWidget extends StatelessWidget { Container( height: height, width: width, - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: NetworkImage(url), + child:CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * 12, + // radius: (52) + child: ClipRRect( + borderRadius:BorderRadius.circular(50), + + child: Image.network( + url, + fit: BoxFit.fill, + width: 700, + ), + ), backgroundColor: Colors.transparent, - ), + ) ), name == null || des == null ? SizedBox() From 23c826b37f3448c804b446e8814b812d0c60d4a1 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 31 Jan 2021 16:09:28 +0200 Subject: [PATCH 249/421] bug fix --- lib/screens/prescription/prescription_screen.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index cef99164..238a3812 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -559,6 +559,14 @@ class _NewPrescriptionScreenState extends State { ), Row( children: [ + AppText( + TranslationBase.of(context) + .doctorName + + ": ", + fontWeight: + FontWeight + .w600, + ), Expanded( child: AppText( From 6a5e1345277e14e15a6092042726a80aed65918d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 16:34:17 +0200 Subject: [PATCH 250/421] =?UTF-8?q?fix=20=C2=A0remark=20and=20step=20widge?= =?UTF-8?q?t?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patients/profile/soap_update/steps_widget.dart | 14 +++++++------- .../subjective/update_allergies_widget.dart | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/steps_widget.dart b/lib/widgets/patients/profile/soap_update/steps_widget.dart index ac5bee65..a5bcf434 100644 --- a/lib/widgets/patients/profile/soap_update/steps_widget.dart +++ b/lib/widgets/patients/profile/soap_update/steps_widget.dart @@ -75,7 +75,7 @@ class StepsWidget extends StatelessWidget { AppText( "SUBJECTIVE", fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.0, + fontSize: 14, ), ], ), @@ -125,7 +125,7 @@ class StepsWidget extends StatelessWidget { AppText( "OBJECTIVE", fontWeight: FontWeight.bold, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ], ), @@ -178,7 +178,7 @@ class StepsWidget extends StatelessWidget { AppText( "ASSESSMENT", fontWeight: FontWeight.bold, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ], ), @@ -230,7 +230,7 @@ class StepsWidget extends StatelessWidget { "PLAN", fontWeight: FontWeight.bold, textAlign: TextAlign.center, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ), ], @@ -347,7 +347,7 @@ class StepsWidget extends StatelessWidget { AppText( "هدف", fontWeight: FontWeight.bold, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ], ), @@ -400,7 +400,7 @@ class StepsWidget extends StatelessWidget { child: AppText( "تقدير", fontWeight: FontWeight.bold, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ), ], @@ -453,7 +453,7 @@ class StepsWidget extends StatelessWidget { child: AppText( "خطة", fontWeight: FontWeight.bold, - fontSize:SizeConfig.textMultiplier * 2.0, + fontSize:14, ), ), ], diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 086a8e1e..09297ab3 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -123,7 +123,7 @@ class _UpdateAllergiesWidgetState extends State { child: Row( children: [ AppText( - selectedAllergy.remark != null || + selectedAllergy.remark != null && selectedAllergy.remark != '' ? TranslationBase.of(context).remarks + " : " : '', From 5b5954c6f32689187548a34b4633bb04e4b23c36 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 31 Jan 2021 17:09:23 +0200 Subject: [PATCH 251/421] working on Admission request feature adding lookup --- lib/config/config.dart | 2 + lib/core/enum/master_lookup_key.dart | 5 +- .../model/admissionRequest/ward-model.dart | 26 ++ lib/core/service/base/lookup-service.dart | 8 + .../patient-admission-request-service.dart | 58 ++++ .../patient-admission-request-viewmodel.dart | 57 ++- .../profile/UCAF/UCAF-detail-screen.dart | 2 +- .../profile/UCAF/UCAF-input-screen.dart | 30 +- .../admission-request-detail-screen.dart | 7 +- .../admission-request_second-screen.dart | 328 +++++++++++------- 10 files changed, 381 insertions(+), 142 deletions(-) create mode 100644 lib/core/model/admissionRequest/ward-model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 1205d14c..abd07c03 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -191,6 +191,8 @@ const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; +const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; +const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; var selectedPatientType = 1; diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index f1ba1d46..e0c8ccc3 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -12,7 +12,8 @@ enum MasterKeysService { DiagnosisType, ICD10, TemperatureMethods, - Speciality + Speciality, + AdmissionRequestType, } extension SelectedMasterKeysService on MasterKeysService { @@ -57,6 +58,8 @@ extension SelectedMasterKeysService on MasterKeysService { return 2005; case MasterKeysService.Speciality: return 10; + case MasterKeysService.AdmissionRequestType: + return 2019; break; } } diff --git a/lib/core/model/admissionRequest/ward-model.dart b/lib/core/model/admissionRequest/ward-model.dart new file mode 100644 index 00000000..606758d3 --- /dev/null +++ b/lib/core/model/admissionRequest/ward-model.dart @@ -0,0 +1,26 @@ +class WardModel{ + + String description; + String descriptionN; + int floorID; + bool isActive; + + WardModel( + {this.description, this.descriptionN, this.floorID, this.isActive}); + + WardModel.fromJson(Map json) { + description = json['description']; + descriptionN = json['descriptionN']; + floorID = json['floorID']; + isActive = json['isActive']; + } + + Map toJson() { + final Map data = new Map(); + data['description'] = this.description; + data['descriptionN'] = this.descriptionN; + data['floorID'] = this.floorID; + data['isActive'] = this.isActive; + return data; + } +} \ No newline at end of file diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 3bc6e61e..48a78ae7 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -37,6 +37,7 @@ class LookupService extends BaseService { List listOfICD10 = []; List listOfTemperatureMethods = []; List listOfSpeciality = []; + List listOfAdmissionType = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -145,6 +146,13 @@ class LookupService extends BaseService { .add(MasterKeyModel.fromJson(v)); }); break; + case MasterKeysService.AdmissionRequestType: + listOfAdmissionType.clear(); + entryList.forEach((v) { + // listOfAdmissionType.add(MasterKeyModel.fromJson(v)); + listOfAdmissionType.add(v); + }); + break; } } diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index 62932908..dca7b60d 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -1,9 +1,14 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class AdmissionRequestService extends LookupService { List doctorsList = []; List specialityList = []; + List wardList = []; + List diagnosisTypesList = []; + List allergiesLookupList = []; setSpecialityList() { specialityList.clear(); @@ -12,6 +17,13 @@ class AdmissionRequestService extends LookupService { }); } + setAllergies() { + allergiesLookupList.clear(); + allergiesList.forEach((element) { + allergiesLookupList.add(element.toJson()); + }); + } + Future getDoctorsList() async { hasError = false; @@ -28,4 +40,50 @@ class AdmissionRequestService extends LookupService { body: Map(), ); } + + Future getWardList() async { + hasError = false; + + await baseAppClient.post( + GET_WARDS, + onSuccess: (dynamic response, int statusCode) { + wardList.clear(); + if (response['AdmissionMasterList'] != null && + response['AdmissionMasterList']['entityList'] != null) { + response['AdmissionMasterList']['entityList'].forEach((v) { + // wardList.add(WardModel.fromJson(v)); + wardList.add(v); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } + + Future getDiagnosisTypesList() async { + hasError = false; + + await baseAppClient.post( + GET_DIAGNOSIS_TYPES, + onSuccess: (dynamic response, int statusCode) { + diagnosisTypesList.clear(); + if (response['AdmissionDiagnosisList'] != null && + response['AdmissionDiagnosisList']['entityList'] != null) { + response['AdmissionDiagnosisList']['entityList'].forEach((v) { + // diagnosisTypesList.add(MasterKeyModel.fromJson(v)); + diagnosisTypesList.add(v); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } } diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 15f54e5d..d427eb67 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; @@ -15,20 +16,24 @@ class AdmissionRequestViewModel extends BaseViewModel{ List get speciality => _admissionRequestService.specialityList; + List get wardList => _admissionRequestService.wardList; + + List get admissionTypeList => _admissionRequestService.listOfAdmissionType; + + List get diagnosisTypesList => _admissionRequestService.diagnosisTypesList; + + List get allergiesList => _admissionRequestService.allergiesLookupList; + String selectedLanguage; Future getLanguage() async { selectedLanguage = await sharedPref.getString(APP_Language); } - Future getMasterLookup() async { - setState(ViewState.Busy); + Future getSpecialityList() async { await getLanguage(); - await _admissionRequestService.getMasterLookup(MasterKeysService.Speciality); - if (_admissionRequestService.hasError) { - error = _admissionRequestService.error; - setState(ViewState.Error); - } else { + await getMasterLookup(MasterKeysService.Speciality); + if (!_admissionRequestService.hasError) { _admissionRequestService.setSpecialityList(); await getClinicDoctors(); } @@ -43,4 +48,42 @@ class AdmissionRequestViewModel extends BaseViewModel{ } else setState(ViewState.Idle); } + + Future getWards() async { + setState(ViewState.Busy); + await _admissionRequestService.getWardList(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getDiagnosis() async { + setState(ViewState.Busy); + await _admissionRequestService.getDiagnosisTypesList(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getAllergies() async { + await getMasterLookup(MasterKeysService.Allergies); + if (!_admissionRequestService.hasError) { + _admissionRequestService.setAllergies(); + } + } + + Future getMasterLookup(MasterKeysService keysService) async { + setState(ViewState.Busy); + await _admissionRequestService.getMasterLookup(keysService); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } } \ No newline at end of file diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 0831fffe..71955b0c 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -301,7 +301,7 @@ class DiagnosisWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "${diagnosis.icdCode10ID}}", + "${diagnosis.icdCode10ID}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 1a9ac4fa..9b9ae5a5 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -222,19 +222,19 @@ class _UCAFInputScreenState extends State { ), Container( child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .additionalTextComplaints, - helpers.parseHtmlString(model - .patientChiefComplaintList[0] - .chiefComplaint), - false), - enabled: false, - controller: _additionalComplaintsController, - keyboardType: TextInputType.text, - /*minLines: 4, - maxLines: 6,*/ - )), + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .additionalTextComplaints, + helpers.parseHtmlString(model + .patientChiefComplaintList[0] + .chiefComplaint), + false), + enabled: false, + controller: _additionalComplaintsController, + keyboardType: TextInputType.multiline, + minLines: 1, + maxLines: 15, + )), SizedBox( height: 16, ), @@ -363,7 +363,9 @@ class _UCAFInputScreenState extends State { false), enabled: true, controller: _signsController, - keyboardType: TextInputType.text, + keyboardType: TextInputType.multiline, + minLines: null, + maxLines: null, )), SizedBox( height: 16, diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 7ccc3ade..76ce6e2b 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -14,7 +14,6 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import '../../../../routes.dart'; -import 'admission-request_second-screen.dart'; class AdmissionRequestDetailScreen extends StatefulWidget { @override @@ -35,7 +34,7 @@ class _AdmissionRequestDetailScreenState final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getMasterLookup(), + onModelReady: (model) => model.getSpecialityList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).admissionRequest, @@ -178,6 +177,10 @@ class _AdmissionRequestDetailScreenState list: model.doctorsList, attributeName: 'DoctorName', attributeValueId: 'DoctorID', + usingSearch: true, + hintSearchText: + TranslationBase.of(context) + .doctorSearch, okText: TranslationBase.of(context) .ok, diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 3c1e06dc..b65b7f43 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -1,18 +1,24 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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_buttons_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/dialogs/dailog-list-select.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -33,15 +39,17 @@ class _AdmissionRequestSecondScreenState bool _preAnesthesiaReferred = false; dynamic _selectedWard; dynamic _selectedAdmissionType; + dynamic _selectedDiagnosis; + dynamic _selectedAllergies; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( - // onModelReady: (model) => model.getMasterLookup(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).admissionRequest, @@ -179,40 +187,44 @@ class _AdmissionRequestSecondScreenState Container( height: screenSize.height * 0.070, child: InkWell( - onTap: - /*model.doctorsList != null && - model.doctorsList.length > 0 + onTap: model.wardList != null && + model.wardList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - :*/ - null, + openListDialogField('description', + 'description', model.wardList, + (selectedValue) { + setState(() { + _selectedWard = selectedValue; + }); + }); + } + : () async { + await model.getWards(); + if (model.state == ViewState.Idle && + model.wardList.length > 0) { + openListDialogField('description', + 'description', model.wardList, + (selectedValue) { + setState(() { + _selectedWard = selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, child: TextField( decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context).ward, - /* _selectedWard != null - ? _selectedWard['DoctorName'] - :*/ - null, + _selectedWard != null + ? _selectedWard['description'] + : null, true), enabled: false, ), @@ -238,41 +250,51 @@ class _AdmissionRequestSecondScreenState Container( height: screenSize.height * 0.070, child: InkWell( - onTap: - /*model.doctorsList != null && - model.doctorsList.length > 0 + onTap: model.admissionTypeList != null && + model.admissionTypeList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - :*/ - null, + openListDialogField('nameEn', 'id', + model.admissionTypeList, + (selectedValue) { + setState(() { + _selectedAdmissionType = + selectedValue; + }); + }); + } + : () async { + await model.getMasterLookup( + MasterKeysService + .AdmissionRequestType); + if (model.state == ViewState.Idle && + model.admissionTypeList.length > + 0) { + openListDialogField('nameEn', + 'id', model.admissionTypeList, + (selectedValue) { + setState(() { + _selectedAdmissionType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, child: TextField( decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context) .admissionType, - /* _admissionType != null - ? _admissionType['DoctorName'] - :*/ - null, + _selectedAdmissionType != null + ? _selectedAdmissionType[ + 'nameEn'] + : null, true), enabled: false, ), @@ -284,41 +306,51 @@ class _AdmissionRequestSecondScreenState Container( height: screenSize.height * 0.070, child: InkWell( - onTap: - /*model.doctorsList != null && - model.doctorsList.length > 0 + onTap: model.diagnosisTypesList != null && + model.diagnosisTypesList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - :*/ - null, + openListDialogField('nameEn', 'id', + model.diagnosisTypesList, + (selectedValue) { + setState(() { + _selectedDiagnosis = + selectedValue; + }); + }); + } + : () async { + await model.getDiagnosis(); + if (model.state == ViewState.Idle && + model.diagnosisTypesList + .length > + 0) { + openListDialogField( + 'nameEn', + 'id', + model.diagnosisTypesList, + (selectedValue) { + setState(() { + _selectedDiagnosis = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, child: TextField( decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context) .diagnosis, - /* _admissionType != null - ? _admissionType['DoctorName'] - :*/ - null, + _selectedDiagnosis != null + ? _selectedDiagnosis['nameEn'] + : null, true), enabled: false, ), @@ -347,41 +379,48 @@ class _AdmissionRequestSecondScreenState Container( height: screenSize.height * 0.070, child: InkWell( - onTap: - /*model.doctorsList != null && - model.doctorsList.length > 0 + onTap: model.allergiesList != null && + model.allergiesList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - :*/ - null, + openListDialogField('nameEn', 'id', + model.allergiesList, + (selectedValue) { + setState(() { + _selectedAllergies = + selectedValue; + }); + }); + } + : () async { + await model.getAllergies(); + if (model.state == ViewState.Idle && + model.allergiesList.length > + 0) { + openListDialogField('nameEn', + 'id', model.allergiesList, + (selectedValue) { + setState(() { + _selectedAllergies = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, child: TextField( decoration: Helpers.textFieldSelectorDecoration( TranslationBase.of(context) .allergies, - /* _admissionType != null - ? _admissionType['DoctorName'] - :*/ - null, + _selectedAllergies != null + ? _selectedAllergies['nameEn'] + : null, true), enabled: false, ), @@ -426,4 +465,59 @@ class _AdmissionRequestSecondScreenState updateDate(picked); } } + + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { + ListSelectDialog dialog = ListSelectDialog( + list: list, + attributeName: attributeName, + attributeValueId: attributeValueId, + usingSearch: true, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + okFunction(selectedValue); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + +/* + onTap: model.wardList != null && + model.wardList.length > 0 + ? () { + openListDialogField('description', + 'description', model.wardList, + (selectedValue) { + setState(() { + _selectedWard = selectedValue; + }); + }); + } + : () async { + await model.getWards(); + if (model.state == ViewState.Idle && + model.wardList.length > 0) { + openListDialogField('description', + 'description', model.wardList, + (selectedValue) { + setState(() { + _selectedWard = selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + */ } From 7505a6b6b0b0813fd115ffd91fdd7629b91556e7 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 31 Jan 2021 17:32:22 +0200 Subject: [PATCH 252/421] =?UTF-8?q?fix=20=C2=A0allergy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../subjective/update_allergies_widget.dart | 130 ++++++++++++------ .../soap_update/update_soap_index.dart | 2 +- 2 files changed, 90 insertions(+), 42 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart index 09297ab3..afd14809 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart @@ -31,9 +31,6 @@ class UpdateAllergiesWidget extends StatefulWidget { } class _UpdateAllergiesWidgetState extends State { - - TextEditingController remarkController = TextEditingController(); - @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -237,6 +234,9 @@ class _AddAllergiesState extends State { MasterKeyModel _selectedAllergySeverity; MasterKeyModel _selectedAllergy; TextEditingController remarkController = TextEditingController(); + TextEditingController severityController = TextEditingController(); + TextEditingController allergyController = TextEditingController(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @@ -244,23 +244,27 @@ class _AddAllergiesState extends State { String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, + fontSize: 10, + color: Theme + .of(context) + .hintColor, + fontWeight: FontWeight.w700 ), ); } @@ -314,6 +318,7 @@ class _AddAllergiesState extends State { ? () { setState(() { _selectedAllergy = null; + allergyController.text = null; }); } : null, @@ -326,7 +331,15 @@ class _AddAllergiesState extends State { ? _selectedAllergy.nameEn : null, true, icon: EvaIcons.search), itemSubmitted: (item) => - setState(() => _selectedAllergy = item), + setState(() { + _selectedAllergy = item; + allergyController.text = + projectViewModel.isArabic + ? _selectedAllergy + .nameAr + : _selectedAllergy + .nameEn; + }), key: key, suggestions: model.allergiesList, itemBuilder: (context, suggestion) => @@ -334,27 +347,44 @@ class _AddAllergiesState extends State { child: Texts( projectViewModel.isArabic ? suggestion .nameAr : suggestion.nameEn), - padding: EdgeInsets.all(8.0)), + padding: EdgeInsets.all(2.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => suggestion.nameAr.toLowerCase().startsWith( input.toLowerCase()) || suggestion.nameEn.toLowerCase() .startsWith(input.toLowerCase()), - ) : TextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .selectAllergy, - _selectedAllergy != null - ? projectViewModel.isArabic - ? _selectedAllergy.nameAr - : _selectedAllergy.nameEn - : null, - true, - icon: EvaIcons.search), - enabled: false, - ), + ) : + TextFields( + onTapTextFields: model.allergiesList != null + ? () { + setState(() { + _selectedAllergy = null; + allergyController.text = null; + }); + } + : null, + hasLabelText: allergyController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .selectAllergy, + fontSize: 13.5, + readOnly: true, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: allergyController, + suffixIcon: EvaIcons.search, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }) ), ), if(isFormSubmitted && _selectedAllergy == null) @@ -362,10 +392,9 @@ class _AddAllergiesState extends State { SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergySeverityList != null + TextFields( + onTapTextFields: model + .allergySeverityList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.allergySeverityList, @@ -376,6 +405,13 @@ class _AddAllergiesState extends State { setState(() { _selectedAllergySeverity = selectedValue; + + severityController.text = + projectViewModel.isArabic + ? _selectedAllergySeverity + .nameAr + : _selectedAllergySeverity + .nameEn; }); }, ); @@ -388,21 +424,33 @@ class _AddAllergiesState extends State { ); } : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .selectSeverity, - _selectedAllergySeverity != null - ? projectViewModel.isArabic?_selectedAllergySeverity.nameAr:_selectedAllergySeverity.nameEn - : null, - true), - enabled: false, - ), - ), + hasLabelText: severityController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .selectSeverity, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), SizedBox( + height: 5, ), - if(isFormSubmitted && _selectedAllergySeverity == null) + if(isFormSubmitted && + _selectedAllergySeverity == null) CustomValidationError(), + SizedBox( height: 10, ), diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 61e5a4b4..5c646121 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -37,7 +37,7 @@ class _UpdateSoapIndexState extends State GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex) { - changeLoadingState(true); + if (pageIndex != _currentIndex) changeLoadingState(true); _controller.jumpToPage(pageIndex); } From d66811546f18f3a36ca8a55a124cc22d6db4a0fb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 31 Jan 2021 20:37:37 +0200 Subject: [PATCH 253/421] refactoring my code --- .../prescription/prescription_screen.dart | 722 +---------------- .../update_prescription_form.dart | 746 ++++++++++++++++++ lib/screens/procedures/procedure_screen.dart | 17 - 3 files changed, 747 insertions(+), 738 deletions(-) create mode 100644 lib/screens/prescription/update_prescription_form.dart diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 238a3812..290aadca 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -1,30 +1,15 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription_form.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient_profile_widget.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:hexcolor/hexcolor.dart'; class NewPrescriptionScreen extends StatefulWidget { @override @@ -38,198 +23,10 @@ class _NewPrescriptionScreenState extends State { int testNum = 0; int strengthChar; PatiantInformtion patient; - dynamic route; - dynamic doseTime; - dynamic frequencyUpdate; - dynamic updatedDuration; - dynamic units; - - List doseTimeList; - List routeList; - List frequencyList; - List durationList; - List unitsList; @override void initState() { super.initState(); - routeList = List(); - doseTimeList = List(); - frequencyList = List(); - durationList = List(); - unitsList = List(); - - dynamic unit1 = {"id": 1, "name": "MG"}; - dynamic unit2 = {"id": 2, "name": "MCG"}; - dynamic unit3 = {"id": 3, "name": "GM"}; - dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; - dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; - dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; - dynamic frequency4 = {"id": 8, "name": "As Needed"}; - dynamic frequency5 = {"id": 9, "name": "Bed Time"}; - dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; - dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; - dynamic frequency8 = {"id": 34, "name": "As Directed"}; - dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; - dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; - dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; - dynamic frequency12 = {"id": 20, "name": "Once a Week"}; - dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; - dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; - dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; - dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; - dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; - dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; - dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; - dynamic doseTime2 = {"id": 2, "name": "After Meals"}; - dynamic doseTime3 = {"id": 3, "name": "With Meals"}; - dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; - dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; - dynamic doseTime6 = {"id": 6, "name": "After Supper"}; - dynamic doseTime7 = {"id": 7, "name": "With Supper"}; - dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; - dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; - dynamic doseTime10 = {"id": 10, "name": "While wake"}; - dynamic doseTime11 = {"id": 12, "name": "Any Time"}; - dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; - dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; - dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; - dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; - dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; - dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; - dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; - dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime21 = {"id": 11, "name": "Now"}; - dynamic route1 = {"id": 7, "name": "By Mouth"}; - dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; - dynamic route3 = {"id": 15, "name": "for INJECTION"}; - dynamic route4 = {"id": 17, "name": "Drops"}; - dynamic route5 = {"id": 18, "name": "Rub On"}; - dynamic route6 = {"id": 20, "name": "Spary"}; - dynamic route7 = {"id": 27, "name": "In Both EYES"}; - dynamic route8 = {"id": 28, "name": "In Both Ears"}; - dynamic route9 = {"id": 32, "name": "Intramuscular"}; - dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; - dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; - dynamic route12 = {"id": 15, "name": "for INJECTION"}; - dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; - dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; - dynamic route15 = {"id": 56, "name": "IRRIGATION"}; - dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; - dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; - dynamic route18 = {"id": 51, "name": "EPIDURAL"}; - dynamic route19 = {"id": 47, "name": "Parenteral"}; - dynamic route20 = {"id": 43, "name": "IM"}; - dynamic route21 = {"id": 42, "name": "IV"}; - dynamic route22 = {"id": 41, "name": "Sublingual"}; - dynamic route23 = {"id": 40, "name": "For Nebulization"}; - dynamic route24 = {"id": 39, "name": "Nasal"}; - dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; - dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; - dynamic route27 = {"id": 31, "name": "In Each Nostril"}; - dynamic duration1 = {"id": 1, "name": "For 1 Day"}; - dynamic duration2 = {"id": 2, "name": "For 2 Days"}; - dynamic duration3 = {"id": 3, "name": "For 3 Days"}; - dynamic duration4 = {"id": 4, "name": "For 4 Days"}; - dynamic duration5 = {"id": 5, "name": "For 5 Days"}; - dynamic duration6 = {"id": 6, "name": "For 6 Days"}; - dynamic duration7 = {"id": 7, "name": "For 7 Days"}; - dynamic duration8 = {"id": 8, "name": "For 8 Days"}; - dynamic duration9 = {"id": 9, "name": "For 9 Days"}; - dynamic duration10 = {"id": 10, "name": "For 10 Days"}; - dynamic duration11 = {"id": 14, "name": "For 14 Days"}; - dynamic duration12 = {"id": 21, "name": "For 21 Days"}; - dynamic duration13 = {"id": 30, "name": "For 30 Days"}; - dynamic duration14 = {"id": 45, "name": "For 45 Days"}; - dynamic duration15 = {"id": 60, "name": "For 60 Days"}; - dynamic duration16 = {"id": 90, "name": "For 90 Days"}; - - durationList.add(duration1); - durationList.add(duration2); - durationList.add(duration3); - durationList.add(duration4); - durationList.add(duration5); - durationList.add(duration6); - durationList.add(duration7); - durationList.add(duration8); - durationList.add(duration9); - durationList.add(duration10); - durationList.add(duration11); - durationList.add(duration12); - durationList.add(duration13); - durationList.add(duration14); - durationList.add(duration15); - durationList.add(duration16); - frequencyList.add(frequency1); - frequencyList.add(frequency2); - frequencyList.add(frequency3); - frequencyList.add(frequency4); - frequencyList.add(frequency5); - frequencyList.add(frequency6); - frequencyList.add(frequency7); - frequencyList.add(frequency8); - frequencyList.add(frequency9); - frequencyList.add(frequency10); - frequencyList.add(frequency11); - frequencyList.add(frequency12); - frequencyList.add(frequency13); - frequencyList.add(frequency14); - frequencyList.add(frequency15); - frequencyList.add(frequency16); - frequencyList.add(frequency17); - frequencyList.add(frequency18); - doseTimeList.add(doseTime1); - doseTimeList.add(doseTime2); - doseTimeList.add(doseTime3); - doseTimeList.add(doseTime4); - doseTimeList.add(doseTime5); - doseTimeList.add(doseTime6); - doseTimeList.add(doseTime7); - doseTimeList.add(doseTime8); - doseTimeList.add(doseTime9); - doseTimeList.add(doseTime10); - doseTimeList.add(doseTime11); - doseTimeList.add(doseTime12); - doseTimeList.add(doseTime13); - doseTimeList.add(doseTime14); - doseTimeList.add(doseTime15); - doseTimeList.add(doseTime16); - doseTimeList.add(doseTime17); - doseTimeList.add(doseTime18); - doseTimeList.add(doseTime19); - doseTimeList.add(doseTime20); - doseTimeList.add(doseTime21); - routeList.add(route1); - routeList.add(route2); - routeList.add(route3); - routeList.add(route4); - routeList.add(route5); - routeList.add(route6); - routeList.add(route7); - routeList.add(route8); - routeList.add(route9); - routeList.add(route10); - routeList.add(route11); - routeList.add(route12); - routeList.add(route13); - routeList.add(route14); - routeList.add(route15); - routeList.add(route16); - routeList.add(route17); - routeList.add(route18); - routeList.add(route19); - routeList.add(route20); - routeList.add(route21); - routeList.add(route22); - routeList.add(route23); - routeList.add(route24); - routeList.add(route25); - routeList.add(route26); - routeList.add(route27); - unitsList.add(unit1); - unitsList.add(unit2); - unitsList.add(unit3); } Widget build(BuildContext context) { @@ -773,521 +570,4 @@ class _NewPrescriptionScreenState extends State { }); } } - - void updatePrescriptionForm( - {context, - String drugName, - int drugId, - String remarks, - PrescriptionViewModel model, - PatiantInformtion patient, - String rouat, - String frequency, - String dose, - String duration, - String doseStreangth, - String doseUnit, - String enteredRemarks, - String startDate}) { - TextEditingController remarksController = TextEditingController(); - TextEditingController doseController = TextEditingController(); - TextEditingController frequencyController = TextEditingController(); - TextEditingController routeController = TextEditingController(); - showModalBottomSheet( - context: context, - isScrollControlled: true, - builder: (BuildContext context) { - return StatefulBuilder(builder: (BuildContext context, - StateSetter setState /*You can rename this!*/) { - return DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( - children: [ - Container( - height: MediaQuery.of(context).size.height * - 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.500, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 4) - ], - hintText: - TranslationBase.of(context) - .strength, - controller: strengthController, - keyboardType: TextInputType.number, - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 4) { - DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, - child: InkWell( - onTap: unitsList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: unitsList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units['name'] - : null, - true), - enabled: false, - ), - ), - ), - ], - ), - ), - SizedBox( - height: 12, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: routeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: routeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'Route', - route != null - ? route['name'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: doseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: doseTimeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['name'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: frequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: frequencyList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate['name'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: durationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: durationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration['name'] - .toString() - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, - ), - ), - SizedBox( - height: 12.0, - ), - SizedBox( - height: MediaQuery.of(context).size.height * - 0.12, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription' - .toUpperCase(), - onPressed: () { - updatePrescription( - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : doseStreangth, - newUnit: units != null - ? units['id'].toString() - : doseUnit, - doseUnit: doseUnit, - doseStreangth: doseStreangth, - duration: duration, - startDate: startDate, - doseId: dose, - frequencyId: frequency, - routeId: rouat, - patient: patient, - model: model, - newDuration: updatedDuration != - null - ? updatedDuration['id'] - .toString() - : duration, - drugId: drugId, - remarks: remarksController.text, - route: route != null - ? route['id'].toString() - : rouat, - frequency: frequencyUpdate != null - ? frequencyUpdate['id'] - .toString() - : frequency, - dose: doseTime != null - ? doseTime['id'].toString() - : dose, - enteredRemarks: enteredRemarks); - Navigator.pop(context); - }, - ), - ], - ), - ), - ], - ), - ], - ), - ), - )); - }); - }); - }); - } - - // String getName(String num) { - // dynamic x = routeList.where((i) { - // return i['id'] == int.parse(num); - // }).first(); - // return x.toString(); - // } - - updatePrescription( - {PrescriptionViewModel model, - int drugId, - String frequencyId, - String remarks, - String dose, - String doseId, - String frequency, - String route, - String routeId, - String startDate, - String doseUnit, - String doseStreangth, - String newDoseStreangth, - String duration, - String newDuration, - String newUnit, - String enteredRemarks, - PatiantInformtion patient}) async { - //PrescriptionViewModel model = PrescriptionViewModel(); - PostPrescriptionReqModel updatePrescriptionReqModel = - new PostPrescriptionReqModel(); - List sss = List(); - - updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; - updatePrescriptionReqModel.clinicID = patient.clinicId; - updatePrescriptionReqModel.episodeID = patient.episodeNo; - updatePrescriptionReqModel.patientMRN = patient.patientMRN; - - sss.add(PrescriptionRequestModel( - covered: true, - dose: newDoseStreangth.isNotEmpty - ? int.parse(newDoseStreangth) - : int.parse(doseStreangth), - //frequency.isNotEmpty ? int.parse(dose) : 1, - itemId: drugId, - doseUnitId: - newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), - route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), - frequency: frequency.isNotEmpty - ? int.parse(frequency) - : int.parse(frequencyId), - remarks: remarks.isEmpty ? enteredRemarks : remarks, - approvalRequired: true, - icdcode10Id: "test2", - doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), - duration: newDuration.isNotEmpty - ? int.parse(newDuration) - : int.parse(duration), - doseStartDate: startDate)); - updatePrescriptionReqModel.prescriptionRequestModel = sss; - //postProcedureReqModel.procedures = controlsProcedure; - - await model.updatePrescription( - updatePrescriptionReqModel, patient.patientMRN); - - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('Medication has been updated'); - } - } - - InputDecoration textFieldSelectorDecoration( - String hintText, String selectedText, bool isDropDown, - {Icon suffixIcon}) { - return InputDecoration( - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), - borderRadius: BorderRadius.circular(8), - ), - hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown - ? suffixIcon != null - ? suffixIcon - : Icon( - Icons.arrow_drop_down, - color: Colors.black, - ) - : null, - hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), - ); - } } diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart new file mode 100644 index 00000000..01986813 --- /dev/null +++ b/lib/screens/prescription/update_prescription_form.dart @@ -0,0 +1,746 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.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/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class UpdatePrescriptionForm extends StatefulWidget { + final String drugName; + final String doseStreangth; + final int drugId; + final String remarks; + final PatiantInformtion patient; + final String duration; + final String route; + final String dose; + final String doseUnit; + final String enteredRemarks; + final String startDate; + final String frequency; + final PrescriptionViewModel model; + + UpdatePrescriptionForm( + {this.drugName, + this.doseStreangth, + this.drugId, + this.remarks, + this.patient, + this.duration, + this.route, + this.dose, + this.startDate, + this.doseUnit, + this.enteredRemarks, + this.frequency, + this.model}); + @override + _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); +} + +class _UpdatePrescriptionFormState extends State { + TextEditingController strengthController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + int testNum = 0; + int strengthChar; + PatiantInformtion patient; + dynamic route; + dynamic doseTime; + dynamic frequencyUpdate; + dynamic updatedDuration; + dynamic units; + + List doseTimeList; + List routeList; + List frequencyList; + List durationList; + List unitsList; + + @override + void initState() { + super.initState(); + routeList = List(); + doseTimeList = List(); + frequencyList = List(); + durationList = List(); + unitsList = List(); + + dynamic unit1 = {"id": 1, "name": "MG"}; + dynamic unit2 = {"id": 2, "name": "MCG"}; + dynamic unit3 = {"id": 3, "name": "GM"}; + dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; + dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; + dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; + dynamic frequency4 = {"id": 8, "name": "As Needed"}; + dynamic frequency5 = {"id": 9, "name": "Bed Time"}; + dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; + dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; + dynamic frequency8 = {"id": 34, "name": "As Directed"}; + dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; + dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; + dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; + dynamic frequency12 = {"id": 20, "name": "Once a Week"}; + dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; + dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; + dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; + dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; + dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; + dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; + dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; + dynamic doseTime2 = {"id": 2, "name": "After Meals"}; + dynamic doseTime3 = {"id": 3, "name": "With Meals"}; + dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; + dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; + dynamic doseTime6 = {"id": 6, "name": "After Supper"}; + dynamic doseTime7 = {"id": 7, "name": "With Supper"}; + dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; + dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; + dynamic doseTime10 = {"id": 10, "name": "While wake"}; + dynamic doseTime11 = {"id": 12, "name": "Any Time"}; + dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; + dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; + dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; + dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; + dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; + dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; + dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; + dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; + dynamic doseTime21 = {"id": 11, "name": "Now"}; + dynamic route1 = {"id": 7, "name": "By Mouth"}; + dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; + dynamic route3 = {"id": 15, "name": "for INJECTION"}; + dynamic route4 = {"id": 17, "name": "Drops"}; + dynamic route5 = {"id": 18, "name": "Rub On"}; + dynamic route6 = {"id": 20, "name": "Spary"}; + dynamic route7 = {"id": 27, "name": "In Both EYES"}; + dynamic route8 = {"id": 28, "name": "In Both Ears"}; + dynamic route9 = {"id": 32, "name": "Intramuscular"}; + dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; + dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; + dynamic route12 = {"id": 15, "name": "for INJECTION"}; + dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; + dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; + dynamic route15 = {"id": 56, "name": "IRRIGATION"}; + dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; + dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; + dynamic route18 = {"id": 51, "name": "EPIDURAL"}; + dynamic route19 = {"id": 47, "name": "Parenteral"}; + dynamic route20 = {"id": 43, "name": "IM"}; + dynamic route21 = {"id": 42, "name": "IV"}; + dynamic route22 = {"id": 41, "name": "Sublingual"}; + dynamic route23 = {"id": 40, "name": "For Nebulization"}; + dynamic route24 = {"id": 39, "name": "Nasal"}; + dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; + dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; + dynamic route27 = {"id": 31, "name": "In Each Nostril"}; + dynamic duration1 = {"id": 1, "name": "For 1 Day"}; + dynamic duration2 = {"id": 2, "name": "For 2 Days"}; + dynamic duration3 = {"id": 3, "name": "For 3 Days"}; + dynamic duration4 = {"id": 4, "name": "For 4 Days"}; + dynamic duration5 = {"id": 5, "name": "For 5 Days"}; + dynamic duration6 = {"id": 6, "name": "For 6 Days"}; + dynamic duration7 = {"id": 7, "name": "For 7 Days"}; + dynamic duration8 = {"id": 8, "name": "For 8 Days"}; + dynamic duration9 = {"id": 9, "name": "For 9 Days"}; + dynamic duration10 = {"id": 10, "name": "For 10 Days"}; + dynamic duration11 = {"id": 14, "name": "For 14 Days"}; + dynamic duration12 = {"id": 21, "name": "For 21 Days"}; + dynamic duration13 = {"id": 30, "name": "For 30 Days"}; + dynamic duration14 = {"id": 45, "name": "For 45 Days"}; + dynamic duration15 = {"id": 60, "name": "For 60 Days"}; + dynamic duration16 = {"id": 90, "name": "For 90 Days"}; + + durationList.add(duration1); + durationList.add(duration2); + durationList.add(duration3); + durationList.add(duration4); + durationList.add(duration5); + durationList.add(duration6); + durationList.add(duration7); + durationList.add(duration8); + durationList.add(duration9); + durationList.add(duration10); + durationList.add(duration11); + durationList.add(duration12); + durationList.add(duration13); + durationList.add(duration14); + durationList.add(duration15); + durationList.add(duration16); + frequencyList.add(frequency1); + frequencyList.add(frequency2); + frequencyList.add(frequency3); + frequencyList.add(frequency4); + frequencyList.add(frequency5); + frequencyList.add(frequency6); + frequencyList.add(frequency7); + frequencyList.add(frequency8); + frequencyList.add(frequency9); + frequencyList.add(frequency10); + frequencyList.add(frequency11); + frequencyList.add(frequency12); + frequencyList.add(frequency13); + frequencyList.add(frequency14); + frequencyList.add(frequency15); + frequencyList.add(frequency16); + frequencyList.add(frequency17); + frequencyList.add(frequency18); + doseTimeList.add(doseTime1); + doseTimeList.add(doseTime2); + doseTimeList.add(doseTime3); + doseTimeList.add(doseTime4); + doseTimeList.add(doseTime5); + doseTimeList.add(doseTime6); + doseTimeList.add(doseTime7); + doseTimeList.add(doseTime8); + doseTimeList.add(doseTime9); + doseTimeList.add(doseTime10); + doseTimeList.add(doseTime11); + doseTimeList.add(doseTime12); + doseTimeList.add(doseTime13); + doseTimeList.add(doseTime14); + doseTimeList.add(doseTime15); + doseTimeList.add(doseTime16); + doseTimeList.add(doseTime17); + doseTimeList.add(doseTime18); + doseTimeList.add(doseTime19); + doseTimeList.add(doseTime20); + doseTimeList.add(doseTime21); + routeList.add(route1); + routeList.add(route2); + routeList.add(route3); + routeList.add(route4); + routeList.add(route5); + routeList.add(route6); + routeList.add(route7); + routeList.add(route8); + routeList.add(route9); + routeList.add(route10); + routeList.add(route11); + routeList.add(route12); + routeList.add(route13); + routeList.add(route14); + routeList.add(route15); + routeList.add(route16); + routeList.add(route17); + routeList.add(route18); + routeList.add(route19); + routeList.add(route20); + routeList.add(route21); + routeList.add(route22); + routeList.add(route23); + routeList.add(route24); + routeList.add(route25); + routeList.add(route26); + routeList.add(route27); + unitsList.add(unit1); + unitsList.add(unit2); + unitsList.add(unit3); + } + + @override + Widget build(BuildContext context) { + return StatefulBuilder(builder: + (BuildContext context, StateSetter setState /*You can rename this!*/) { + return DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.6, + builder: (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.drugName.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 10.0, + ), + Column( + children: [ + Container( + height: + MediaQuery.of(context).size.height * 0.060, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * + 0.500, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter(4) + ], + hintText: + TranslationBase.of(context).strength, + controller: strengthController, + keyboardType: TextInputType.number, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + width: 10.0, + ), + Container( + width: MediaQuery.of(context).size.width * + 0.3700, + child: InkWell( + onTap: unitsList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: unitsList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['name'] + : null, + true), + enabled: false, + ), + ), + ), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: routeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: routeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + 'Route', + route != null ? route['name'] : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: doseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: doseTimeList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: frequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: frequencyList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequencyUpdate != null + ? frequencyUpdate['name'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * 0.070, + child: InkWell( + onTap: durationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: durationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + updatedDuration != null + ? updatedDuration['name'].toString() + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + controller: remarksController, + maxLines: 7, + minLines: 4, + ), + ), + SizedBox( + height: 12.0, + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.12, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'update prescription'.toUpperCase(), + onPressed: () { + updatePrescription( + newDoseStreangth: + strengthController.text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, + newUnit: units != null + ? units['id'].toString() + : widget.doseUnit, + doseUnit: widget.doseUnit, + doseStreangth: widget.doseStreangth, + duration: widget.duration, + startDate: widget.startDate, + doseId: widget.dose, + frequencyId: widget.frequency, + routeId: widget.route, + patient: widget.patient, + model: widget.model, + newDuration: updatedDuration != null + ? updatedDuration['id'].toString() + : widget.duration, + drugId: widget.drugId, + remarks: remarksController.text, + route: route != null + ? route['id'].toString() + : widget.route, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'].toString() + : widget.frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : widget.dose, + enteredRemarks: + widget.enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), + ), + ], + ), + ], + ), + ), + )); + }); + }); + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } + + updatePrescription( + {PrescriptionViewModel model, + int drugId, + String frequencyId, + String remarks, + String dose, + String doseId, + String frequency, + String route, + String routeId, + String startDate, + String doseUnit, + String doseStreangth, + String newDoseStreangth, + String duration, + String newDuration, + String newUnit, + String enteredRemarks, + PatiantInformtion patient}) async { + //PrescriptionViewModel model = PrescriptionViewModel(); + PostPrescriptionReqModel updatePrescriptionReqModel = + new PostPrescriptionReqModel(); + List sss = List(); + + updatePrescriptionReqModel.appointmentNo = patient.appointmentNo; + updatePrescriptionReqModel.clinicID = patient.clinicId; + updatePrescriptionReqModel.episodeID = patient.episodeNo; + updatePrescriptionReqModel.patientMRN = patient.patientMRN; + + sss.add(PrescriptionRequestModel( + covered: true, + dose: newDoseStreangth.isNotEmpty + ? int.parse(newDoseStreangth) + : int.parse(doseStreangth), + //frequency.isNotEmpty ? int.parse(dose) : 1, + itemId: drugId, + doseUnitId: + newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), + route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), + frequency: frequency.isNotEmpty + ? int.parse(frequency) + : int.parse(frequencyId), + remarks: remarks.isEmpty ? enteredRemarks : remarks, + approvalRequired: true, + icdcode10Id: "test2", + doseTime: dose.isNotEmpty ? int.parse(dose) : int.parse(doseId), + duration: newDuration.isNotEmpty + ? int.parse(newDuration) + : int.parse(duration), + doseStartDate: startDate)); + updatePrescriptionReqModel.prescriptionRequestModel = sss; + //postProcedureReqModel.procedures = controlsProcedure; + + await model.updatePrescription( + updatePrescriptionReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('Medication has been updated'); + } + } +} + +void updatePrescriptionForm( + {context, + String drugName, + int drugId, + String remarks, + PrescriptionViewModel model, + PatiantInformtion patient, + String rouat, + String frequency, + String dose, + String duration, + String doseStreangth, + String doseUnit, + String enteredRemarks, + String startDate}) { + TextEditingController remarksController = TextEditingController(); + TextEditingController doseController = TextEditingController(); + TextEditingController frequencyController = TextEditingController(); + TextEditingController routeController = TextEditingController(); + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext context) { + return UpdatePrescriptionForm( + drugName: drugName, + patient: patient, + doseStreangth: doseStreangth, + remarks: remarks, + drugId: drugId, + enteredRemarks: enteredRemarks, + duration: duration, + dose: dose, + doseUnit: doseUnit, + frequency: frequency, + route: rouat, + startDate: startDate, + model: model, + ); + }); +} diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 9fb8510c..ca126609 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -1,32 +1,15 @@ -import 'package:doctor_app_flutter/client/base_app_client.dart'; -import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; -import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; -import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; -import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; -import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.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/screens/procedures/add-procedure-form.dart'; -import 'package:doctor_app_flutter/screens/procedures/entity_list_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/update-procedure.dart'; -import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient_profile_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class ProcedureScreen extends StatefulWidget { @override From 15dd0f7c1a222d9dbff984577500a3d314e5c14e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Feb 2021 13:58:46 +0200 Subject: [PATCH 254/421] bug fix --- lib/core/enum/master_lookup_key.dart | 28 +- lib/core/service/base/lookup-service.dart | 77 +- lib/core/service/prescription_service.dart | 3 +- lib/core/viewModel/medicine_view_model.dart | 94 +- .../prescription/add_prescription_form.dart | 262 +---- .../prescription/prescription_screen.dart | 1 - .../update_prescription_form.dart | 918 ++++++++---------- lib/screens/procedures/update-procedure.dart | 306 ++++-- 8 files changed, 832 insertions(+), 857 deletions(-) diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index f1ba1d46..58faa986 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -12,7 +12,13 @@ enum MasterKeysService { DiagnosisType, ICD10, TemperatureMethods, - Speciality + Speciality, + MedicationStrength, + MedicationDuration, + MedicationRoute, + MedicationFrequency, + MedicationDoseTime, + MedicationIndications, } extension SelectedMasterKeysService on MasterKeysService { @@ -45,7 +51,8 @@ extension SelectedMasterKeysService on MasterKeysService { break; case MasterKeysService.physiotherapyGoals: return 117; - break;case MasterKeysService.DiagnosisCondition: + break; + case MasterKeysService.DiagnosisCondition: return 34; break; case MasterKeysService.DiagnosisType: @@ -57,6 +64,23 @@ extension SelectedMasterKeysService on MasterKeysService { return 2005; case MasterKeysService.Speciality: return 10; + case MasterKeysService.MedicationStrength: + return 2100; + break; + case MasterKeysService.MedicationDuration: + return 118; + break; + case MasterKeysService.MedicationRoute: + return 32; + break; + case MasterKeysService.MedicationFrequency: + return 31; + break; + case MasterKeysService.MedicationDoseTime: + return 30; + break; + case MasterKeysService.MedicationIndications: + return 450; break; } } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 3bc6e61e..1acc8cec 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -11,6 +11,13 @@ class LookupService extends BaseService { List get allergySeverityList => _allergySeverityList; List _allergySeverityList = []; + List medicationStrengthList = []; + List medicationDurationList = []; + List medicationRouteList = []; + List medicationFrequencyList = []; + List medicationDoseTimeList = []; + List medicationIndicationsList = []; + List get historyFamilyList => _historyFamilyList; List _historyFamilyList = []; @@ -32,11 +39,11 @@ class LookupService extends BaseService { List _physicalExaminationList = []; // List listOfPhysiotherapyGoals = []; - List listOfDiagnosisType = []; - List listOfDiagnosisCondition = []; - List listOfICD10 = []; - List listOfTemperatureMethods = []; - List listOfSpeciality = []; + List listOfDiagnosisType = []; + List listOfDiagnosisCondition = []; + List listOfICD10 = []; + List listOfTemperatureMethods = []; + List listOfSpeciality = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -110,42 +117,72 @@ class LookupService extends BaseService { }); break; - case MasterKeysService.DiagnosisType: - listOfDiagnosisType.clear(); + case MasterKeysService.DiagnosisType: + listOfDiagnosisType.clear(); entryList.forEach((v) { - listOfDiagnosisType - .add(MasterKeyModel.fromJson(v)); + listOfDiagnosisType.add(MasterKeyModel.fromJson(v)); }); break; - case MasterKeysService.DiagnosisCondition: - listOfDiagnosisCondition.clear(); + case MasterKeysService.DiagnosisCondition: + listOfDiagnosisCondition.clear(); entryList.forEach((v) { - listOfDiagnosisCondition - .add(MasterKeyModel.fromJson(v)); + listOfDiagnosisCondition.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.ICD10: listOfICD10.clear(); entryList.forEach((v) { - listOfICD10 - .add(MasterKeyModel.fromJson(v)); + listOfICD10.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.TemperatureMethods: listOfTemperatureMethods.clear(); entryList.forEach((v) { - listOfTemperatureMethods - .add(MasterKeyModel.fromJson(v)); + listOfTemperatureMethods.add(MasterKeyModel.fromJson(v)); }); break; case MasterKeysService.Speciality: listOfSpeciality.clear(); entryList.forEach((v) { - listOfSpeciality - .add(MasterKeyModel.fromJson(v)); + listOfSpeciality.add(MasterKeyModel.fromJson(v)); + }); + break; + case MasterKeysService.MedicationStrength: + medicationStrengthList.clear(); + entryList.forEach((v) { + medicationStrengthList.add(v); + }); + break; + case MasterKeysService.MedicationDuration: + medicationDurationList.clear(); + entryList.forEach((v) { + medicationDurationList.add(v); + }); + break; + case MasterKeysService.MedicationRoute: + medicationRouteList.clear(); + entryList.forEach((v) { + medicationRouteList.add(v); + }); + break; + case MasterKeysService.MedicationFrequency: + medicationFrequencyList.clear(); + entryList.forEach((v) { + medicationFrequencyList.add(v); + }); + break; + case MasterKeysService.MedicationDoseTime: + medicationDoseTimeList.clear(); + entryList.forEach((v) { + medicationDoseTimeList.add(v); + }); + break; + case MasterKeysService.MedicationIndications: + medicationIndicationsList.clear(); + entryList.forEach((v) { + medicationIndicationsList.add(v); }); break; } } - } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 9fcf4c2d..b7f9e80e 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -6,12 +6,13 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; -class PrescriptionService extends BaseService { +class PrescriptionService extends LookupService { List _prescriptionList = List(); List get prescriptionList => _prescriptionList; List _drugsList = List(); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 23dd0306..5b7c2f6a 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -1,5 +1,7 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; @@ -8,10 +10,25 @@ import 'base_view_model.dart'; class MedicineViewModel extends BaseViewModel { MedicineService _medicineService = locator(); + PrescriptionService _prescriptionService = locator(); + get pharmacyItemsList => _medicineService.pharmacyItemsList; + get pharmaciesList => _medicineService.pharmaciesList; - PrescriptionService _prescriptionService = locator(); + get medicationStrengthList => _prescriptionService.medicationStrengthList; + + get medicationDurationList => _prescriptionService.medicationDurationList; + + get medicationRouteList => _prescriptionService.medicationRouteList; + + get medicationFrequencyList => _prescriptionService.medicationFrequencyList; + + get medicationIndicationsList => + _prescriptionService.medicationIndicationsList; + + get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; + List get allMedicationList => _prescriptionService.allMedicationList; @@ -35,6 +52,72 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMedicationStrength() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationStrength); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMedicationRoute() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationRoute); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMedicationIndications() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationIndications); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMedicationDoseTime() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationDoseTime); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMedicationFrequency() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationFrequency); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + Future getMedicationDuration() async { + setState(ViewState.Busy); + await _prescriptionService + .getMasterLookup(MasterKeysService.MedicationDuration); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getPharmaciesList(int itemId) async { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); @@ -44,4 +127,13 @@ class MedicineViewModel extends BaseViewModel { } else setState(ViewState.Idle); } + + dynamic getLookupById(List list, String id) { + for (int i = 0; i < list.length; i++) { + if (list[i]['id'].toString() == id) { + return list[i]; + } + } + return null; + } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 1d481904..a8279634 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -127,13 +127,7 @@ class _PrescriptionFormWidgetState extends State { dynamic indication; dynamic units; - List strengthList; - List routeList; - List frequencyList; - List durationList; - List doseTimeList; List indicationList; - List unitsList; String routeInatial = 'By Mouth'; //PatiantInformtion patient; @@ -142,111 +136,9 @@ class _PrescriptionFormWidgetState extends State { super.initState(); selectedType = 1; referToList = List(); - strengthList = List(); - routeList = List(); - frequencyList = List(); - durationList = List(); - doseTimeList = List(); - indicationList = List(); - unitsList = List(); - dynamic unit1 = {"id": 1, "name": "MG"}; - dynamic unit2 = {"id": 2, "name": "MCG"}; - dynamic unit3 = {"id": 3, "name": "GM"}; - dynamic regularOrder = {"id": 1, "name": "regular Order"}; - dynamic urgentOrder = {"id": 2, "name": "urgent Order"}; - dynamic strength1 = {"id": 1, "name": "1"}; - dynamic strength2 = {"id": 2, "name": "2"}; - dynamic strength3 = {"id": 3, "name": "3"}; - dynamic strength4 = {"id": 4, "name": "4"}; - dynamic strength5 = {"id": 5, "name": "5"}; - dynamic strength6 = {"id": 6, "name": "6"}; - dynamic strength7 = {"id": 7, "name": "7"}; - dynamic strength8 = {"id": 8, "name": "8"}; - dynamic strength9 = {"id": 9, "name": "9"}; - dynamic route1 = {"id": 7, "name": "By Mouth"}; - dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; - dynamic route3 = {"id": 15, "name": "for INJECTION"}; - dynamic route4 = {"id": 17, "name": "Drops"}; - dynamic route5 = {"id": 18, "name": "Rub On"}; - dynamic route6 = {"id": 20, "name": "Spary"}; - dynamic route7 = {"id": 27, "name": "In Both EYES"}; - dynamic route8 = {"id": 28, "name": "In Both Ears"}; - dynamic route9 = {"id": 32, "name": "Intramuscular"}; - dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; - dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; - dynamic route12 = {"id": 15, "name": "for INJECTION"}; - dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; - dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; - dynamic route15 = {"id": 56, "name": "IRRIGATION"}; - dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; - dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; - dynamic route18 = {"id": 51, "name": "EPIDURAL"}; - dynamic route19 = {"id": 47, "name": "Parenteral"}; - dynamic route20 = {"id": 43, "name": "IM"}; - dynamic route21 = {"id": 42, "name": "IV"}; - dynamic route22 = {"id": 41, "name": "Sublingual"}; - dynamic route23 = {"id": 40, "name": "For Nebulization"}; - dynamic route24 = {"id": 39, "name": "Nasal"}; - dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; - dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; - dynamic route27 = {"id": 31, "name": "In Each Nostril"}; - dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; - dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; - dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; - dynamic frequency4 = {"id": 8, "name": "As Needed"}; - dynamic frequency5 = {"id": 9, "name": "Bed Time"}; - dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; - dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; - dynamic frequency8 = {"id": 34, "name": "As Directed"}; - dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; - dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; - dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; - dynamic frequency12 = {"id": 20, "name": "Once a Week"}; - dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; - dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; - dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; - dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; - dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; - dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; + indicationList = List(); - dynamic duration1 = {"id": 1, "name": "For 1 Day"}; - dynamic duration2 = {"id": 2, "name": "For 2 Days"}; - dynamic duration3 = {"id": 3, "name": "For 3 Days"}; - dynamic duration4 = {"id": 4, "name": "For 4 Days"}; - dynamic duration5 = {"id": 5, "name": "For 5 Days"}; - dynamic duration6 = {"id": 6, "name": "For 6 Days"}; - dynamic duration7 = {"id": 7, "name": "For 7 Days"}; - dynamic duration8 = {"id": 8, "name": "For 8 Days"}; - dynamic duration9 = {"id": 9, "name": "For 9 Days"}; - dynamic duration10 = {"id": 10, "name": "For 10 Days"}; - dynamic duration11 = {"id": 14, "name": "For 14 Days"}; - dynamic duration12 = {"id": 21, "name": "For 21 Days"}; - dynamic duration13 = {"id": 30, "name": "For 30 Days"}; - dynamic duration14 = {"id": 45, "name": "For 45 Days"}; - dynamic duration15 = {"id": 60, "name": "For 60 Days"}; - dynamic duration16 = {"id": 90, "name": "For 90 Days"}; - dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; - dynamic doseTime2 = {"id": 2, "name": "After Meals"}; - dynamic doseTime3 = {"id": 3, "name": "With Meals"}; - dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; - dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; - dynamic doseTime6 = {"id": 6, "name": "After Supper"}; - dynamic doseTime7 = {"id": 7, "name": "With Supper"}; - dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; - dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; - dynamic doseTime10 = {"id": 10, "name": "While wake"}; - dynamic doseTime11 = {"id": 12, "name": "Any Time"}; - dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; - dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; - dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; - dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; - dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; - dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; - dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; - dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime21 = {"id": 11, "name": "Now"}; dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; @@ -261,9 +153,6 @@ class _PrescriptionFormWidgetState extends State { dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; - unitsList.add(unit1); - unitsList.add(unit2); - unitsList.add(unit3); indicationList.add(indication1); indicationList.add(indication2); indicationList.add(indication3); @@ -274,102 +163,6 @@ class _PrescriptionFormWidgetState extends State { indicationList.add(indication8); indicationList.add(indication9); indicationList.add(indication10); - - doseTimeList.add(doseTime1); - doseTimeList.add(doseTime2); - doseTimeList.add(doseTime3); - doseTimeList.add(doseTime4); - doseTimeList.add(doseTime5); - doseTimeList.add(doseTime6); - doseTimeList.add(doseTime7); - doseTimeList.add(doseTime8); - doseTimeList.add(doseTime9); - doseTimeList.add(doseTime10); - doseTimeList.add(doseTime11); - doseTimeList.add(doseTime12); - doseTimeList.add(doseTime13); - doseTimeList.add(doseTime14); - doseTimeList.add(doseTime15); - doseTimeList.add(doseTime16); - doseTimeList.add(doseTime17); - doseTimeList.add(doseTime18); - doseTimeList.add(doseTime19); - doseTimeList.add(doseTime20); - doseTimeList.add(doseTime21); - - doseTimeList.add(doseTime12); - frequencyList.add(frequency1); - frequencyList.add(frequency2); - frequencyList.add(frequency3); - frequencyList.add(frequency4); - frequencyList.add(frequency5); - frequencyList.add(frequency6); - frequencyList.add(frequency7); - frequencyList.add(frequency8); - frequencyList.add(frequency9); - frequencyList.add(frequency10); - frequencyList.add(frequency11); - frequencyList.add(frequency12); - frequencyList.add(frequency13); - frequencyList.add(frequency14); - frequencyList.add(frequency15); - frequencyList.add(frequency16); - frequencyList.add(frequency17); - frequencyList.add(frequency18); - routeList.add(route1); - routeList.add(route2); - routeList.add(route3); - routeList.add(route4); - routeList.add(route5); - routeList.add(route6); - routeList.add(route7); - routeList.add(route8); - routeList.add(route9); - routeList.add(route10); - routeList.add(route11); - routeList.add(route12); - routeList.add(route13); - routeList.add(route14); - routeList.add(route15); - routeList.add(route16); - routeList.add(route17); - routeList.add(route18); - routeList.add(route19); - routeList.add(route20); - routeList.add(route21); - routeList.add(route22); - routeList.add(route23); - routeList.add(route24); - routeList.add(route25); - routeList.add(route26); - routeList.add(route27); - strengthList.add(strength1); - strengthList.add(strength2); - strengthList.add(strength3); - strengthList.add(strength4); - strengthList.add(strength5); - strengthList.add(strength6); - strengthList.add(strength7); - strengthList.add(strength8); - strengthList.add(strength9); - durationList.add(duration1); - durationList.add(duration2); - durationList.add(duration3); - durationList.add(duration4); - durationList.add(duration5); - durationList.add(duration6); - durationList.add(duration7); - durationList.add(duration8); - durationList.add(duration9); - durationList.add(duration10); - durationList.add(duration11); - durationList.add(duration12); - durationList.add(duration13); - durationList.add(duration14); - durationList.add(duration15); - durationList.add(duration16); - referToList.add(regularOrder); - referToList.add(urgentOrder); } setSelectedType(int val) { @@ -388,6 +181,12 @@ class _PrescriptionFormWidgetState extends State { return BaseView( onModelReady: (model) async { await model.getMedicationList(); + await model.getMedicationStrength(); + await model.getMedicationDuration(); + await model.getMedicationRoute(); + await model.getMedicationFrequency(); + await model.getMedicationDoseTime(); + await model.getMedicationIndications(); }, builder: (BuildContext context, MedicineViewModel model, Widget child) => NetworkBaseView( @@ -564,12 +363,14 @@ class _PrescriptionFormWidgetState extends State { MediaQuery.of(context).size.width * 0.350, child: InkWell( - onTap: unitsList != null + onTap: model.medicationStrengthList != + null ? () { ListSelectDialog dialog = ListSelectDialog( - list: unitsList, - attributeName: 'name', + list: model + .medicationStrengthList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of( context) @@ -596,7 +397,7 @@ class _PrescriptionFormWidgetState extends State { textFieldSelectorDecoration( 'UNIT Type', units != null - ? units['name'] + ? units['nameEn'] : null, true), enabled: false, @@ -610,12 +411,12 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: routeList != null + onTap: model.medicationRouteList != null ? () { ListSelectDialog dialog = ListSelectDialog( - list: routeList, - attributeName: 'name', + list: model.medicationRouteList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) @@ -642,7 +443,9 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( TranslationBase.of(context).route, - route != null ? route['name'] : null, + route != null + ? route['nameEn'] + : null, true), enabled: false, ), @@ -652,12 +455,13 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: frequencyList != null + onTap: model.medicationFrequencyList != null ? () { ListSelectDialog dialog = ListSelectDialog( - list: frequencyList, - attributeName: 'name', + list: + model.medicationFrequencyList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) @@ -681,7 +485,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).frequency, frequency != null - ? frequency['name'] + ? frequency['nameEn'] : null, true), enabled: false, @@ -692,12 +496,13 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: doseTimeList != null + onTap: model.medicationDoseTimeList != null ? () { ListSelectDialog dialog = ListSelectDialog( - list: doseTimeList, - attributeName: 'name', + list: + model.medicationDoseTimeList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) @@ -721,7 +526,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).doseTime, doseTime != null - ? doseTime['name'] + ? doseTime['nameEn'] : null, true), enabled: false, @@ -795,12 +600,13 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: durationList != null + onTap: model.medicationDurationList != null ? () { ListSelectDialog dialog = ListSelectDialog( - list: durationList, - attributeName: 'name', + list: + model.medicationDurationList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) @@ -824,7 +630,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).duration, duration != null - ? duration['name'] + ? duration['nameEn'] : null, true), enabled: false, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 290aadca..c7c4c60e 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -179,7 +179,6 @@ class _NewPrescriptionScreenState extends State { model.prescriptionList[0] .rowcount, (index) => Container( - //height: 240, child: Column( children: [ Row( diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 01986813..5c7c6e76 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -2,14 +2,17 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; @@ -60,551 +63,426 @@ class _UpdatePrescriptionFormState extends State { dynamic updatedDuration; dynamic units; - List doseTimeList; - List routeList; - List frequencyList; - List durationList; - List unitsList; - @override void initState() { super.initState(); - routeList = List(); - doseTimeList = List(); - frequencyList = List(); - durationList = List(); - unitsList = List(); - - dynamic unit1 = {"id": 1, "name": "MG"}; - dynamic unit2 = {"id": 2, "name": "MCG"}; - dynamic unit3 = {"id": 3, "name": "GM"}; - dynamic frequency1 = {"id": 2, "name": "2 Times a day"}; - dynamic frequency2 = {"id": 3, "name": "3 Times a day"}; - dynamic frequency3 = {"id": 4, "name": "4 Times a day"}; - dynamic frequency4 = {"id": 8, "name": "As Needed"}; - dynamic frequency5 = {"id": 9, "name": "Bed Time"}; - dynamic frequency6 = {"id": 11, "name": "Every Other Day"}; - dynamic frequency7 = {"id": 29, "name": "Every Eight Hours"}; - dynamic frequency8 = {"id": 34, "name": "As Directed"}; - dynamic frequency9 = {"id": 22, "name": "Once Per Month"}; - dynamic frequency10 = {"id": 2, "name": "3 Times a day"}; - dynamic frequency11 = {"id": 21, "name": "Every 3 hours"}; - dynamic frequency12 = {"id": 20, "name": "Once a Week"}; - dynamic frequency13 = {"id": 12, "name": "Every Half Hour"}; - dynamic frequency14 = {"id": 10, "name": "4 Times a Day"}; - dynamic frequency15 = {"id": 24, "name": "Once Every 2 Months"}; - dynamic frequency16 = {"id": 25, "name": "Every One Hour"}; - dynamic frequency17 = {"id": 26, "name": "Every Two Hours"}; - dynamic frequency18 = {"id": 28, "name": "Every Six Hours"}; - dynamic doseTime1 = {"id": 1, "name": "Before Meals"}; - dynamic doseTime2 = {"id": 2, "name": "After Meals"}; - dynamic doseTime3 = {"id": 3, "name": "With Meals"}; - dynamic doseTime4 = {"id": 4, "name": "In The Morning"}; - dynamic doseTime5 = {"id": 5, "name": "In the Evening"}; - dynamic doseTime6 = {"id": 6, "name": "After Supper"}; - dynamic doseTime7 = {"id": 7, "name": "With Supper"}; - dynamic doseTime8 = {"id": 8, "name": "Before Breakfast"}; - dynamic doseTime9 = {"id": 9, "name": "In the Afternoon"}; - dynamic doseTime10 = {"id": 10, "name": "While wake"}; - dynamic doseTime11 = {"id": 12, "name": "Any Time"}; - dynamic doseTime12 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime13 = {"id": 13, "name": "30 Minutes Before Meals"}; - dynamic doseTime14 = {"id": 14, "name": "1 Hour Before Meals"}; - dynamic doseTime15 = {"id": 15, "name": "2 Hours After Meal"}; - dynamic doseTime16 = {"id": 16, "name": "After Breakfast"}; - dynamic doseTime17 = {"id": 17, "name": "Before Lunch"}; - dynamic doseTime18 = {"id": 18, "name": "After Lunch"}; - dynamic doseTime19 = {"id": 20, "name": "After Dinner"}; - dynamic doseTime20 = {"id": 21, "name": "Bed Time"}; - dynamic doseTime21 = {"id": 11, "name": "Now"}; - dynamic route1 = {"id": 7, "name": "By Mouth"}; - dynamic route2 = {"id": 10, "name": "Inhale by Mouth"}; - dynamic route3 = {"id": 15, "name": "for INJECTION"}; - dynamic route4 = {"id": 17, "name": "Drops"}; - dynamic route5 = {"id": 18, "name": "Rub On"}; - dynamic route6 = {"id": 20, "name": "Spary"}; - dynamic route7 = {"id": 27, "name": "In Both EYES"}; - dynamic route8 = {"id": 28, "name": "In Both Ears"}; - dynamic route9 = {"id": 32, "name": "Intramuscular"}; - dynamic route10 = {"id": 60, "name": "TRANSDERMAL"}; - dynamic route11 = {"id": 59, "name": "OROPHARYNGEAL"}; - dynamic route12 = {"id": 15, "name": "for INJECTION"}; - dynamic route13 = {"id": 58, "name": "SUBCUTANEOUS"}; - dynamic route14 = {"id": 57, "name": "NASOGASTRIC"}; - dynamic route15 = {"id": 56, "name": "IRRIGATION"}; - dynamic route16 = {"id": 55, "name": "INTRAVITREAL"}; - dynamic route17 = {"id": 54, "name": "INTRAVENOUS BOLUS"}; - dynamic route18 = {"id": 51, "name": "EPIDURAL"}; - dynamic route19 = {"id": 47, "name": "Parenteral"}; - dynamic route20 = {"id": 43, "name": "IM"}; - dynamic route21 = {"id": 42, "name": "IV"}; - dynamic route22 = {"id": 41, "name": "Sublingual"}; - dynamic route23 = {"id": 40, "name": "For Nebulization"}; - dynamic route24 = {"id": 39, "name": "Nasal"}; - dynamic route25 = {"id": 37, "name": "Inserted into Vagina"}; - dynamic route26 = {"id": 36, "name": "Inserted into Rectum"}; - dynamic route27 = {"id": 31, "name": "In Each Nostril"}; - dynamic duration1 = {"id": 1, "name": "For 1 Day"}; - dynamic duration2 = {"id": 2, "name": "For 2 Days"}; - dynamic duration3 = {"id": 3, "name": "For 3 Days"}; - dynamic duration4 = {"id": 4, "name": "For 4 Days"}; - dynamic duration5 = {"id": 5, "name": "For 5 Days"}; - dynamic duration6 = {"id": 6, "name": "For 6 Days"}; - dynamic duration7 = {"id": 7, "name": "For 7 Days"}; - dynamic duration8 = {"id": 8, "name": "For 8 Days"}; - dynamic duration9 = {"id": 9, "name": "For 9 Days"}; - dynamic duration10 = {"id": 10, "name": "For 10 Days"}; - dynamic duration11 = {"id": 14, "name": "For 14 Days"}; - dynamic duration12 = {"id": 21, "name": "For 21 Days"}; - dynamic duration13 = {"id": 30, "name": "For 30 Days"}; - dynamic duration14 = {"id": 45, "name": "For 45 Days"}; - dynamic duration15 = {"id": 60, "name": "For 60 Days"}; - dynamic duration16 = {"id": 90, "name": "For 90 Days"}; - - durationList.add(duration1); - durationList.add(duration2); - durationList.add(duration3); - durationList.add(duration4); - durationList.add(duration5); - durationList.add(duration6); - durationList.add(duration7); - durationList.add(duration8); - durationList.add(duration9); - durationList.add(duration10); - durationList.add(duration11); - durationList.add(duration12); - durationList.add(duration13); - durationList.add(duration14); - durationList.add(duration15); - durationList.add(duration16); - frequencyList.add(frequency1); - frequencyList.add(frequency2); - frequencyList.add(frequency3); - frequencyList.add(frequency4); - frequencyList.add(frequency5); - frequencyList.add(frequency6); - frequencyList.add(frequency7); - frequencyList.add(frequency8); - frequencyList.add(frequency9); - frequencyList.add(frequency10); - frequencyList.add(frequency11); - frequencyList.add(frequency12); - frequencyList.add(frequency13); - frequencyList.add(frequency14); - frequencyList.add(frequency15); - frequencyList.add(frequency16); - frequencyList.add(frequency17); - frequencyList.add(frequency18); - doseTimeList.add(doseTime1); - doseTimeList.add(doseTime2); - doseTimeList.add(doseTime3); - doseTimeList.add(doseTime4); - doseTimeList.add(doseTime5); - doseTimeList.add(doseTime6); - doseTimeList.add(doseTime7); - doseTimeList.add(doseTime8); - doseTimeList.add(doseTime9); - doseTimeList.add(doseTime10); - doseTimeList.add(doseTime11); - doseTimeList.add(doseTime12); - doseTimeList.add(doseTime13); - doseTimeList.add(doseTime14); - doseTimeList.add(doseTime15); - doseTimeList.add(doseTime16); - doseTimeList.add(doseTime17); - doseTimeList.add(doseTime18); - doseTimeList.add(doseTime19); - doseTimeList.add(doseTime20); - doseTimeList.add(doseTime21); - routeList.add(route1); - routeList.add(route2); - routeList.add(route3); - routeList.add(route4); - routeList.add(route5); - routeList.add(route6); - routeList.add(route7); - routeList.add(route8); - routeList.add(route9); - routeList.add(route10); - routeList.add(route11); - routeList.add(route12); - routeList.add(route13); - routeList.add(route14); - routeList.add(route15); - routeList.add(route16); - routeList.add(route17); - routeList.add(route18); - routeList.add(route19); - routeList.add(route20); - routeList.add(route21); - routeList.add(route22); - routeList.add(route23); - routeList.add(route24); - routeList.add(route25); - routeList.add(route26); - routeList.add(route27); - unitsList.add(unit1); - unitsList.add(unit2); - unitsList.add(unit3); } @override Widget build(BuildContext context) { return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { - return DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.6, - builder: (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.0, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( + return BaseView( + onModelReady: (model) async { + await model.getMedicationList(); + await model.getMedicationStrength(); + await model.getMedicationDuration(); + await model.getMedicationRoute(); + await model.getMedicationFrequency(); + await model.getMedicationDoseTime(); + await model.getMedicationIndications(); + route = model.getLookupById(model.medicationRouteList, widget.route); + doseTime = + model.getLookupById(model.medicationDoseTimeList, widget.dose); + updatedDuration = model.getLookupById( + model.medicationDurationList, widget.duration); + units = model.getLookupById( + model.medicationStrengthList, widget.doseUnit); + frequencyUpdate = model.getLookupById( + model.medicationFrequencyList, widget.frequency); + }, + builder: + (BuildContext context, MedicineViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.6, + builder: + (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.0, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - height: - MediaQuery.of(context).size.height * 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context).size.width * - 0.500, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter(4) - ], - hintText: - TranslationBase.of(context).strength, - controller: strengthController, - keyboardType: TextInputType.number, - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 4) { - DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, - ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: MediaQuery.of(context).size.width * - 0.3700, - child: InkWell( - onTap: unitsList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: unitsList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units['name'] - : null, - true), - enabled: false, - ), - ), - ), - ], - ), + AppText( + widget.drugName.toUpperCase(), + fontWeight: FontWeight.w900, ), SizedBox( - height: 12, + height: 10.0, ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: routeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: routeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { + Column( + children: [ + Container( + height: MediaQuery.of(context).size.height * + 0.060, + width: double.infinity, + child: Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * + 0.500, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter(4) + ], + hintText: TranslationBase.of(context) + .strength, + controller: strengthController, + keyboardType: TextInputType.number, + onChanged: (String value) { setState(() { - route = selectedValue; + strengthChar = value.length; }); - if (route == null) { - route = route['id']; + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); } }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'Route', - route != null ? route['name'] : null, - true), - enabled: false, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), + ), + SizedBox( + width: 10.0, + ), + Container( + width: + MediaQuery.of(context).size.width * + 0.3700, + child: InkWell( + onTap: model.medicationStrengthList != + null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + ], + ), ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: doseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: doseTimeList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, - doseTime != null - ? doseTime['name'] - : null, - true), - enabled: false, + SizedBox( + height: 12, ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: frequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: frequencyList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, - frequencyUpdate != null - ? frequencyUpdate['name'] - : null, - true), - enabled: false, + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationRouteList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.medicationRouteList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + 'Route', + route != null + ? route['nameEn'] + : null, + true), + enabled: false, + ), + ), ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: - MediaQuery.of(context).size.height * 0.070, - child: InkWell( - onTap: durationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: durationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration, - updatedDuration != null - ? updatedDuration['name'].toString() - : null, - true), - enabled: false, + SizedBox( + height: 12.0, ), - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, - ), - ), - SizedBox( - height: 12.0, - ), - SizedBox( - height: MediaQuery.of(context).size.height * 0.12, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription'.toUpperCase(), - onPressed: () { - updatePrescription( - newDoseStreangth: - strengthController.text.isNotEmpty - ? strengthController.text - : widget.doseStreangth, - newUnit: units != null - ? units['id'].toString() - : widget.doseUnit, - doseUnit: widget.doseUnit, - doseStreangth: widget.doseStreangth, - duration: widget.duration, - startDate: widget.startDate, - doseId: widget.dose, - frequencyId: widget.frequency, - routeId: widget.route, - patient: widget.patient, - model: widget.model, - newDuration: updatedDuration != null - ? updatedDuration['id'].toString() - : widget.duration, - drugId: widget.drugId, - remarks: remarksController.text, - route: route != null - ? route['id'].toString() - : widget.route, - frequency: frequencyUpdate != null - ? frequencyUpdate['id'].toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'].toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); - Navigator.pop(context); - }, + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDoseTimeList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['nameEn'] + : null, + true), + enabled: false, + ), ), - ], - ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationFrequencyList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationFrequencyList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequencyUpdate != null + ? frequencyUpdate['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDurationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + updatedDuration != null + ? updatedDuration['nameEn'] + .toString() + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + controller: remarksController, + maxLines: 7, + minLines: 4, + ), + ), + SizedBox( + height: 12.0, + ), + SizedBox( + height: + MediaQuery.of(context).size.height * 0.12, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + 'update prescription'.toUpperCase(), + onPressed: () { + updatePrescription( + newDoseStreangth: + strengthController + .text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, + newUnit: units != + null + ? units['id'].toString() + : widget.doseUnit, + doseUnit: widget.doseUnit, + doseStreangth: widget + .doseStreangth, + duration: widget.duration, + startDate: widget.startDate, + doseId: widget.dose, + frequencyId: widget.frequency, + routeId: widget.route, + patient: widget.patient, + model: widget.model, + newDuration: + updatedDuration != + null + ? updatedDuration[ + 'id'] + .toString() + : widget.duration, + drugId: widget.drugId, + remarks: remarksController.text, + route: route != + null + ? route['id'].toString() + : widget.route, + frequency: + frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : widget.dose, + enteredRemarks: + widget.enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), + ), + ], ), ], ), - ], - ), - ), - )); - }); + ), + )); + }), + ), + ); }); } diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 0b0a0c5a..8ed40dc3 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -2,14 +2,19 @@ import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/screens/procedures/entity_list_checkbox_search_widget.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/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -68,102 +73,189 @@ class _UpdateProcedureWidgetState extends State { }); } + List entityList = List(); + dynamic selectedCategory; @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { - return Container( - height: MediaQuery.of(context).size.height * 0.55, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - child: Row( - children: [ - AppText(TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, + return BaseView( + onModelReady: (model) => model.getCategory(), + builder: + (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: Container( + height: MediaQuery.of(context).size.height * 0.95, + child: Form( + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + model.categoryList.length > 0 + ? () { + ListSelectDialog dialog = ListSelectDialog( + list: model.categoryList, + attributeName: 'categoryName', + attributeValueId: 'categoryId', + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + selectedCategory = selectedValue; + model.getProcedureCategory( + categoryName: selectedCategory[ + 'categoryName']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + //model.getProcedureCategory(); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).procedureCategorise, + selectedCategory != null + ? selectedCategory['categoryName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, + ), ), - Text(TranslationBase.of(context).urgent), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ), ), - Text(TranslationBase.of(context).regular), - ], - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.0)), - border: - Border.all(width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - controller: widget.remarksController, - maxLines: 5, - minLines: 3, - ), - ), - SizedBox( - height: 100.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), - onPressed: () { - Navigator.pop(context); - updateProcedure( - orderType: selectedType.toString(), - categorieId: widget.categoryId, - procedureId: widget.procedureId, - patient: widget.patient, - model: widget.model, - remarks: widget.remarksController.text); - // authorizationForm(context); - }, + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + controller: widget.remarksController, + maxLines: 5, + minLines: 3, + ), + ), + SizedBox( + height: 50.0, + ), + Container( + margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + Navigator.pop(context); + updateProcedure( + orderType: selectedType.toString(), + categorieId: widget.categoryId, + procedureId: widget.procedureId, + entityList: entityList, + patient: widget.patient, + model: widget.model, + remarks: widget.remarksController.text); + // authorizationForm(context); + }, + ), + ], ), - ], - ), + ), + ], ), - ], - ), - ), - )); + ), + )), + ), + ); }); } updateProcedure( {ProcedureViewModel model, String remarks, + String newProcedureId, + String newCategorieId, + List entityList, String orderType, String procedureId, PatiantInformtion patient, @@ -187,10 +279,15 @@ class _UpdateProcedureWidgetState extends State { Controls(code: "ordertype", controlValue: "1"), ); - controlsProcedure.procedure = procedureId; + entityList.isNotEmpty + ? entityList.forEach((element) { + controlsProcedure.procedure = element.procedureId; + controlsProcedure.category = element.categoryID; + controlsProcedure.controls = controls; + }) + : controlsProcedure.procedure = procedureId; controlsProcedure.category = categorieId; controlsProcedure.controls = controls; - // controlsProcedure.add(ProcedureDetail( // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; @@ -206,4 +303,45 @@ class _UpdateProcedureWidgetState extends State { DrAppToastMsg.showSuccesToast('procedure has been updated'); } } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } } From d78aa2321d48ed35624a0f5e244f9df17cb7bce4 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Feb 2021 14:04:20 +0200 Subject: [PATCH 255/421] bug fix --- lib/core/enum/master_lookup_key.dart | 2 +- lib/core/service/base/lookup-service.dart | 2 +- pubspec.lock | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index 7cb6f1cf..889be9a7 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -19,7 +19,7 @@ enum MasterKeysService { MedicationFrequency, MedicationDoseTime, MedicationIndications, - Speciality, + AdmissionRequestType, } diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 774cd4ad..0c361003 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -44,7 +44,7 @@ class LookupService extends BaseService { List listOfICD10 = []; List listOfTemperatureMethods = []; List listOfSpeciality = []; - List listOfAdmissionType = []; + List listOfAdmissionType = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; diff --git a/pubspec.lock b/pubspec.lock index e51c9489..31666673 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -510,7 +510,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -552,7 +552,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -823,7 +823,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -958,5 +958,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 6a23c2a137baa59997c90cdf0f71ff650117f9ad Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 2 Feb 2021 18:01:13 +0300 Subject: [PATCH 256/421] bug fix --- lib/config/localized_values.dart | 16 ++++------------ lib/core/service/sickleave_service.dart | 5 ++++- .../reschedule-leaves/add-rescheduleleave.dart | 10 +++++++--- .../reschedule-leaves/reschedule_leave.dart | 4 +++- lib/util/translations_delegate_base.dart | 4 ++-- lib/widgets/auth/login_form.dart | 10 +++++----- pubspec.lock | 7 +++++++ pubspec.yaml | 2 +- 8 files changed, 33 insertions(+), 25 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 0ef7fe31..7e425874 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -666,16 +666,8 @@ const Map> localizedValues = { 'en': "You have to add chief complaint fields correctly .", 'ar': "يجب عليك إضافة حقول شكوى الرئيس بشكل صحيح" }, - 'referralStatus': { - 'en': "Referral Status : ", - 'ar': "حالة الإحالة :" - }, - 'referralRemark': { - 'en': "Referral Remark : ", - 'ar': "ملاحظة الإحالة :" - }, - 'ICDName': { - 'en': "ICDName", - 'ar': "اسم ال ICD" - }, + 'referralStatus': {'en': "Referral Status : ", 'ar': "حالة الإحالة :"}, + 'referralRemark': {'en': "Referral Remark : ", 'ar': "ملاحظة الإحالة :"}, + 'ICDName': {'en': "ICDName", 'ar': "اسم ال ICD"}, + 'offTime': {'en': "OffTime", 'ar': "خارج الوقت"}, }; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 8eebd23c..d188836c 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -128,7 +128,10 @@ class SickLeaveService extends BaseService { GET_OFFTIME, onSuccess: (dynamic response, int statusCode) { offTime = []; - offTime = response['MasterLookUpList']['entityList']; + response['MasterLookUpList']['entityList'].forEach((item) => { + if (item['code'] == '1' || item['code'] == '2') + {offTime.add(item)} + }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index b4ebecf4..c3cbe19c 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -144,10 +144,14 @@ class AddRescheduleLeavScreen extends StatelessWidget { ), Container( child: AppText( - TranslationBase.of( + item.requisitionType == 1 + ? TranslationBase.of( context) - .holiday + - ' ', + .offTime + : TranslationBase.of( + context) + .holiday + + ' ', fontWeight: FontWeight.bold, )), diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 822a2181..25102e3d 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -26,6 +26,7 @@ import 'package:intl/intl.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; import 'package:provider/provider.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:dropdown_search/dropdown_search.dart'; Helpers helpers = Helpers(); @@ -758,7 +759,7 @@ class _RescheduleLeaveScreen extends State { this.clinicID = widget.updateData.clinicId; final df = new DateFormat('HH:mm:ss'); final dateFormat = new DateFormat('yyyy-MM-dd'); - + this.offTime = widget.updateData.requisitionType.toString(); _toDateController.text = dateFormat.format(DateTime.parse(widget.updateData.dateTimeFrom)); //df.format(DateTime.parse(widget.updateData.dateTimeFrom)); @@ -773,6 +774,7 @@ class _RescheduleLeaveScreen extends State { _controller4.text = fromTime; toDate = _toDateController2.text; fromDate = _toDateController.text; + this.reason = widget.updateData.reasonId.toString(); } }); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 01c8d90b..9668b514 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1036,12 +1036,12 @@ class TranslationBase { String get chiefComplaintErrorMsg => localizedValues['chiefComplaintErrorMsg'][locale.languageCode]; -String get ICDName => - localizedValues['ICDName'][locale.languageCode]; + String get ICDName => localizedValues['ICDName'][locale.languageCode]; String get referralStatus => localizedValues['referralStatus'][locale.languageCode]; String get referralRemark => localizedValues['referralRemark'][locale.languageCode]; + String get offTime => localizedValues['offTime'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 63087cc7..c52e9a77 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -117,8 +117,8 @@ class _LoginFormState extends State { }, onFieldSubmitted: (_) { focusPass.nextFocus(); - // helpers.showCupertinoPicker( - // context, projectsList, 'facilityName', onSelectProject); + helpers.showCupertinoPicker( + context, projectsList, 'facilityName', onSelectProject); }, onTap: () { this.getProjects(userInfo.userID); @@ -130,11 +130,11 @@ class _LoginFormState extends State { focusNode: focusProject, controller: projectIdController, onTap: () { - // helpers.showCupertinoPicker(context, projectsList, - // 'facilityName', onSelectProject); + helpers.showCupertinoPicker(context, projectsList, + 'facilityName', onSelectProject); }, showCursor: false, - readOnly: true, + //readOnly: true, decoration: buildInputDecoration( context, TranslationBase.of(context).selectYourProject, diff --git a/pubspec.lock b/pubspec.lock index d49ad4a1..c4bbf56a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -281,6 +281,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + dropdown_search: + dependency: "direct main" + description: + name: dropdown_search + url: "https://pub.dartlang.org" + source: hosted + version: "0.4.8" equatable: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 887ac913..cf69fa5b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -39,7 +39,7 @@ dependencies: #Icons eva_icons_flutter: ^2.0.0 font_awesome_flutter: ^8.11.0 - + dropdown_search: ^0.4.8 expandable: ^4.1.4 From 6dd1d9ef90ca181a33eb33a6aee2bf76bf5a3f82 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 3 Feb 2021 17:47:02 +0200 Subject: [PATCH 257/421] fix bugs --- lib/core/service/base/lookup-service.dart | 2 + lib/core/service/medicine_service.dart | 4 + lib/core/service/prescription_service.dart | 17 + lib/core/viewModel/medicine_view_model.dart | 15 + .../prescription/add_prescription_form.dart | 112 +++--- .../prescription/prescription_screen.dart | 36 +- .../update_prescription_form.dart | 9 +- lib/screens/procedures/procedure_screen.dart | 45 ++- lib/screens/procedures/update-procedure.dart | 325 +++++++++--------- lib/widgets/shared/TextFields.dart | 107 +++--- 10 files changed, 378 insertions(+), 294 deletions(-) diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 0c361003..e77431aa 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:flutter/cupertino.dart'; @@ -17,6 +18,7 @@ class LookupService extends BaseService { List medicationFrequencyList = []; List medicationDoseTimeList = []; List medicationIndicationsList = []; + List patientAssessmentList = []; List get historyFamilyList => _historyFamilyList; List _historyFamilyList = []; diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index f205dab1..44b380d6 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/doctor/request_schedule.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart'; @@ -10,6 +12,8 @@ class MedicineService extends BaseService { get pharmacyItemsList => _pharmacyItemsList; get pharmaciesList => _pharmaciesList; + List patientAssessmentList = []; + PharmaciesItemsRequestModel _itemsRequestModel = PharmaciesItemsRequestModel(); PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel(); diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index b7f9e80e..4258ee81 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -8,6 +8,8 @@ import 'package:doctor_app_flutter/core/model/search_drug_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; @@ -30,6 +32,21 @@ class PrescriptionService extends LookupService { PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { + hasError = false; + await baseAppClient.post(GET_ASSESSMENT, + onSuccess: (dynamic response, int statusCode) { + print("Success"); + patientAssessmentList.clear(); + response['AssessmentList']['entityList'].forEach((v) { + patientAssessmentList.add(GetAssessmentResModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: getAssessmentReqModel.toJson()); + } Future getPrescription({int mrn}) async { _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 5b7c2f6a..f57de2b3 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -4,6 +4,8 @@ import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; import 'package:doctor_app_flutter/core/service/medicine_service.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import '../../locator.dart'; import 'base_view_model.dart'; @@ -28,6 +30,8 @@ class MedicineViewModel extends BaseViewModel { _prescriptionService.medicationIndicationsList; get medicationDoseTimeList => _prescriptionService.medicationDoseTimeList; + List get patientAssessmentList => + _prescriptionService.patientAssessmentList; List get allMedicationList => _prescriptionService.allMedicationList; @@ -52,6 +56,17 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getPatientAssessment( + GetAssessmentReqModel getAssessmentReqModel) async { + setState(ViewState.Busy); + await _prescriptionService.getPatientAssessment(getAssessmentReqModel); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getMedicationStrength() async { setState(ViewState.Busy); await _prescriptionService diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index a8279634..b079a661 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.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/screens/prescription/drugtodrug.dart'; @@ -180,6 +181,12 @@ class _PrescriptionFormWidgetState extends State { return BaseView( onModelReady: (model) async { + GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( + patientMRN: widget.patient.patientMRN, + episodeID: widget.patient.episodeNo.toString(), + editedBy: '', + doctorID: '', + appointmentNo: widget.patient.appointmentNo); await model.getMedicationList(); await model.getMedicationStrength(); await model.getMedicationDuration(); @@ -187,8 +194,13 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationFrequency(); await model.getMedicationDoseTime(); await model.getMedicationIndications(); + await model.getPatientAssessment(getAssessmentReqModel); }, - builder: (BuildContext context, MedicineViewModel model, Widget child) => + builder: ( + BuildContext context, + MedicineViewModel model, + Widget child, + ) => NetworkBaseView( baseViewModel: model, child: DraggableScrollableSheet( @@ -298,22 +310,13 @@ class _PrescriptionFormWidgetState extends State { AppText('Order Type'), Radio( activeColor: Color(0xFFB9382C), - value: 0, + value: 1, groupValue: selectedType, onChanged: (value) { setSelectedType(value); }, ), Text('Regular'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('Urgent'), ], ), ), @@ -534,46 +537,57 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: - TranslationBase.of(context) + //model.patientAssessmentList.forEach((element) { }). + Column( + children: model.patientAssessmentList + .map((element) { + return Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: TranslationBase.of( + context) .ok, - okFunction: (selectedValue) { - setState(() { - indication = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .indication, - indication != null - ? indication['name'] - : null, - true), - enabled: false, - ), - ), + okFunction: (selectedValue) { + setState(() { + indication = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + element.icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ); + }).toList(), ), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index c7c4c60e..1588c4c4 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -181,6 +181,13 @@ class _NewPrescriptionScreenState extends State { (index) => Container( child: Column( children: [ + SizedBox( + height: MediaQuery.of( + context) + .size + .height * + 0.022, + ), Row( mainAxisAlignment: MainAxisAlignment @@ -193,7 +200,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.23, + 0.24, width: MediaQuery.of( context) .size @@ -232,7 +239,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.3019, + 0.3499, width: MediaQuery.of( context) .size @@ -328,7 +335,7 @@ class _NewPrescriptionScreenState extends State { ], ), SizedBox( - height: 3.0, + height: 10.0, ), Row( children: [ @@ -351,7 +358,7 @@ class _NewPrescriptionScreenState extends State { ], ), SizedBox( - height: 18.0, + height: 20.0, ), Row( children: [ @@ -385,10 +392,9 @@ class _NewPrescriptionScreenState extends State { 30, child: AppText( - model - .prescriptionList[0] - .entityList[index] - .remarks, + model.prescriptionList[0].entityList[index].remarks == null + ? "" + : model.prescriptionList[0].entityList[index].remarks, fontSize: 11.5, ), @@ -400,13 +406,6 @@ class _NewPrescriptionScreenState extends State { height: 10.0, ), - Divider( - height: 0, - thickness: - 1.0, - color: Colors - .grey, - ), // SizedBox( // height: 40, // ), @@ -418,7 +417,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.05, + 0.08, width: MediaQuery.of( context) .size @@ -484,6 +483,11 @@ class _NewPrescriptionScreenState extends State { ), ], ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, + ), ], ), ), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 5c7c6e76..68a7e739 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -128,13 +128,16 @@ class _UpdatePrescriptionFormState extends State { Container( width: MediaQuery.of(context).size.width * - 0.500, + 0.4900, + height: + MediaQuery.of(context).size.height * + 0.55, child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter(4) ], - hintText: TranslationBase.of(context) - .strength, + hintText: widget.doseStreangth, + fontSize: 15.0, controller: strengthController, keyboardType: TextInputType.number, onChanged: (String value) { diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index ca126609..bb897351 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -195,6 +195,13 @@ class _ProcedureScreenState extends State { (index) => Container( child: Column( children: [ + SizedBox( + height: + MediaQuery.of(context) + .size + .height * + 0.022, + ), Row( mainAxisAlignment: MainAxisAlignment @@ -298,17 +305,20 @@ class _ProcedureScreenState extends State { FontWeight .w700, fontSize: - 15.0, + 14.0, ), - AppText( - model.procedureList[0].entityList[index].orderType == - 1 - ? 'Regular' - : 'Urgent', - fontSize: - 13.0, - color: Color( - 0xFFB9382C), + Expanded( + child: + AppText( + model.procedureList[0].entityList[index].orderType == + 1 + ? 'Regular' + : 'Urgent', + fontSize: + 13.0, + color: Color( + 0xFFB9382C), + ), ), ], ), @@ -391,7 +401,7 @@ class _ProcedureScreenState extends State { height: MediaQuery.of(context) .size .height * - 0.052, + 0.047, width: MediaQuery.of(context) .size .width * @@ -413,12 +423,6 @@ class _ProcedureScreenState extends State { height: 20.0, ), - Divider( - height: 1.0, - thickness: 1.0, - color: - Colors.grey, - ) // SizedBox( // height: 40, // ), @@ -468,9 +472,14 @@ class _ProcedureScreenState extends State { ) ], ), - ) + ), ], ), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), ], ), ), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 8ed40dc3..c1dc31f3 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -86,165 +86,184 @@ class _UpdateProcedureWidgetState extends State { (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( baseViewModel: model, - child: Container( - height: MediaQuery.of(context).size.height * 0.95, - child: Form( - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 20.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.procedureName.toUpperCase(), - fontWeight: FontWeight.w700, - ), - SizedBox( - height: 30.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.categoryList != null && - model.categoryList.length > 0 - ? () { - ListSelectDialog dialog = ListSelectDialog( - list: model.categoryList, - attributeName: 'categoryName', - attributeValueId: 'categoryId', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: + (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.procedureName.toUpperCase(), + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 30.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.categoryList != null && + model.categoryList.length > 0 + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: model.categoryList, + attributeName: 'categoryName', + attributeValueId: 'categoryId', + okText: + TranslationBase.of(context).ok, + okFunction: (selectedValue) { + setState(() { + selectedCategory = + selectedValue; + model.getProcedureCategory( + categoryName: + selectedCategory[ + 'categoryName']); + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + //model.getProcedureCategory(); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .procedureCategorise, + selectedCategory != null + ? selectedCategory['categoryName'] + : null, + true, + suffixIcon: Icon( + Icons.search, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget + .model.categoriesList[0].entityList, + removeHistory: (item) { setState(() { - selectedCategory = selectedValue; - model.getProcedureCategory( - categoryName: selectedCategory[ - 'categoryName']); + entityList.remove(item); }); }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; + addHistory: (history) { + setState(() { + entityList.add(history); + }); }, - ); - //model.getProcedureCategory(); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).procedureCategorise, - selectedCategory != null - ? selectedCategory['categoryName'] - : null, - true, - suffixIcon: Icon( - Icons.search, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - if (widget.model.categoriesList.length != 0) - NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ), + ), + Container( + child: Row( + children: [ + AppText( + TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).regular), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + fontSize: 15.0, + controller: widget.remarksController, + maxLines: 3, + minLines: 2, + ), + ), + SizedBox( + height: 50.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .updateProcedure + .toUpperCase(), + onPressed: () { + Navigator.pop(context); + updateProcedure( + orderType: selectedType.toString(), + categorieId: widget.categoryId, + procedureId: widget.procedureId, + entityList: entityList, + patient: widget.patient, + model: widget.model, + remarks: + widget.remarksController.text); + // authorizationForm(context); + }, + ), + ], + ), + ), + ], ), ), - Container( - child: Row( - children: [ - AppText(TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).regular), - ], - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - controller: widget.remarksController, - maxLines: 5, - minLines: 3, - ), - ), - SizedBox( - height: 50.0, - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .updateProcedure - .toUpperCase(), - onPressed: () { - Navigator.pop(context); - updateProcedure( - orderType: selectedType.toString(), - categorieId: widget.categoryId, - procedureId: widget.procedureId, - entityList: entityList, - patient: widget.patient, - model: widget.model, - remarks: widget.remarksController.text); - // authorizationForm(context); - }, - ), - ], - ), - ), - ], - ), - ), - )), + )), + ); + }), ), ); }); diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 8563bb41..d2807a26 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -76,7 +76,8 @@ class TextFields extends StatefulWidget { this.hintColor, this.hasBorder = true, this.onTapTextFields, - this.hasLabelText = false, this.showLabelText= false}) + this.hasLabelText = false, + this.showLabelText = false}) : super(key: key); final String hintText; @@ -233,22 +234,21 @@ class _TextFieldsState extends State { maxLines: widget.maxLines ?? 1, maxLengthEnforced: widget.maxLengthEnforced, initialValue: widget.initialValue, - onChanged: (value){ - if(widget.showLabelText) { - if((value== null || value =='' )) { + onChanged: (value) { + if (widget.showLabelText) { + if ((value == null || value == '')) { setState(() { widget.hasLabelText = false; }); - }else{ + } else { setState(() { widget.hasLabelText = true; }); } } - widget.onChanged(value); - } , + }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, controller: widget.controller, @@ -258,10 +258,8 @@ class _TextFieldsState extends State { autofocus: widget.autoFocus ?? false, validator: widget.validator, onSaved: widget.onSaved, - style: Theme.of(context) - .textTheme - .bodyText1 - .copyWith(fontSize: widget.fontSize, fontWeight: widget.fontWeight), + style: Theme.of(context).textTheme.bodyText1.copyWith( + fontSize: widget.fontSize, fontWeight: widget.fontWeight), inputFormatters: widget.keyboardType == TextInputType.phone ? [ WhitelistingTextInputFormatter.digitsOnly, @@ -271,33 +269,27 @@ class _TextFieldsState extends State { decoration: InputDecoration( labelText: widget.hasLabelText ? widget.hintText : null, labelStyle: TextStyle( - fontSize: widget.fontSize, fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme - .of(context) - .hintColor, + color: widget.hintColor ?? Theme.of(context).hintColor, ), counterText: "", hintText: widget.hintText, hintStyle: TextStyle( fontSize: widget.fontSize, fontWeight: widget.fontWeight, - color: widget.hintColor ?? Theme - .of(context) - .hintColor, + color: widget.hintColor ?? Theme.of(context).hintColor, ), contentPadding: widget.padding != null ? widget.padding : EdgeInsets.symmetric( - vertical: (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, - horizontal: 16.0), + vertical: + (widget.bare && !widget.keepPadding) ? 0.0 : 10.0, + horizontal: 16.0), filled: true, fillColor: widget.bare ? Colors.transparent - : Theme - .of(context) - .backgroundColor, + : Theme.of(context).backgroundColor, suffixIcon: _buildSuffixIcon(), prefixIcon: widget.prefixIcon, errorStyle: TextStyle( @@ -305,48 +297,53 @@ class _TextFieldsState extends State { fontWeight: widget.fontWeight, height: widget.borderOnlyError ? 0.0 : null), errorBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Theme - .of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + borderSide: widget.hasBorder + ? BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), + ), focusedErrorBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Theme - .of(context) - .errorColor - .withOpacity(widget.bare ? 0.0 : 0.5), - width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), + borderSide: widget.hasBorder + ? BorderSide( + color: Theme.of(context) + .errorColor + .withOpacity(widget.bare ? 0.0 : 0.5), + width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), borderRadius: BorderRadius.circular(widget.bare ? 0.0 : 8.0)), focusedBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0),), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), + ), disabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0)), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0)), enabledBorder: OutlineInputBorder( - borderSide: widget.hasBorder ? BorderSide( - color: Colors.grey, width: 1.0) : BorderSide( - color: Colors.transparent, width: 0), - borderRadius: widget.hasBorder ? BorderRadius.circular( - widget.bare ? 0.0 : 8.0) : BorderRadius.circular(0.0), + borderSide: widget.hasBorder + ? BorderSide(color: Colors.grey, width: 1.0) + : BorderSide(color: Colors.transparent, width: 0), + borderRadius: widget.hasBorder + ? BorderRadius.circular(widget.bare ? 0.0 : 8.0) + : BorderRadius.circular(0.0), ), ), ), ], ), - )); } } From 34d5ac7d43338338eacb1ef0fefb0ced0570858f Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 4 Feb 2021 14:12:54 +0200 Subject: [PATCH 258/421] add label on assessment and fix DA-333 --- .../patients/patient_search_screen.dart | 87 ------ .../soap_update/update_assessment_page.dart | 285 +++++++++++++----- pubspec.lock | 6 +- 3 files changed, 206 insertions(+), 172 deletions(-) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 1e68d196..0b13bd2d 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -419,93 +419,6 @@ class _PatientSearchScreenState extends State { SizedBox( height: 10, ), - 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: _selectedLocation, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return LOCATIONS.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(() { - _selectedLocation = newValue; - }); - if (newValue == '1') - { - _patientSearchFormValues - .PatientOutSA = false; - } - else - { - _patientSearchFormValues - .PatientOutSA = true; - } - - }, - items: LOCATIONS.map((item) { - !projectsProvider.isArabic - ? itemText2 = item['text'] - : itemText2 = item['text-ar']; - return DropdownMenuItem( - child: Text( - itemText2, - textAlign: TextAlign.end, - ), - value: item['val'], - ); - }).toList(), - )), - ), - ], - ), - ), - ), SizedBox( height: 10, ), diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 542d4196..ddb7b9d6 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -491,6 +491,10 @@ class AddAssessmentDetails extends StatefulWidget { class _AddAssessmentDetailsState extends State { TextEditingController remarkController = TextEditingController(); TextEditingController appointmentIdController = TextEditingController(); + TextEditingController conditionController = TextEditingController(); + TextEditingController typeController = TextEditingController(); + TextEditingController icdNameController = TextEditingController(); + GlobalKey key = new GlobalKey>(); bool isFormSubmitted = false; @@ -501,31 +505,52 @@ class _AddAssessmentDetailsState extends State { remarkController.text = widget.mySelectedAssessment.remark ?? ""; appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); - final screenSize = MediaQuery - .of(context) - .size; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown, {IconData icon}) { - //TODO: make one Input InputDecoration for all + if(widget.isUpdate){ + if(widget.mySelectedAssessment + .selectedDiagnosisCondition != null) + conditionController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameAr + : widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameEn; + if(widget.mySelectedAssessment + .selectedDiagnosisType !=null) + typeController.text = projectViewModel.isArabic + ? widget.mySelectedAssessment + .selectedDiagnosisType + .nameAr + : widget.mySelectedAssessment + .selectedDiagnosisType + .nameEn; + if(widget.mySelectedAssessment.selectedICD !=null) + icdNameController.text = widget.mySelectedAssessment.selectedICD.code; + } + final screenSize = MediaQuery.of(context).size; + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {IconData icon}) { return InputDecoration( + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Colors.grey, width: 1.0), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, - suffixIcon: isDropDown ? Icon(icon??Icons.arrow_drop_down) : null, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, - ), + fontSize: 10, + color: Theme.of(context).hintColor, + fontWeight: FontWeight.w700), ); } return FractionallySizedBox( @@ -590,46 +615,109 @@ class _AddAssessmentDetailsState extends State { height: 10, ), Container( - height: screenSize.height * 0.070, + height: screenSize.height * 0.080, child: InkWell( - onTap: model.listOfDiagnosisType != null - ? () { - setState(() { - widget.mySelectedAssessment.selectedICD = null; - }); - } - : null, + onTap: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment + .selectedICD = null; + icdNameController.text = null; + }); + } + : null, child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), - itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), + decoration: textFieldSelectorDecoration( + TranslationBase + .of(context) + .nameOrICD, + widget.mySelectedAssessment.selectedICD != + null ? widget.mySelectedAssessment + .selectedICD.nameEn : null, true, + icon: EvaIcons.search), + itemSubmitted: (item) => + setState(() + { + widget.mySelectedAssessment + .selectedICD = item; + icdNameController.text =item.code; + }), key: key, suggestions: model.listOfICD10, - itemBuilder: (context, suggestion) => new Padding( - child:Texts( suggestion.description +" / "+ suggestion.code.toString()), + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + suggestion.description + " / " + + suggestion.code.toString()), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.description.toLowerCase().startsWith(input.toLowerCase()) ||suggestion.description.toLowerCase().startsWith(input.toLowerCase()) - ||suggestion.code.toLowerCase().startsWith(input.toLowerCase()) + suggestion.description.toLowerCase().startsWith( + input.toLowerCase()) || + suggestion.description.toLowerCase() + .startsWith(input.toLowerCase()) + || suggestion.code.toLowerCase().startsWith( + input.toLowerCase()) , - ): TextField( - decoration: textFieldSelectorDecoration( - widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", - widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), - enabled: false, - ), - ), + ) + : TextFields( + onTapTextFields: model.listOfICD10 != null + ? () { + setState(() { + widget.mySelectedAssessment.selectedICD = + null; + icdNameController.text = null; + }); + } + : null, + hasLabelText: icdNameController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .nameOrICD, + fontSize: 13.5, + readOnly: true, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: icdNameController, + suffixIcon: EvaIcons.search, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }) + + // TextField( + // decoration: textFieldSelectorDecoration( + // widget.mySelectedAssessment.selectedICD != + // null ? widget.mySelectedAssessment + // .selectedICD.code : "Name or ICD", + // widget.mySelectedAssessment.selectedICD != + // null ? projectViewModel.isArabic + // ? widget.mySelectedAssessment + // .selectedICD.nameAr + // : widget.mySelectedAssessment + // .selectedICD.nameEn : null, true, + // icon: EvaIcons.search), + // enabled: false, + // ), + ), ), - if(isFormSubmitted && widget.mySelectedAssessment - .selectedICD == null) + if(isFormSubmitted && + widget.mySelectedAssessment + .selectedICD == null) CustomValidationError(), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfDiagnosisCondition != + TextFields( + onTapTextFields: model + .listOfDiagnosisCondition != null ? () { MasterKeyDailog dialog = MasterKeyDailog( @@ -643,6 +731,14 @@ class _AddAssessmentDetailsState extends State { widget.mySelectedAssessment .selectedDiagnosisCondition = selectedValue; + conditionController.text = + projectViewModel.isArabic + ? widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameAr + : widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameEn; }); }, ); @@ -655,32 +751,39 @@ class _AddAssessmentDetailsState extends State { ); } : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).condition, - widget.mySelectedAssessment - .selectedDiagnosisCondition != null - ? projectViewModel.isArabic?widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameAr:widget.mySelectedAssessment - .selectedDiagnosisCondition - .nameEn - : null, - true), - enabled: false, - ), - ), - ), - if(isFormSubmitted && widget.mySelectedAssessment - .selectedDiagnosisCondition == null) + hasLabelText: conditionController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .condition, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: conditionController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + if(isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisCondition == null) CustomValidationError(), SizedBox( height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfDiagnosisType != null + + + TextFields( + onTapTextFields: model + .listOfDiagnosisType != null ? () { MasterKeyDailog dialog = MasterKeyDailog( list: model.listOfDiagnosisType, @@ -695,6 +798,12 @@ class _AddAssessmentDetailsState extends State { widget.mySelectedAssessment .selectedDiagnosisType = selectedValue; + typeController.text = + projectViewModel.isArabic + ? selectedValue + .nameAr + : selectedValue + .nameEn; }); }, ); @@ -707,22 +816,30 @@ class _AddAssessmentDetailsState extends State { ); } : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).dType, - widget.mySelectedAssessment - .selectedDiagnosisType != null - ?projectViewModel.isArabic?widget.mySelectedAssessment - .selectedDiagnosisType.nameAr: widget.mySelectedAssessment - .selectedDiagnosisType.nameEn - : null, - true), - enabled: false, - ), - ), - ), - if(isFormSubmitted && widget.mySelectedAssessment - .selectedDiagnosisType == null) + hasLabelText: typeController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .dType, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: typeController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + if(isFormSubmitted && + widget.mySelectedAssessment + .selectedDiagnosisType == null) CustomValidationError(), SizedBox( height: 10, @@ -731,17 +848,21 @@ class _AddAssessmentDetailsState extends State { margin: EdgeInsets.only( left: 0, right: 0, top: 15), child: TextFields( - hintText: TranslationBase.of(context).remarks, + hintText: TranslationBase + .of(context) + .remarks, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 18, minLines: 5, - hasLabelText: remarkController.text != ''?true:false, + hasLabelText: remarkController.text != + '' ? true : false, showLabelText: true, controller: remarkController, - onChanged:(value) { - widget.mySelectedAssessment.remark = remarkController.text; + onChanged: (value) { + widget.mySelectedAssessment.remark = + remarkController.text; }, validator: (value) { if (value == null) diff --git a/pubspec.lock b/pubspec.lock index addef845..94f07eea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -559,7 +559,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: @@ -830,7 +830,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: @@ -965,5 +965,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 1e84b73cf0298e2e3ab8ca5aefdf4f205566f69c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 4 Feb 2021 15:09:07 +0200 Subject: [PATCH 259/421] fix DA-279 --- lib/client/base_app_client.dart | 3 ++- lib/screens/patients/profile/lab_result/lab_orders_screen.dart | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 604e6f30..f88d19b5 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -82,7 +82,8 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - + var aa = "${json.encode(body)}"; + var ee; if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index 41f58564..3dff441c 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -49,7 +49,7 @@ class _LabOrdersScreenState extends State { patientID: patient.patientId, projectID: patient.projectId, tokenID: token, - patientTypeID: patient.patientType, + patientTypeID: patient.patientType??1, languageID: 2); model.getLabResultOrders(labOrdersReqModel.toJson()); From 98609b464bffcdd96866bc9dcc5a778b7fa3d0ab Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 4 Feb 2021 15:10:01 +0200 Subject: [PATCH 260/421] fix DA-279 --- lib/client/base_app_client.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index f88d19b5..604e6f30 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -82,8 +82,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - var aa = "${json.encode(body)}"; - var ee; + if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), From efc4cf9443c4f766371c6431136715d6e8b98dc6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 4 Feb 2021 16:38:05 +0300 Subject: [PATCH 261/421] reschedule issue fixed --- .../reschedule-leaves/reschedule_leave.dart | 215 +++++++++++++----- pubspec.lock | 6 +- 2 files changed, 161 insertions(+), 60 deletions(-) diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 25102e3d..d5daf67c 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -639,68 +639,153 @@ class _RescheduleLeaveScreen extends State { model2.coveringDoctors.length > 0 ? Expanded( // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: doctorID == null - ? model2 - .coveringDoctors[0] - ['doctorID'] - .toString() - : doctorID, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model2 - .coveringDoctors - .map((item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - AppText( - projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - doctorID = newValue; - }) - }, + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, + + dropdownSearchDecoration: + InputDecoration( + contentPadding: + EdgeInsets.all( + 0), + border: InputBorder + .none), + //maxHeight: 300, items: model2 .coveringDoctors .map((item) { - return DropdownMenuItem< - String>( - value: item['doctorID'] - .toString(), + return projectsProvider + .isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors + .forEach((newVal) => { + if (newVal['doctorName'] == + item || + newVal['doctorName'] == + item) + { + doctorID = + newVal[ + 'DoctorID'] + } + }); + }, + selectedItem: + getSelectedDoctor( + model2), + showSearchBox: true, + searchBoxDecoration: + InputDecoration( + border: + OutlineInputBorder(), + contentPadding: + EdgeInsets.fromLTRB( + 12, 12, 8, 0), + labelText: + "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context) + .primaryColorDark, + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular( + 20), + topRight: + Radius.circular( + 20), + ), + ), + child: Center( child: Text( - projectsProvider - .isArabic - ? item[ - 'doctorNameN'] - : item[ - 'doctorName'], - textAlign: - TextAlign.start, + '', + style: TextStyle( + fontSize: 24, + fontWeight: + FontWeight.bold, + color: Colors.white, + ), ), - ); - }).toList(), - )), + ), + ), + popupShape: + RoundedRectangleBorder( + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular(24), + topRight: + Radius.circular(24), + ), + ), + ), + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), ) : SizedBox(), ], @@ -775,6 +860,7 @@ class _RescheduleLeaveScreen extends State { toDate = _toDateController2.text; fromDate = _toDateController.text; this.reason = widget.updateData.reasonId.toString(); + doctorID = widget.updateData.coveringDoctorId; } }); } @@ -910,4 +996,19 @@ class _RescheduleLeaveScreen extends State { } }); } + + getSelectedDoctor(model2) { + var doctorName; + if (doctorID == null) + return projectsProvider.isArabic + ? model2.coveringDoctors[0]['doctorNameN'] + : model2.coveringDoctors[0]['doctorName']; + else { + model2.coveringDoctors.forEach((newVal) => { + if (newVal['doctorID'].toString() == doctorID) + {doctorName = newVal['doctorName']} + }); + return doctorName; + } + } } diff --git a/pubspec.lock b/pubspec.lock index addef845..94f07eea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -559,7 +559,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: @@ -830,7 +830,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: @@ -965,5 +965,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 539f7facc78d15b066a491fb4b2b1d73bace120e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 4 Feb 2021 17:20:45 +0200 Subject: [PATCH 262/421] jira bugs fix --- lib/core/model/prescription_model.dart | 10 +- .../prescription/add_prescription_form.dart | 83 +++++++---- .../prescription/prescription_screen.dart | 66 ++++++--- .../update_prescription_form.dart | 133 ++++++++++++++---- 4 files changed, 218 insertions(+), 74 deletions(-) diff --git a/lib/core/model/prescription_model.dart b/lib/core/model/prescription_model.dart index 9fcf3050..49001673 100644 --- a/lib/core/model/prescription_model.dart +++ b/lib/core/model/prescription_model.dart @@ -57,6 +57,8 @@ class EntityList { dynamic status; dynamic stopDate; dynamic uom; + dynamic pharmacistRemarks; + dynamic refill; EntityList( {this.appointmentNo, @@ -87,7 +89,9 @@ class EntityList { this.startDate, this.status, this.stopDate, - this.uom}); + this.uom, + this.pharmacistRemarks, + this.refill}); EntityList.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -119,6 +123,8 @@ class EntityList { status = json['status']; stopDate = json['stopDate']; uom = json['uom']; + pharmacistRemarks = json['pharmacistRemarks']; + refill = json['refill']; } Map toJson() { @@ -152,6 +158,8 @@ class EntityList { data['status'] = this.status; data['stopDate'] = this.stopDate; data['uom'] = this.uom; + data['pharmacistRemarks'] = this.pharmacistRemarks; + data['refill'] = this.refill; return data; } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b079a661..80d77f3e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -48,6 +48,7 @@ postProcedure( PrescriptionViewModel model, DateTime doseTime, String doseUnit, + String icdCode, PatiantInformtion patient}) async { PostPrescriptionReqModel postProcedureReqModel = new PostPrescriptionReqModel(); @@ -67,7 +68,7 @@ postProcedure( frequency: frequency.isEmpty ? 1 : int.parse(frequency), remarks: instruction, approvalRequired: true, - icdcode10Id: "test2", + icdcode10Id: icdCode.toString(), doseTime: doseTimeIn.isEmpty ? 1 : int.parse(doseTimeIn), duration: duration.isEmpty ? 1 : int.parse(duration), doseStartDate: doseTime.toIso8601String())); @@ -127,6 +128,7 @@ class _PrescriptionFormWidgetState extends State { dynamic doseTime; dynamic indication; dynamic units; + dynamic x; List indicationList; String routeInatial = 'By Mouth'; @@ -176,11 +178,15 @@ class _PrescriptionFormWidgetState extends State { Widget build(BuildContext context) { ListSelectDialog drugDialog; final screenSize = MediaQuery.of(context).size; + // final routeArgs = ModalRoute.of(context).settings.arguments as Map; // patient = routeArgs['patient']; return BaseView( onModelReady: (model) async { + x = model.patientAssessmentList.map((element) { + return element.icdCode10ID; + }); GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( patientMRN: widget.patient.patientMRN, episodeID: widget.patient.episodeNo.toString(), @@ -193,7 +199,7 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationRoute(); await model.getMedicationFrequency(); await model.getMedicationDoseTime(); - await model.getMedicationIndications(); + //await model.getMedicationIndications(); await model.getPatientAssessment(getAssessmentReqModel); }, builder: ( @@ -210,7 +216,7 @@ class _PrescriptionFormWidgetState extends State { builder: (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( - height: 980, + height: 1010, child: Padding( padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), @@ -691,7 +697,6 @@ class _PrescriptionFormWidgetState extends State { // openDrugToDrug(); if (route == null || frequency == null || - indication == null || doseTime == null || duration == null || selectedDate == null || @@ -704,30 +709,54 @@ class _PrescriptionFormWidgetState extends State { if (formKey.currentState.validate()) { Navigator.pop(context); { + // var x = model + // .patientAssessmentList + // .map((value) => + // value.icdCode10ID) + // .toList() + // .join(','); postProcedure( - dose: strengthController.text, - doseUnit: - units['id'].toString(), - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: frequency['id'] - .toString(), - route: route['id'].toString(), - drugId: _selectedMedication - .itemId - .toString(), - strength: - strengthController.text, - indication: - indicationController.text, - instruction: - instructionController - .text, - doseTime: selectedDate); + icdCode: model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty + ? "test" + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + // icdCode: model + // .patientAssessmentList + // .map((value) => value + // .icdCode10ID + // .trim()) + // .toList() + // .join(' '), + dose: strengthController.text, + doseUnit: + units['id'].toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: + frequency['id'].toString(), + route: route['id'].toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController.text, + doseTime: selectedDate, + ); } } { diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 1588c4c4..5a212f56 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -200,7 +200,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.24, + 0.33, width: MediaQuery.of( context) .size @@ -239,7 +239,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.3499, + 0.3899, width: MediaQuery.of( context) .size @@ -357,6 +357,28 @@ class _NewPrescriptionScreenState extends State { ) ], ), + SizedBox( + height: + 5.0), + Row( + children: [ + AppText( + 'pharmacist Remarks : ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: AppText( + model.prescriptionList[0].entityList[index].pharmacistRemarks == null + ? "" + : model.prescriptionList[0].entityList[index].pharmacistRemarks, + fontSize: 15.0), + ) + ], + ), SizedBox( height: 20.0, ), @@ -383,20 +405,23 @@ class _NewPrescriptionScreenState extends State { ) ], ), + SizedBox( + height: 8.0, + ), Row( children: [ Expanded( child: Container( height: - 30, + 25, child: AppText( model.prescriptionList[0].entityList[index].remarks == null ? "" : model.prescriptionList[0].entityList[index].remarks, fontSize: - 11.5, + 12.5, ), ), ), @@ -417,7 +442,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.08, + 0.16, width: MediaQuery.of( context) .size @@ -431,32 +456,31 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( - doseUnit: - model.prescriptionList[0].entityList[index].doseDailyUnitID - .toString(), - doseStreangth: - model.prescriptionList[0].entityList[index].doseDailyQuantity - .toString(), - duration: - model.prescriptionList[0].entityList[index].doseDurationDays - .toString(), - startDate: - model.prescriptionList[0].entityList[index].startDate - .toString(), - dose: model + drugNameGeneric: model .prescriptionList[ 0] .entityList[ index] - .doseTimingID + .medicationName, + doseUnit: model.prescriptionList[0].entityList[index].doseDailyUnitID .toString(), - frequency: model + doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity + .toString(), + duration: model.prescriptionList[0].entityList[index].doseDurationDays + .toString(), + startDate: + model.prescriptionList[0].entityList[index].startDate + .toString(), + dose: model .prescriptionList[ 0] .entityList[ index] - .frequencyID + .doseTimingID .toString(), + frequency: + model.prescriptionList[0].entityList[index].frequencyID + .toString(), rouat: model .prescriptionList[ 0] diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 68a7e739..0d6609aa 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -1,6 +1,8 @@ +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; @@ -8,6 +10,7 @@ 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/dr_app_toast_msg.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/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -31,6 +34,7 @@ class UpdatePrescriptionForm extends StatefulWidget { final String enteredRemarks; final String startDate; final String frequency; + final String drugNameGeneric; final PrescriptionViewModel model; UpdatePrescriptionForm( @@ -46,7 +50,8 @@ class UpdatePrescriptionForm extends StatefulWidget { this.doseUnit, this.enteredRemarks, this.frequency, - this.model}); + this.model, + this.drugNameGeneric}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -62,6 +67,9 @@ class _UpdatePrescriptionFormState extends State { dynamic frequencyUpdate; dynamic updatedDuration; dynamic units; + GetMedicationResponseModel newSelectedMedication; + GlobalKey key = + new GlobalKey>(); @override void initState() { @@ -80,7 +88,7 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationRoute(); await model.getMedicationFrequency(); await model.getMedicationDoseTime(); - await model.getMedicationIndications(); + //await model.getMedicationIndications(); route = model.getLookupById(model.medicationRouteList, widget.route); doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); @@ -96,13 +104,13 @@ class _UpdatePrescriptionFormState extends State { NetworkBaseView( baseViewModel: model, child: DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 0.99, minChildSize: 0.6, builder: (BuildContext context, ScrollController scrollController) { return Container( - height: MediaQuery.of(context).size.height * 1.0, + height: MediaQuery.of(context).size.height * 1.3, child: Form( child: Padding( padding: EdgeInsets.symmetric( @@ -119,6 +127,78 @@ class _UpdatePrescriptionFormState extends State { ), Column( children: [ + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + setState(() { + newSelectedMedication = null; + }); + } + : null, + child: newSelectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( + widget.drugNameGeneric, + newSelectedMedication != null + ? newSelectedMedication + .genericName + : null, + true, + ), + itemSubmitted: (item) => setState( + () => newSelectedMedication = + 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( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + newSelectedMedication != null + ? newSelectedMedication + .description + + ('${newSelectedMedication.genericName}') + : null, + true, + ), + enabled: false, + ), + ), + ), + SizedBox( + height: 12, + ), Container( height: MediaQuery.of(context).size.height * 0.060, @@ -428,18 +508,23 @@ class _UpdatePrescriptionFormState extends State { 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( + newDrugId: + newSelectedMedication != null + ? newSelectedMedication + .itemId + .toString() + : widget.drugId, newDoseStreangth: strengthController .text.isNotEmpty ? strengthController.text : widget.doseStreangth, - newUnit: units != - null + newUnit: units != null ? units['id'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: widget - .doseStreangth, + doseStreangth: + widget.doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -447,25 +532,20 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: - updatedDuration != - null - ? updatedDuration[ - 'id'] - .toString() - : widget.duration, + newDuration: updatedDuration != + null + ? updatedDuration['id'] + .toString() + : widget.duration, drugId: widget.drugId, remarks: remarksController.text, - route: route != - null + route: route != null ? route['id'].toString() : widget.route, - frequency: - frequencyUpdate != - null - ? frequencyUpdate['id'] - .toString() - : widget.frequency, + frequency: frequencyUpdate != null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, dose: doseTime != null ? doseTime['id'].toString() : widget.dose, @@ -524,6 +604,7 @@ class _UpdatePrescriptionFormState extends State { updatePrescription( {PrescriptionViewModel model, int drugId, + int newDrugId, String frequencyId, String remarks, String dose, @@ -556,7 +637,7 @@ class _UpdatePrescriptionFormState extends State { ? int.parse(newDoseStreangth) : int.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, - itemId: drugId, + itemId: newDrugId != 0 ? newDrugId : drugId, doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), @@ -588,6 +669,7 @@ class _UpdatePrescriptionFormState extends State { void updatePrescriptionForm( {context, String drugName, + String drugNameGeneric, int drugId, String remarks, PrescriptionViewModel model, @@ -622,6 +704,7 @@ void updatePrescriptionForm( route: rouat, startDate: startDate, model: model, + drugNameGeneric: drugNameGeneric, ); }); } From 9ec78763dc1118af79baeb7356f856736a566e7c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 6 Feb 2021 02:22:14 +0200 Subject: [PATCH 263/421] update prescription --- .../update_prescription_form.dart | 186 +++++++++--------- 1 file changed, 93 insertions(+), 93 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 0d6609aa..714659ac 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -127,78 +127,78 @@ class _UpdatePrescriptionFormState extends State { ), Column( children: [ - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.allMedicationList != null - ? () { - setState(() { - newSelectedMedication = null; - }); - } - : null, - child: newSelectedMedication == null - ? AutoCompleteTextField< - GetMedicationResponseModel>( - decoration: - textFieldSelectorDecoration( - widget.drugNameGeneric, - newSelectedMedication != null - ? newSelectedMedication - .genericName - : null, - true, - ), - itemSubmitted: (item) => setState( - () => newSelectedMedication = - 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( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - newSelectedMedication != null - ? newSelectedMedication - .description + - ('${newSelectedMedication.genericName}') - : null, - true, - ), - enabled: false, - ), - ), - ), - SizedBox( - height: 12, - ), + // Container( + // height: MediaQuery.of(context).size.height * + // 0.070, + // child: InkWell( + // onTap: model.allMedicationList != null + // ? () { + // setState(() { + // newSelectedMedication = null; + // }); + // } + // : null, + // child: newSelectedMedication == null + // ? AutoCompleteTextField< + // GetMedicationResponseModel>( + // decoration: + // textFieldSelectorDecoration( + // widget.drugNameGeneric, + // newSelectedMedication != null + // ? newSelectedMedication + // .genericName + // : null, + // true, + // ), + // itemSubmitted: (item) => setState( + // () => newSelectedMedication = + // 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( + // decoration: + // textFieldSelectorDecoration( + // TranslationBase.of(context) + // .searchMedicineNameHere, + // newSelectedMedication != null + // ? newSelectedMedication + // .description + + // ('${newSelectedMedication.genericName}') + // : null, + // true, + // ), + // enabled: false, + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), Container( height: MediaQuery.of(context).size.height * 0.060, @@ -508,23 +508,18 @@ class _UpdatePrescriptionFormState extends State { 'update prescription'.toUpperCase(), onPressed: () { updatePrescription( - newDrugId: - newSelectedMedication != null - ? newSelectedMedication - .itemId - .toString() - : widget.drugId, newDoseStreangth: strengthController .text.isNotEmpty ? strengthController.text : widget.doseStreangth, - newUnit: units != null + newUnit: units != + null ? units['id'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, - doseStreangth: - widget.doseStreangth, + doseStreangth: widget + .doseStreangth, duration: widget.duration, startDate: widget.startDate, doseId: widget.dose, @@ -532,20 +527,25 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: updatedDuration != - null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: + updatedDuration != + null + ? updatedDuration[ + 'id'] + .toString() + : widget.duration, drugId: widget.drugId, remarks: remarksController.text, - route: route != null + route: route != + null ? route['id'].toString() : widget.route, - frequency: frequencyUpdate != null - ? frequencyUpdate['id'] - .toString() - : widget.frequency, + frequency: + frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, dose: doseTime != null ? doseTime['id'].toString() : widget.dose, @@ -604,7 +604,7 @@ class _UpdatePrescriptionFormState extends State { updatePrescription( {PrescriptionViewModel model, int drugId, - int newDrugId, + String newDrugId, String frequencyId, String remarks, String dose, @@ -637,7 +637,7 @@ class _UpdatePrescriptionFormState extends State { ? int.parse(newDoseStreangth) : int.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, - itemId: newDrugId != 0 ? newDrugId : drugId, + itemId: drugId, doseUnitId: newUnit.isNotEmpty ? int.parse(newUnit) : int.parse(doseUnit), route: route.isNotEmpty ? int.parse(route) : int.parse(routeId), From 2b3a7f33d18a261e875e80dc66d5b3d3a408efdc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 7 Feb 2021 09:24:48 +0200 Subject: [PATCH 264/421] working on some bug fixes and finish addmission request --- lib/config/config.dart | 4 + lib/config/localized_values.dart | 11 +- lib/core/enum/master_lookup_key.dart | 4 + .../admissionRequest/admission-request.dart | 200 +++++++ .../model/admissionRequest/clinic-model.dart | 33 ++ lib/core/service/base/lookup-service.dart | 8 + .../patient-admission-request-service.dart | 99 +++- .../patient-doctor-referral-service.dart | 7 +- lib/core/service/patient-ucaf-service.dart | 21 + .../patient-admission-request-viewmodel.dart | 70 ++- .../viewModel/patient-ucaf-viewmodel.dart | 22 + lib/routes.dart | 3 +- .../profile/UCAF/UCAF-detail-screen.dart | 81 ++- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../admission-request-detail-screen.dart | 8 +- .../admission-request-third-screen.dart | 519 +++++++++++++----- .../admission-request_second-screen.dart | 287 ++++++++-- .../referral/my-referral-patient-screen.dart | 2 + .../referral/refer-patient-screen.dart | 61 +- lib/util/translations_delegate_base.dart | 9 + .../patient-referral-item-widget.dart | 23 + 21 files changed, 1183 insertions(+), 291 deletions(-) create mode 100644 lib/core/model/admissionRequest/admission-request.dart create mode 100644 lib/core/model/admissionRequest/clinic-model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index abd07c03..765874b4 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -25,6 +25,7 @@ const PATIENT_GET_LIST_REFERAL_URL = const PATIENT_GET_CLINIC_BY_PROJECT_URL = "Services/DoctorApplication.svc/REST/GetClinicsByProjectID"; const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; +const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; //const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; @@ -193,6 +194,9 @@ const DRUG_TO_DRUG = const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; +const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; +const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; var selectedPatientType = 1; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d06b6f75..1ec01512 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -425,7 +425,8 @@ const Map> localizedValues = { 'en': "Expected Admission Date", 'ar': 'تاريخ القبول المتوقع' }, - 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, + // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, + 'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'}, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, 'treatmentLine': { 'en': "Main line of treatment", @@ -458,6 +459,10 @@ const Map> localizedValues = { 'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة' }, + 'postPlans': { + 'en': "POST PLANS", + 'ar': 'خطط البريد' + }, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, @@ -530,6 +535,7 @@ const Map> localizedValues = { 'condition': {'en': "Condition", 'ar': "الحالة"}, 'id': {'en': "ID", 'ar': "بطاقة هوية"}, 'quantity': {'en': "Quantity", 'ar': "الكمية"}, + 'durDays': {'en': "Dur.(days)", 'ar': "الفترة(أيام)"}, 'codeNo': {'en': "Code #", 'ar': "# الرمز"}, 'covered': {'en': "Covered", 'ar': "مغطى"}, 'approvalRequired': {'en': "Approval Required", 'ar': "الموافقة مطلوبة"}, @@ -698,6 +704,9 @@ const Map> localizedValues = { 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, + 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, + 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, + 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/core/enum/master_lookup_key.dart b/lib/core/enum/master_lookup_key.dart index e0c8ccc3..f42fa181 100644 --- a/lib/core/enum/master_lookup_key.dart +++ b/lib/core/enum/master_lookup_key.dart @@ -14,6 +14,7 @@ enum MasterKeysService { TemperatureMethods, Speciality, AdmissionRequestType, + DiagnosisSelectionType, } extension SelectedMasterKeysService on MasterKeysService { @@ -61,6 +62,9 @@ extension SelectedMasterKeysService on MasterKeysService { case MasterKeysService.AdmissionRequestType: return 2019; break; + case MasterKeysService.DiagnosisSelectionType: + return 2024; + break; } } } diff --git a/lib/core/model/admissionRequest/admission-request.dart b/lib/core/model/admissionRequest/admission-request.dart new file mode 100644 index 00000000..1ab5a990 --- /dev/null +++ b/lib/core/model/admissionRequest/admission-request.dart @@ -0,0 +1,200 @@ +class AdmissionRequest { + int patientMRN; + int admitToClinic; + bool isPregnant; + int pregnancyWeeks; + int pregnancyType; + int noOfBabies; + int mrpDoctorID; + String admissionDate; + int expectedDays; + int admissionType; + int admissionLocationID; + int roomCategoryID; + int wardID; + bool isSickLeaveRequired; + String sickLeaveComments; + bool isTransport; + String transportComments; + bool isPhysioAppointmentNeeded; + String physioAppointmentComments; + bool isOPDFollowupAppointmentNeeded; + String opdFollowUpComments; + bool isDietType; + int dietType; + String dietRemarks; + bool isPhysicalActivityModification; + String physicalActivityModificationComments; + int orStatus; + String mainLineOfTreatment; + int estimatedCost; + String elementsForImprovement; + bool isPackagePatient; + String complications; + String otherDepartmentInterventions; + String otherProcedures; + String pastMedicalHistory; + String pastSurgicalHistory; + List admissionRequestDiagnoses; + List admissionRequestProcedures; + int appointmentNo; + int episodeID; + int admissionRequestNo; + + AdmissionRequest( + {this.patientMRN, + this.admitToClinic, + this.isPregnant, + this.pregnancyWeeks = 0, + this.pregnancyType = 0, + this.noOfBabies = 0, + this.mrpDoctorID, + this.admissionDate, + this.expectedDays, + this.admissionType, + this.admissionLocationID = 0, + this.roomCategoryID = 0, + this.wardID, + this.isSickLeaveRequired, + this.sickLeaveComments = "", + this.isTransport = false, + this.transportComments = "", + this.isPhysioAppointmentNeeded = false, + this.physioAppointmentComments = "", + this.isOPDFollowupAppointmentNeeded = false, + this.opdFollowUpComments = "", + this.isDietType, + this.dietType, + this.dietRemarks, + this.isPhysicalActivityModification = false, + this.physicalActivityModificationComments = "", + this.orStatus = 1, + this.mainLineOfTreatment, + this.estimatedCost, + this.elementsForImprovement, + this.isPackagePatient = false, + this.complications = "", + this.otherDepartmentInterventions = "", + this.otherProcedures = "", + this.pastMedicalHistory = "", + this.pastSurgicalHistory = "", + this.admissionRequestDiagnoses, + this.admissionRequestProcedures, + this.appointmentNo, + this.episodeID, + this.admissionRequestNo}); + + AdmissionRequest.fromJson(Map json) { + patientMRN = json['patientMRN']; + admitToClinic = json['admitToClinic']; + isPregnant = json['isPregnant']; + pregnancyWeeks = json['pregnancyWeeks']; + pregnancyType = json['pregnancyType']; + noOfBabies = json['noOfBabies']; + mrpDoctorID = json['mrpDoctorID']; + admissionDate = json['admissionDate']; + expectedDays = json['expectedDays']; + admissionType = json['admissionType']; + admissionLocationID = json['admissionLocationID']; + roomCategoryID = json['roomCategoryID']; + wardID = json['wardID']; + isSickLeaveRequired = json['isSickLeaveRequired']; + sickLeaveComments = json['sickLeaveComments']; + isTransport = json['isTransport']; + transportComments = json['transportComments']; + isPhysioAppointmentNeeded = json['isPhysioAppointmentNeeded']; + physioAppointmentComments = json['physioAppointmentComments']; + isOPDFollowupAppointmentNeeded = json['isOPDFollowupAppointmentNeeded']; + opdFollowUpComments = json['opdFollowUpComments']; + isDietType = json['isDietType']; + dietType = json['dietType']; + dietRemarks = json['dietRemarks']; + isPhysicalActivityModification = json['isPhysicalActivityModification']; + physicalActivityModificationComments = + json['physicalActivityModificationComments']; + orStatus = json['orStatus']; + mainLineOfTreatment = json['mainLineOfTreatment']; + estimatedCost = json['estimatedCost']; + elementsForImprovement = json['elementsForImprovement']; + isPackagePatient = json['isPackagePatient']; + complications = json['complications']; + otherDepartmentInterventions = json['otherDepartmentInterventions']; + otherProcedures = json['otherProcedures']; + pastMedicalHistory = json['pastMedicalHistory']; + pastSurgicalHistory = json['pastSurgicalHistory']; + if (json['admissionRequestDiagnoses'] != null) { + admissionRequestDiagnoses = new List(); + json['admissionRequestDiagnoses'].forEach((v) { + admissionRequestDiagnoses.add(v); + // admissionRequestDiagnoses + // .add(new AdmissionRequestDiagnoses.fromJson(v)); + }); + } + if (json['admissionRequestProcedures'] != null) { + admissionRequestProcedures = new List(); + json['admissionRequestProcedures'].forEach((v) { + admissionRequestProcedures.add(v); + // admissionRequestProcedures + // .add(new AdmissionRequestProcedures.fromJson(v)); + }); + } + appointmentNo = json['appointmentNo']; + episodeID = json['episodeID']; + admissionRequestNo = json['admissionRequestNo']; + } + + Map toJson() { + final Map data = new Map(); + data['patientMRN'] = this.patientMRN; + data['admitToClinic'] = this.admitToClinic; + data['isPregnant'] = this.isPregnant; + data['pregnancyWeeks'] = this.pregnancyWeeks; + data['pregnancyType'] = this.pregnancyType; + data['noOfBabies'] = this.noOfBabies; + data['mrpDoctorID'] = this.mrpDoctorID; + data['admissionDate'] = this.admissionDate; + data['expectedDays'] = this.expectedDays; + data['admissionType'] = this.admissionType; + data['admissionLocationID'] = this.admissionLocationID; + data['roomCategoryID'] = this.roomCategoryID; + data['wardID'] = this.wardID; + data['isSickLeaveRequired'] = this.isSickLeaveRequired; + data['sickLeaveComments'] = this.sickLeaveComments; + data['isTransport'] = this.isTransport; + data['transportComments'] = this.transportComments; + data['isPhysioAppointmentNeeded'] = this.isPhysioAppointmentNeeded; + data['physioAppointmentComments'] = this.physioAppointmentComments; + data['isOPDFollowupAppointmentNeeded'] = + this.isOPDFollowupAppointmentNeeded; + data['opdFollowUpComments'] = this.opdFollowUpComments; + data['isDietType'] = this.isDietType; + data['dietType'] = this.dietType; + data['dietRemarks'] = this.dietRemarks; + data['isPhysicalActivityModification'] = + this.isPhysicalActivityModification; + data['physicalActivityModificationComments'] = + this.physicalActivityModificationComments; + data['orStatus'] = this.orStatus; + data['mainLineOfTreatment'] = this.mainLineOfTreatment; + data['estimatedCost'] = this.estimatedCost; + data['elementsForImprovement'] = this.elementsForImprovement; + data['isPackagePatient'] = this.isPackagePatient; + data['complications'] = this.complications; + data['otherDepartmentInterventions'] = this.otherDepartmentInterventions; + data['otherProcedures'] = this.otherProcedures; + data['pastMedicalHistory'] = this.pastMedicalHistory; + data['pastSurgicalHistory'] = this.pastSurgicalHistory; + if (this.admissionRequestDiagnoses != null) { + data['admissionRequestDiagnoses'] = this.admissionRequestDiagnoses; + // this.admissionRequestDiagnoses.map((v) => v.toJson()).toList(); + } + if (this.admissionRequestProcedures != null) { + data['admissionRequestProcedures'] = + this.admissionRequestProcedures.map((v) => v.toJson()).toList(); + } + data['appointmentNo'] = this.appointmentNo; + data['episodeID'] = this.episodeID; + data['admissionRequestNo'] = this.admissionRequestNo; + return data; + } +} diff --git a/lib/core/model/admissionRequest/clinic-model.dart b/lib/core/model/admissionRequest/clinic-model.dart new file mode 100644 index 00000000..05d34645 --- /dev/null +++ b/lib/core/model/admissionRequest/clinic-model.dart @@ -0,0 +1,33 @@ +class Clinic { + int clinicGroupID; + String clinicGroupName; + int clinicID; + String clinicNameArabic; + String clinicNameEnglish; + + Clinic( + {this.clinicGroupID, + this.clinicGroupName, + this.clinicID, + this.clinicNameArabic, + this.clinicNameEnglish}); + + Clinic.fromJson(Map json) { + clinicGroupID = json['clinicGroupID']; + clinicGroupName = json['clinicGroupName']; + clinicID = json['clinicID']; + clinicNameArabic = json['clinicNameArabic']; + clinicNameEnglish = json['clinicNameEnglish']; + } + + Map toJson() { + final Map data = new Map(); + data['clinicGroupID'] = this.clinicGroupID; + data['clinicGroupName'] = this.clinicGroupName; + data['clinicID'] = this.clinicID; + data['clinicNameArabic'] = this.clinicNameArabic; + data['clinicNameEnglish'] = this.clinicNameEnglish; + return data; + } + +} \ No newline at end of file diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 48a78ae7..b662b62c 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -38,6 +38,7 @@ class LookupService extends BaseService { List listOfTemperatureMethods = []; List listOfSpeciality = []; List listOfAdmissionType = []; + List listOfDiagnosisSelectionTypes = []; Future getMasterLookup(MasterKeysService masterKeys) async { hasError = false; @@ -153,6 +154,13 @@ class LookupService extends BaseService { listOfAdmissionType.add(v); }); break; + case MasterKeysService.DiagnosisSelectionType: + listOfDiagnosisSelectionTypes.clear(); + entryList.forEach((v) { + // listOfAdmissionType.add(MasterKeyModel.fromJson(v)); + listOfDiagnosisSelectionTypes.add(v); + }); + break; } } diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index dca7b60d..c287c160 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -1,14 +1,18 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; class AdmissionRequestService extends LookupService { + List clinicList = []; List doctorsList = []; List specialityList = []; List wardList = []; List diagnosisTypesList = []; List allergiesLookupList = []; + List dietTypesList = []; + List icdCodes = []; setSpecialityList() { specialityList.clear(); @@ -24,9 +28,12 @@ class AdmissionRequestService extends LookupService { }); } - Future getDoctorsList() async { + Future getDoctorsList(int clinicId) async { hasError = false; + Map body = Map(); + body['ClinicID'] = clinicId; + await baseAppClient.post( PATIENT_GET_DOCTOR_BY_CLINIC_URL, onSuccess: (dynamic response, int statusCode) { @@ -37,6 +44,26 @@ class AdmissionRequestService extends LookupService { hasError = true; super.error = error; }, + body: body, + ); + } + + Future getClinics() async { + hasError = false; + + await baseAppClient.post( + GET_CLINICS, + onSuccess: (dynamic response, int statusCode) { + clinicList.clear(); + if (response['listClinics'] != null && + response['listClinics']['entityList'] != null) { + clinicList.addAll(response['listClinics']['entityList']); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map(), ); } @@ -86,4 +113,74 @@ class AdmissionRequestService extends LookupService { body: Map(), ); } + + Future getDietTypesList() async { + hasError = false; + + await baseAppClient.post( + GET_DIET_TYPES, + onSuccess: (dynamic response, int statusCode) { + dietTypesList.clear(); + if (response['DietTypeList'] != null && + response['DietTypeList']['entityList'] != null) { + response['DietTypeList']['entityList'].forEach((v) { + // diagnosisTypesList.add(MasterKeyModel.fromJson(v)); + dietTypesList.add(v); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } + + Future getICDCodes(int patientMrn) async { + hasError = false; + + Map body = Map(); + body['PatientMRN'] = patientMrn; + body['isPatientDiagnosisOnly'] = true; + + await baseAppClient.post( + GET_ICD_CODES, + onSuccess: (dynamic response, int statusCode) { + icdCodes.clear(); + if (response['ICDCodesList'] != null) { + icdCodes.addAll(response['ICDCodesList']); + // response['ICDCodesList'].forEach((v) { + // diagnosisTypesList.add(MasterKeyModel.fromJson(v)); + // icdCodes.add(v); + // }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + + Future makeAdmissionRequest(AdmissionRequest admissionRequest) async{ + hasError = false; + + Map body = Map(); + body['AdmissionRequestViewModel'] = admissionRequest.toJson(); + + await baseAppClient.post( + POST_ADMISSION_REQUEST, + onSuccess: (dynamic response, int statusCode) { + print(response); + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: body, + ); + } + } diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index f452cfb6..69f8e5e5 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -197,12 +197,13 @@ class PatientReferralService extends LookupService { DoctorProfileModel doctorProfile = await getDoctorProfile(); Map body = Map(); - body['IsAccepted'] = isAccepted; - body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; body['PatientMRN'] = pendingReferral.patientID; + body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; + body['SetupID'] = pendingReferral.sourceSetupID; + body['ProjectID'] = pendingReferral.sourceProjectId; + body['IsAccepted'] = isAccepted; body['PatientName'] = pendingReferral.patientName; body['ReferralResponse'] = pendingReferral.remarksFromSource; - body['SetupID'] = pendingReferral.sourceSetupID; body['DoctorName'] = doctorProfile.doctorName; await baseAppClient.post( diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index e7ecc9f2..429e78a9 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; import 'package:doctor_app_flutter/core/service/base/lookup-service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; @@ -14,6 +15,7 @@ class UcafService extends LookupService { VitalSignData patientVitalSigns; List patientAssessmentList = []; List orderProcedureList = []; + PrescriptionModel prescriptionList; Future getPatientChiefComplaint(PatiantInformtion patient) async { hasError = false; @@ -81,6 +83,25 @@ class UcafService extends LookupService { }, body: body); } + Future getPrescription(PatiantInformtion patient) async { + hasError = false; + + Map body = Map(); + body['PatientMRN'] = patient.patientMRN; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; + + hasError = false; + prescriptionList = null; + await baseAppClient.post(GET_PRESCRIPTION_LIST, + onSuccess: (dynamic response, int statusCode) { + prescriptionList = PrescriptionModel.fromJson(response['PrescriptionList']); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + Future getOrderProcedures(PatiantInformtion patient) async { hasError = false; Map body = Map(); diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index d427eb67..5b079512 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/ward-model.dart'; import 'package:doctor_app_flutter/core/service/patient-admission-request-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -12,6 +13,8 @@ class AdmissionRequestViewModel extends BaseViewModel{ AdmissionRequestService _admissionRequestService = locator(); + List get clinicList => _admissionRequestService.clinicList; + List get doctorsList => _admissionRequestService.doctorsList; List get speciality => _admissionRequestService.specialityList; @@ -24,33 +27,44 @@ class AdmissionRequestViewModel extends BaseViewModel{ List get allergiesList => _admissionRequestService.allergiesLookupList; - String selectedLanguage; + List get dietTypesList => _admissionRequestService.dietTypesList; - Future getLanguage() async { - selectedLanguage = await sharedPref.getString(APP_Language); - } + List get icdCodes => _admissionRequestService.icdCodes; + + List get listOfDiagnosisSelectionTypes => _admissionRequestService.listOfDiagnosisSelectionTypes; + + AdmissionRequest admissionRequestData; Future getSpecialityList() async { - await getLanguage(); await getMasterLookup(MasterKeysService.Speciality); if (!_admissionRequestService.hasError) { _admissionRequestService.setSpecialityList(); - await getClinicDoctors(); + await getClinicDoctors(1); } } - Future getClinicDoctors() async { - setState(ViewState.Busy); - await _admissionRequestService.getDoctorsList(); + Future getClinics() async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getClinics(); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getClinicDoctors(int clinicId) async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getDoctorsList(clinicId); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } Future getWards() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; @@ -60,7 +74,7 @@ class AdmissionRequestViewModel extends BaseViewModel{ } Future getDiagnosis() async { - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; @@ -76,8 +90,38 @@ class AdmissionRequestViewModel extends BaseViewModel{ } } - Future getMasterLookup(MasterKeysService keysService) async { + Future getDietTypes() async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getDietTypesList(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getICDCodes(int patientMrn) async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getICDCodes(patientMrn); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future makeAdmissionRequest() async{ setState(ViewState.Busy); + await _admissionRequestService.makeAdmissionRequest(admissionRequestData); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + + Future getMasterLookup(MasterKeysService keysService) async { + setState(ViewState.BusyLocal); await _admissionRequestService.getMasterLookup(keysService); if (_admissionRequestService.hasError) { error = _admissionRequestService.error; diff --git a/lib/core/viewModel/patient-ucaf-viewmodel.dart b/lib/core/viewModel/patient-ucaf-viewmodel.dart index ae8fc96f..f48ef485 100644 --- a/lib/core/viewModel/patient-ucaf-viewmodel.dart +++ b/lib/core/viewModel/patient-ucaf-viewmodel.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/service/patient-ucaf-service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; @@ -29,10 +30,18 @@ class UcafViewModel extends BaseViewModel { List get diagnosisConditions => _ucafService.listOfDiagnosisCondition; + PrescriptionModel get prescriptionList => _ucafService.prescriptionList; + List get orderProcedures => _ucafService.orderProcedureList; String selectedLanguage; + resetDataInFirst(){ + _ucafService.patientAssessmentList = []; + _ucafService.orderProcedureList = []; + _ucafService.prescriptionList = null; + } + Future getLanguage() async { selectedLanguage = await sharedPref.getString(APP_Language); } @@ -90,6 +99,19 @@ class UcafViewModel extends BaseViewModel { } } + Future getPrescription(PatiantInformtion patient) async { + if (prescriptionList == null) { + setState(ViewState.Busy); + await _ucafService.getPrescription(patient); + if (_ucafService.hasError) { + error = _ucafService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + } + MasterKeyModel findMasterDataById( {@required MasterKeysService masterKeys, dynamic id}) { switch (masterKeys) { diff --git a/lib/routes.dart b/lib/routes.dart index 8f2b08a4..6c5fc954 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -137,9 +137,10 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), - PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), + PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestThirdScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), + // PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), UPDATE_EPISODE: (_) => UpdateSoapIndex( isUpdate: true, diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index 71955b0c..f4b26f6a 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-ucaf-viewmodel.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; @@ -35,6 +36,7 @@ class _UcafDetailScreenState extends State { return BaseView( onModelReady: (model) async { + model.resetDataInFirst(); await model.getLanguage(); await model.getPatientAssessment(patient); }, @@ -54,8 +56,8 @@ class _UcafDetailScreenState extends State { height: 10, ), Container( - margin: - EdgeInsets.symmetric(vertical: 16, horizontal: 16), + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), child: Column( children: [ treatmentStepsBar( @@ -63,7 +65,8 @@ class _UcafDetailScreenState extends State { SizedBox( height: 16, ), - ...getSelectedTreatmentStepItem(context, model), + ...getSelectedTreatmentStepItem( + context, model), ], ), ), @@ -73,8 +76,7 @@ class _UcafDetailScreenState extends State { ), ), Container( - margin: - EdgeInsets.symmetric(vertical: 8, horizontal: 16), + margin: EdgeInsets.symmetric(vertical: 8, horizontal: 16), child: BorderedButton( TranslationBase.of(context).save, hasBorder: true, @@ -85,21 +87,22 @@ class _UcafDetailScreenState extends State { textColor: Colors.white, fontSize: SizeConfig.textMultiplier * 2.0, handler: () async { - await model.postUCAF(patient); - if(model.state == ViewState.Idle){ - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).postUcafSuccessMsg); - Navigator.of(context).popUntil((route){ - return route.settings.name == PATIENTS_PROFILE; - }); - } else { - DrAppToastMsg.showErrorToast(model.error); - } + await model.postUCAF(patient); + if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).postUcafSuccessMsg); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + } else { + DrAppToastMsg.showErrorToast(model.error); + } }, ), ), Container( - margin: - EdgeInsets.only(left: 16, right: 16, top: 0.0, bottom: 8), + margin: EdgeInsets.only( + left: 16, right: 16, top: 0.0, bottom: 8), child: BorderedButton( TranslationBase.of(context).cancel, hasBorder: true, @@ -110,10 +113,9 @@ class _UcafDetailScreenState extends State { textColor: HexColor("#B8382B"), fontSize: SizeConfig.textMultiplier * 2.2, handler: () { - Navigator.of(context).popUntil((route){ + Navigator.of(context).popUntil((route) { return route.settings.name == PATIENTS_PROFILE; }); - }, ), ), @@ -164,7 +166,7 @@ class _UcafDetailScreenState extends State { if (__treatmentSteps.indexOf(item) == 0) { await model.getPatientAssessment(patient); } else if (__treatmentSteps.indexOf(item) == 1) { - print("call Medications"); + await model.getPrescription(patient); } if (__treatmentSteps.indexOf(item) == 2) { await model.getOrderProcedures(patient); @@ -198,7 +200,14 @@ class _UcafDetailScreenState extends State { } break; case 1: - return [...List.generate(2, (index) => MedicationWidget()).toList()]; + return [ + ...List.generate( + model.prescriptionList != null + ? model.prescriptionList.entityList.length + : 0, + (index) => MedicationWidget( + model, model.prescriptionList.entityList[index])).toList() + ]; break; case 2: if (model.orderProcedures != null) { @@ -326,6 +335,11 @@ class DiagnosisWidget extends StatelessWidget { } class MedicationWidget extends StatelessWidget { + final UcafViewModel model; + final EntityList prescription; + + MedicationWidget(this.model, this.prescription); + @override Widget build(BuildContext context) { return Column( @@ -339,7 +353,7 @@ class MedicationWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "6", + "${prescription.medicineCode}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -352,7 +366,7 @@ class MedicationWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "35.6", + "${prescription.medicationPrice}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -365,7 +379,24 @@ class MedicationWidget extends StatelessWidget { fontSize: SizeConfig.textMultiplier * 2.0, ), AppText( - "3", + "${prescription.quantity}", + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + AppText( + "${TranslationBase.of(context).durDays}: ", + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.0, + ), + AppText( + "${prescription.doseDurationDays}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -378,7 +409,7 @@ class MedicationWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "EVE SKIN CREAM WITH HONEY -170GM", + "${prescription.medicationName}", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), @@ -392,7 +423,7 @@ class MedicationWidget extends StatelessWidget { children: [ Expanded( child: AppText( - "Every other day for 5 days", + "${prescription.doseDetail}", fontWeight: FontWeight.normal, fontSize: SizeConfig.textMultiplier * 2.0, ), diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index 9b9ae5a5..d4c1b803 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -233,7 +233,7 @@ class _UCAFInputScreenState extends State { controller: _additionalComplaintsController, keyboardType: TextInputType.multiline, minLines: 1, - maxLines: 15, + maxLines: 20, )), SizedBox( height: 16, diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 76ce6e2b..23e33db3 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -12,6 +13,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; import '../../../../routes.dart'; @@ -32,6 +34,7 @@ class _AdmissionRequestDetailScreenState final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getSpecialityList(), @@ -124,7 +127,7 @@ class _AdmissionRequestDetailScreenState ListSelectDialog( list: model.speciality, attributeName: - model.selectedLanguage == 'ar' + projectViewModel.isArabic ? 'nameAr' : 'nameEn', attributeValueId: 'id', @@ -151,8 +154,7 @@ class _AdmissionRequestDetailScreenState TranslationBase.of(context) .speciality, _selectedSpeciality != null - ? model.selectedLanguage == - 'ar' + ? projectViewModel.isArabic ? _selectedSpeciality[ 'nameAr'] : _selectedSpeciality[ diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index aacff6dd..f5dbf704 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -1,29 +1,43 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import '../../../../routes.dart'; class AdmissionRequestThirdScreen extends StatefulWidget { @override - _AdmissionRequestThirdScreenState createState() => _AdmissionRequestThirdScreenState(); + _AdmissionRequestThirdScreenState createState() => + _AdmissionRequestThirdScreenState(); } -class _AdmissionRequestThirdScreenState extends State { - +class _AdmissionRequestThirdScreenState + extends State { final _postPlansEstimatedCostController = TextEditingController(); final _dietTypeRemarksController = TextEditingController(); - DateTime _dischargeDate; + final _estimatedCostController = TextEditingController(); + + // DateTime _dischargeDate; + dynamic _selectedClinic; + dynamic _selectedDoctor; dynamic _selectedDietType; @override @@ -31,162 +45,364 @@ class _AdmissionRequestThirdScreenState extends State( - // onModelReady: (model) => model.getMasterLookup(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).admissionRequest, body: model.doctorsList != null ? Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + children: [ + Expanded( + child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).postPlansEstimatedCost, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), + PatientPageHeaderWidget(patient), Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .postPlansEstimatedCost, - null, - false), - enabled: true, - controller: _postPlansEstimatedCostController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () { - if (_dischargeDate == null) { - _dischargeDate = DateTime.now(); - } - _selectDate( - context, _dischargeDate, - (picked) { - setState(() { - _dischargeDate = picked; - }); - }); - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .expectedAdmissionDate, - _dischargeDate != null - ? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}" + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context) + .specialityAndDoctorDetail, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + SizedBox( + height: 20, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.clinicList != null && + model.clinicList.length > 0 + ? () { + openListDialogField( + 'clinicGroupName', + 'clinicID', + model.clinicList, + (selectedValue) { + setState(() { + _selectedClinic = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getClinics().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.clinicList.length > 0) { + openListDialogField( + 'clinicGroupName', + 'clinicID', + model.clinicList, + (selectedValue) { + setState(() { + _selectedClinic = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .clinic, + _selectedClinic != null + ? _selectedClinic[ + 'clinicGroupName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 20, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedClinic != null + ? model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + openListDialogField( + 'DoctorName', + 'DoctorID', + model.doctorsList, + (selectedValue) { + setState(() { + _selectedDoctor = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils + .showMyDialog(context); + await model + .getClinicDoctors( + _selectedClinic[ + 'clinicID']) + .then((_) => + GifLoaderDialogUtils + .hideDialog( + context)); + if (model.state == + ViewState.Idle && + model.doctorsList.length > + 0) { + openListDialogField( + 'DoctorName', + 'DoctorID', + model.doctorsList, + (selectedValue) { + setState(() { + _selectedDoctor = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + } : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .doctor, + _selectedDoctor != null + ? _selectedDoctor[ + 'DoctorName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context) + .postPlansEstimatedCost, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .estimatedCost, + null, + false), + enabled: true, + controller: _estimatedCostController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, )), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: /*model.doctorsList != null && - model.doctorsList.length > 0 + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).postPlans, + null, + false), + enabled: true, + controller: _postPlansEstimatedCostController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + /* Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () { + if (_dischargeDate == null) { + _dischargeDate = DateTime.now(); + } + _selectDate(context, _dischargeDate, + (picked) { + setState(() { + _dischargeDate = picked; + }); + }); + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedAdmissionDate, + _dischargeDate != null + ? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ),*/ + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.dietTypesList != null && + model.dietTypesList.length > 0 ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.doctorsList, - attributeName: 'DoctorName', - attributeValueId: 'DoctorID', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedDoctor = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - :*/ null, - child: TextField( - decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).dietType, - /* _admissionType != null - ? _admissionType['DoctorName'] - :*/ null, - true), - enabled: false, - ), + openListDialogField('nameEn', 'id', + model.dietTypesList, + (selectedValue) { + setState(() { + _selectedDietType = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getDietTypes().then( + (_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.dietTypesList.length > + 0) { + openListDialogField('nameEn', + 'id', model.dietTypesList, + (selectedValue) { + setState(() { + _selectedDietType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .dietType, + _selectedDietType != null + ? _selectedDietType['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .dietTypeRemarks, + null, + false), + enabled: true, + controller: _dietTypeRemarksController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + ], ), ), - SizedBox( - height: 10, - ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .dietTypeRemarks, - null, - false), - enabled: true, - controller: _dietTypeRemarksController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), ], ), ), - ], - ), - ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).save, - color: HexColor("#B8382B"), - onPressed: null, - ), - ), - ], - ) + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: () { + model.admissionRequestData = AdmissionRequest(); + if (_selectedClinic != null && + _selectedDoctor != null && + _estimatedCostController.text != "" && + _postPlansEstimatedCostController.text != "") { + model.admissionRequestData.patientMRN = patient.patientMRN; + model.admissionRequestData.appointmentNo = patient.appointmentNo; + model.admissionRequestData.episodeID = patient.episodeNo; + model.admissionRequestData.admissionRequestNo = 0; + + model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; + model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; + model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); + model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; + model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; + model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; + model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; + Navigator.of(context).pushNamed( + PATIENT_ADMISSION_REQUEST_2, + arguments: {'patient': patient, 'admission-data' : model.admissionRequestData}); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + } + }, + ), + ), + ], + ) : Container(), ), ); @@ -205,4 +421,25 @@ class _AdmissionRequestThirdScreenState extends State list, Function(dynamic selectedValue) okFunction) { + ListSelectDialog dialog = ListSelectDialog( + list: list, + attributeName: attributeName, + attributeValueId: attributeValueId, + usingSearch: true, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + okFunction(selectedValue); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } } diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index b65b7f43..2ffd5455 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; @@ -15,6 +16,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -32,20 +34,29 @@ class _AdmissionRequestSecondScreenState extends State { final _expectedDaysController = TextEditingController(); final _treatmentLineController = TextEditingController(); - final _preOperativeOrdersController = TextEditingController(); + + // final _preOperativeOrdersController = TextEditingController(); DateTime _expectedAdmissionDate; - bool _emergencyAdmission = false; + + // bool _emergencyAdmission = false; + bool _isSickLeaveRequired = false; bool _patientPregnant = false; - bool _preAnesthesiaReferred = false; + + // bool _preAnesthesiaReferred = false; dynamic _selectedWard; dynamic _selectedAdmissionType; dynamic _selectedDiagnosis; - dynamic _selectedAllergies; + dynamic _selectedIcd; + dynamic _selectedDiagnosisType; + + // dynamic _selectedAllergies; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + AdmissionRequest admissionRequest = routeArgs['admission-data']; + final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -134,6 +145,7 @@ class _AdmissionRequestSecondScreenState SizedBox( height: 10, ), +/* CheckboxListTile( title: AppText( TranslationBase.of(context) @@ -151,6 +163,24 @@ class _AdmissionRequestSecondScreenState ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), ), +*/ + CheckboxListTile( + title: AppText( + TranslationBase.of(context) + .isSickLeaveRequired, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _isSickLeaveRequired, + onChanged: (newValue) { + setState(() { + _isSickLeaveRequired = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), CheckboxListTile( title: AppText( TranslationBase.of(context).patientPregnant, @@ -199,7 +229,11 @@ class _AdmissionRequestSecondScreenState }); } : () async { - await model.getWards(); + GifLoaderDialogUtils.showMyDialog( + context); + await model.getWards().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); if (model.state == ViewState.Idle && model.wardList.length > 0) { openListDialogField('description', @@ -230,7 +264,7 @@ class _AdmissionRequestSecondScreenState ), ), ), - CheckboxListTile( + /* CheckboxListTile( title: AppText( TranslationBase.of(context) .preAnesthesiaReferred, @@ -246,6 +280,9 @@ class _AdmissionRequestSecondScreenState controlAffinity: ListTileControlAffinity.leading, contentPadding: EdgeInsets.all(0), + ),*/ + SizedBox( + height: 10, ), Container( height: screenSize.height * 0.070, @@ -263,9 +300,15 @@ class _AdmissionRequestSecondScreenState }); } : () async { - await model.getMasterLookup( - MasterKeysService - .AdmissionRequestType); + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getMasterLookup( + MasterKeysService + .AdmissionRequestType) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); if (model.state == ViewState.Idle && model.admissionTypeList.length > 0) { @@ -303,6 +346,17 @@ class _AdmissionRequestSecondScreenState SizedBox( height: 10, ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).diagnosisDetail, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), Container( height: screenSize.height * 0.070, child: InkWell( @@ -319,7 +373,11 @@ class _AdmissionRequestSecondScreenState }); } : () async { - await model.getDiagnosis(); + GifLoaderDialogUtils.showMyDialog( + context); + await model.getDiagnosis().then( + (_) => GifLoaderDialogUtils + .hideDialog(context)); if (model.state == ViewState.Idle && model.diagnosisTypesList .length > @@ -360,6 +418,133 @@ class _AdmissionRequestSecondScreenState height: 10, ), Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.icdCodes != null && + model.icdCodes.length > 0 + ? () { + openListDialogField('description', + 'code', model.icdCodes, + (selectedValue) { + setState(() { + _selectedIcd = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getICDCodes(patient.patientMRN) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.icdCodes.length > 0) { + openListDialogField('description', + 'code', model.icdCodes, + (selectedValue) { + setState(() { + _selectedIcd = selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).icd, + _selectedIcd != null + ? _selectedIcd['description'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisSelectionTypes != + null && + model.listOfDiagnosisSelectionTypes + .length > + 0 + ? () { + openListDialogField( + 'description', + 'code', + model + .listOfDiagnosisSelectionTypes, + (selectedValue) { + setState(() { + _selectedDiagnosisType = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getMasterLookup( + MasterKeysService + .DiagnosisSelectionType) + .then((_) => + GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.listOfDiagnosisSelectionTypes + .length > + 0) { + openListDialogField( + 'description', + 'code', + model + .listOfDiagnosisSelectionTypes, + (selectedValue) { + setState(() { + _selectedDiagnosisType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .diagnoseType, + _selectedDiagnosisType != null + ? _selectedDiagnosisType[ + 'description'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + /*Container( child: TextField( decoration: Helpers.textFieldSelectorDecoration( @@ -425,7 +610,7 @@ class _AdmissionRequestSecondScreenState enabled: false, ), ), - ), + ),*/ ], ), ), @@ -436,12 +621,48 @@ class _AdmissionRequestSecondScreenState Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), child: AppButton( - title: TranslationBase.of(context).next, + title: TranslationBase.of(context).save, color: HexColor("#B8382B"), - onPressed: () { - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_3, - arguments: {'patient': patient}); + onPressed: () async { + if (_expectedDaysController.text != "" && + _expectedAdmissionDate != null && + _treatmentLineController.text != "" && + _selectedWard != null && + _selectedAdmissionType != null && + _selectedDiagnosis != null && + _selectedIcd != null && + _selectedDiagnosisType != null) { + model.admissionRequestData = admissionRequest; + + model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text); + model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String(); + model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; + model.admissionRequestData.isPregnant = _patientPregnant; + model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text; + model.admissionRequestData.wardID = 0; + model.admissionRequestData.admissionType = _selectedAdmissionType['id']; + dynamic admissionRequestDiagnoses = [ + { + 'diagnosisDescription' : _selectedDiagnosis['nameEn'], + 'diagnosisType' : _selectedDiagnosis['id'], + 'icdCode' : _selectedIcd['code'], + 'icdCodeDescription' : _selectedIcd['description'], + 'type' : _selectedDiagnosisType['code'], + 'remarks' : "", + 'isActive' : true, + } + ]; + model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses; + model.admissionRequestData.admissionRequestProcedures = []; + await model.makeAdmissionRequest(); + if(model.state == ViewState.ErrorLocal){ + DrAppToastMsg.showErrorToast( + model.error); + } + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + } }, ), ), @@ -486,38 +707,4 @@ class _AdmissionRequestSecondScreenState }, ); } - -/* - onTap: model.wardList != null && - model.wardList.length > 0 - ? () { - openListDialogField('description', - 'description', model.wardList, - (selectedValue) { - setState(() { - _selectedWard = selectedValue; - }); - }); - } - : () async { - await model.getWards(); - if (model.state == ViewState.Idle && - model.wardList.length > 0) { - openListDialogField('description', - 'description', model.wardList, - (selectedValue) { - setState(() { - _selectedWard = selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - */ } diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index ab2beaf8..5e749011 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -73,6 +73,8 @@ class MyReferralPatientScreen extends StatelessWidget { remark: model.pendingReferral[index].remarksFromSource, referredOn: model.pendingReferral[index].referredOn, + answerFromTarget: + model.pendingReferral[index].answerFromTarget, infoIcon: InkWell( onTap: () { Navigator.of(context) diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index a3d74430..3903b46a 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -103,6 +103,8 @@ class _PatientMakeReferralScreenState extends State { clinicDescription: null, remark: model.patientReferral[0].remarksFromSource, referredOn: model.patientReferral[0].referredOn, + answerFromTarget: + model.patientReferral[0].answerFromTarget, ), ], ), @@ -271,7 +273,8 @@ class _PatientMakeReferralScreenState extends State { attributeName: 'ClinicDescription', attributeValueId: 'ClinicID', usingSearch: true, - hintSearchText: TranslationBase.of(context).clinicSearch, + hintSearchText: + TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -321,7 +324,8 @@ class _PatientMakeReferralScreenState extends State { attributeName: 'DoctorName', attributeValueId: 'DoctorID', usingSearch: true, - hintSearchText: TranslationBase.of(context).doctorSearch, + hintSearchText: + TranslationBase.of(context).doctorSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { setState(() { @@ -380,9 +384,9 @@ class _PatientMakeReferralScreenState extends State { TranslationBase.of(context).remarks, null, false), enabled: true, controller: _remarksController, - inputFormatters: [ - FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) - ], + // inputFormatters: [ + // FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) + // ], keyboardType: TextInputType.text, minLines: 4, maxLines: 6, @@ -406,53 +410,6 @@ class _PatientMakeReferralScreenState extends State { setState(() { appointmentDate = picked; }); - /* model - .getPatientArrivalList(DateUtils.convertStringToDateFormat( - appointmentDate.toString(), "yyyy-MM-dd")) - .then((_) { - if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); - return; - } - if (model.patientArrivalList != null && - model.patientArrivalList.length > 0) { - List appointments = model.getAppointmentsByPatientName( - "${patient.firstName} ${patient.middleName} ${patient.lastName}"); - if (appointments.length > 0) { - ListSelectDialog dialog = ListSelectDialog( - list: appointments, - attributeName: 'appointmentNo', - attributeValueId: 'appointmentNo', - okText: TranslationBase.of(context).ok, - okFunction: (selectedValue) { - setState(() { - _selectedPatientArrivalEntity = - PatientArrivalEntity.fromJson(selectedValue); - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } else { - setState(() { - _selectedPatientArrivalEntity = null; - }); - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).noAppointmentsErrorMsg); - } - } else { - setState(() { - _selectedPatientArrivalEntity = null; - }); - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).noAppointmentsErrorMsg); - } - });*/ } } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index cfb57edb..305d91f6 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -726,6 +726,8 @@ class TranslationBase { String get emergencyAdmission => localizedValues['emergencyAdmission'][locale.languageCode]; + String get isSickLeaveRequired => + localizedValues['isSickLeaveRequired'][locale.languageCode]; String get patientPregnant => localizedValues['patientPregnant'][locale.languageCode]; @@ -763,6 +765,8 @@ class TranslationBase { String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; + String get postPlans => + localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; @@ -866,6 +870,8 @@ class TranslationBase { String get quantity => localizedValues['quantity'][locale.languageCode]; + String get durDays => localizedValues['durDays'][locale.languageCode]; + String get codeNo => localizedValues['codeNo'][locale.languageCode]; String get covered => localizedValues['covered'][locale.languageCode]; @@ -1071,6 +1077,9 @@ String get ICDName => String get referralStatusNotSeen => localizedValues['referralStatusNotSeen'][locale.languageCode]; String get clinicSearch => localizedValues['clinicSearch'][locale.languageCode]; String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; + String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index ab89ab33..5924c89c 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -12,6 +12,7 @@ class PatientReferralItemWidget extends StatelessWidget { final String clinicDescription; final String remark; final String referredOn; + final String answerFromTarget; final Widget infoIcon; PatientReferralItemWidget( @@ -24,6 +25,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.clinicDescription, this.remark, this.referredOn, + this.answerFromTarget, this.infoIcon, }); @@ -207,6 +209,27 @@ class PatientReferralItemWidget extends StatelessWidget { ), ], ), + if (answerFromTarget != null) + SizedBox( + height: 8, + ), + if (answerFromTarget != null) + Row( + children: [ + AppText( + TranslationBase.of(context).referralResponse, + color: Colors.grey, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + AppText( + answerFromTarget != "" ? answerFromTarget : '-', + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + ], + ), SizedBox( height: 16, ), From a618292d20c333b7f7ae541f94ae1045bbfdf4dd Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 7 Feb 2021 10:23:22 +0200 Subject: [PATCH 265/421] bug fixes for DA-284-DA-285 --- lib/config/config.dart | 2 +- lib/config/localized_values.dart | 2 ++ .../service/patient-doctor-referral-service.dart | 1 + .../profile/referral/my-referral-detail-screen.dart | 6 ++++++ lib/util/translations_delegate_base.dart | 2 ++ .../patients/patient-referral-item-widget.dart | 13 ++++++++----- 6 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 765874b4..c09f57e5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -72,7 +72,7 @@ const CREATE_REFERRAL_PATIENT = 'Services/DoctorApplication.svc/REST/CreateReferral'; const RESPONSE_PENDING_REFERRAL_PATIENT = - 'Services/DoctorApplication.svc/REST/CreateReferral'; + 'Services/DoctorApplication.svc/REST/RespondReferral'; const GET_PATIENT_REFERRAL = 'Services/DoctorApplication.svc/REST/GetRefferal'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index ea4df903..4d47d71c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -697,5 +697,7 @@ const Map> localizedValues = { 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, + 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, + 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 69f8e5e5..77af017c 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -209,6 +209,7 @@ class PatientReferralService extends LookupService { await baseAppClient.post( RESPONSE_PENDING_REFERRAL_PATIENT, onSuccess: (dynamic response, int statusCode) { + print(response); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 433fe232..f1f3c918 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -154,6 +154,9 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); + Navigator.pop(context); } }, ), @@ -174,6 +177,9 @@ class MyReferralDetailScreen extends StatelessWidget { pendingReferral, true); if (model.state == ViewState.ErrorLocal) { DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); + Navigator.pop(context); } }, ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c0c7d73d..11b5fa7f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1086,6 +1086,8 @@ class TranslationBase { String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 5924c89c..ee54917b 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -175,6 +175,7 @@ class PatientReferralItemWidget extends StatelessWidget { height: 8, ), Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( TranslationBase.of(context).referralRemark, @@ -182,11 +183,13 @@ class PatientReferralItemWidget extends StatelessWidget { fontWeight: FontWeight.bold, fontSize: 12, ), - AppText( - remark, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + Expanded( + child: AppText( + remark, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 12, + ), ), ], ), From a5a7425a099d7a61b3dd1d08660797e7c93e54b3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 7 Feb 2021 14:58:32 +0200 Subject: [PATCH 266/421] fix DA-149 --- lib/config/localized_values.dart | 1 + .../SOAP/GetPhysicalExamListResModel.dart | 26 ++- lib/models/SOAP/my_selected_examination.dart | 12 +- .../post_physical_exam_request_model.dart | 150 ++++++++++-------- lib/util/translations_delegate_base.dart | 1 + .../soap_update/update_objective_page.dart | 70 +++++++- 6 files changed, 184 insertions(+), 76 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2ded6152..cbd6436c 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -592,6 +592,7 @@ const Map> localizedValues = { 'allergicTO': {'en': "ALLERGIC TO ", 'ar': " حساس من"}, 'normal': {'en': "Normal", 'ar': "عادي"}, 'abnormal': {'en': "Abnormal", 'ar': " غير عادي"}, + 'notExamined': {'en': "Not Examined", 'ar': "لم يتم الفحص"}, "systolic-lng": {"en": "Systolic", "ar": "الإنقباض"}, "diastolic-lng": {"en": "Diastolic", "ar": "الإنبساط"}, "mass": {"en": "Mass", "ar": "كتلة"}, diff --git a/lib/models/SOAP/GetPhysicalExamListResModel.dart b/lib/models/SOAP/GetPhysicalExamListResModel.dart index f9b2f44f..c97189b1 100644 --- a/lib/models/SOAP/GetPhysicalExamListResModel.dart +++ b/lib/models/SOAP/GetPhysicalExamListResModel.dart @@ -1,13 +1,19 @@ class GetPhysicalExamResModel { int appointmentNo; int createdBy; + String createdByName; String createdOn; - int editedBy; + Null editedBy; + String editedByName; String editedOn; int episodeId; int examId; + String examName; int examType; + int examinationType; + String examinationTypeName; bool isAbnormal; + bool isNew; bool isNormal; bool notExamined; int patientMRN; @@ -16,13 +22,19 @@ class GetPhysicalExamResModel { GetPhysicalExamResModel( {this.appointmentNo, this.createdBy, + this.createdByName, this.createdOn, this.editedBy, + this.editedByName, this.editedOn, this.episodeId, this.examId, + this.examName, this.examType, + this.examinationType, + this.examinationTypeName, this.isAbnormal, + this.isNew, this.isNormal, this.notExamined, this.patientMRN, @@ -31,13 +43,19 @@ class GetPhysicalExamResModel { GetPhysicalExamResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; createdBy = json['createdBy']; + createdByName = json['createdByName']; createdOn = json['createdOn']; editedBy = json['editedBy']; + editedByName = json['editedByName']; editedOn = json['editedOn']; episodeId = json['episodeId']; examId = json['examId']; + examName = json['examName']; examType = json['examType']; + examinationType = json['examinationType']; + examinationTypeName = json['examinationTypeName']; isAbnormal = json['isAbnormal']; + isNew = json['isNew']; isNormal = json['isNormal']; notExamined = json['notExamined']; patientMRN = json['patientMRN']; @@ -48,13 +66,19 @@ class GetPhysicalExamResModel { final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; data['createdOn'] = this.createdOn; data['editedBy'] = this.editedBy; + data['editedByName'] = this.editedByName; data['editedOn'] = this.editedOn; data['episodeId'] = this.episodeId; data['examId'] = this.examId; + data['examName'] = this.examName; data['examType'] = this.examType; + data['examinationType'] = this.examinationType; + data['examinationTypeName'] = this.examinationTypeName; data['isAbnormal'] = this.isAbnormal; + data['isNew'] = this.isNew; data['isNormal'] = this.isNormal; data['notExamined'] = this.notExamined; data['patientMRN'] = this.patientMRN; diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index 5a717a4e..d2946f29 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -5,6 +5,8 @@ class MySelectedExamination { String remark; bool isNormal; bool isAbnormal; + bool notExamined; + bool isNew; int createdBy; MySelectedExamination( @@ -12,6 +14,8 @@ class MySelectedExamination { this.remark, this.isNormal = true, this.isAbnormal = false, + this.notExamined = false, + this.isNew = true, this.createdBy}); MySelectedExamination.fromJson(Map json) { @@ -19,8 +23,10 @@ class MySelectedExamination { ? new MasterKeyModel.fromJson(json['selectedExamination']) : null; remark = json['remark']; - remark = json['isNormal']; - remark = json['isAbnormal']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + isNew = json['isNew']; createdBy = json['createdBy']; } @@ -33,6 +39,8 @@ class MySelectedExamination { data['remark'] = this.remark; data['isNormal'] = this.isNormal; data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['isNew'] = this.isNew; data['createdBy'] = this.createdBy; return data; } diff --git a/lib/models/SOAP/post_physical_exam_request_model.dart b/lib/models/SOAP/post_physical_exam_request_model.dart index 46a104f1..d1b64837 100644 --- a/lib/models/SOAP/post_physical_exam_request_model.dart +++ b/lib/models/SOAP/post_physical_exam_request_model.dart @@ -25,75 +25,91 @@ class PostPhysicalExamRequestModel { } } -class ListHisProgNotePhysicalExaminationVM { - int episodeId; - int appointmentNo; - int examType; - int examId; - int patientMRN; - bool isNormal; - bool isAbnormal; - String remarks; - int createdBy; - String createdOn; - int editedBy; - String editedOn; - bool notExamined; - MasterKeyModel masterDescription; + class ListHisProgNotePhysicalExaminationVM { + int episodeId; + int appointmentNo; + int examType; + int examId; + int patientMRN; + bool isNormal; + bool isAbnormal; + bool notExamined; + String examName; + String examinationTypeName; + int examinationType; + String remarks; + bool isNew; + int createdBy; + String createdOn; + String createdByName; + int editedBy; + String editedOn; + String editedByName; - ListHisProgNotePhysicalExaminationVM( - {this.episodeId, - this.appointmentNo, - this.examType, - this.examId, - this.patientMRN, - this.isNormal, - this.isAbnormal, - this.remarks, - this.createdBy, - this.createdOn, - this.editedBy, - this.editedOn, - this.notExamined, - this.masterDescription}); + ListHisProgNotePhysicalExaminationVM( + {this.episodeId, + this.appointmentNo, + this.examType, + this.examId, + this.patientMRN, + this.isNormal, + this.isAbnormal, + this.notExamined, + this.examName, + this.examinationTypeName, + this.examinationType, + this.remarks, + this.isNew, + this.createdBy, + this.createdOn, + this.createdByName, + this.editedBy, + this.editedOn, + this.editedByName}); - ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { - episodeId = json['episodeId']; - appointmentNo = json['appointmentNo']; - examType = json['examType']; - examId = json['examId']; - patientMRN = json['patientMRN']; - isNormal = json['isNormal']; - isAbnormal = json['isAbnormal']; - remarks = json['remarks']; - createdBy = json['createdBy']; - createdOn = json['createdOn']; - editedBy = json['editedBy']; - editedOn = json['editedOn']; - notExamined = json['notExamined']; - masterDescription = json['masterDescription'] != null - ? new MasterKeyModel.fromJson(json['masterDescription']) - : null; - } + ListHisProgNotePhysicalExaminationVM.fromJson(Map json) { + episodeId = json['episodeId']; + appointmentNo = json['appointmentNo']; + examType = json['examType']; + examId = json['examId']; + patientMRN = json['patientMRN']; + isNormal = json['isNormal']; + isAbnormal = json['isAbnormal']; + notExamined = json['notExamined']; + examName = json['examName']; + examinationTypeName = json['examinationTypeName']; + examinationType = json['examinationType']; + remarks = json['remarks']; + isNew = json['isNew']; + createdBy = json['createdBy']; + createdOn = json['createdOn']; + createdByName = json['createdByName']; + editedBy = json['editedBy']; + editedOn = json['editedOn']; + editedByName = json['editedByName']; + } - Map toJson() { - final Map data = new Map(); - data['episodeId'] = this.episodeId; - data['appointmentNo'] = this.appointmentNo; - data['examType'] = this.examType; - data['examId'] = this.examId; - data['patientMRN'] = this.patientMRN; - data['isNormal'] = this.isNormal; - data['isAbnormal'] = this.isAbnormal; - data['remarks'] = this.remarks; - data['createdBy'] = this.createdBy; - data['createdOn'] = this.createdOn; - data['editedBy'] = this.editedBy; - data['editedOn'] = this.editedOn; - data['notExamined'] = this.notExamined; - if (this.masterDescription != null) { - data['masterDescription'] = this.masterDescription.toJson(); + Map toJson() { + final Map data = new Map(); + data['episodeId'] = this.episodeId; + data['appointmentNo'] = this.appointmentNo; + data['examType'] = this.examType; + data['examId'] = this.examId; + data['patientMRN'] = this.patientMRN; + data['isNormal'] = this.isNormal; + data['isAbnormal'] = this.isAbnormal; + data['notExamined'] = this.notExamined; + data['examName'] = this.examName; + data['examinationTypeName'] = this.examinationTypeName; + data['examinationType'] = this.examinationType; + data['remarks'] = this.remarks; + data['isNew'] = this.isNew; + data['createdBy'] = this.createdBy; + data['createdOn'] = this.createdOn; + data['createdByName'] = this.createdByName; + data['editedBy'] = this.editedBy; + data['editedOn'] = this.editedOn; + data['editedByName'] = this.editedByName; + return data; } - return data; } -} \ No newline at end of file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c192d7b9..a3c058a8 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -940,6 +940,7 @@ class TranslationBase { String get allergicTO => localizedValues['allergicTO'][locale.languageCode]; String get normal => localizedValues['normal'][locale.languageCode]; + String get notExamined => localizedValues['notExamined'][locale.languageCode]; String get abnormal => localizedValues['abnormal'][locale.languageCode]; diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index 93182207..af960ff7 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -85,6 +85,8 @@ class _UpdateObjectivePageState extends State { remark: element.remarks, isNormal: element.isNormal, createdBy: element.createdBy, + notExamined: element.notExamined, + isNew: element.isNew, isAbnormal: element.isAbnormal); widget.mySelectedExamination.add(tempEam); }); @@ -243,9 +245,10 @@ class _UpdateObjectivePageState extends State { onTap: () { setState(() { examination.isAbnormal = - !examination.isAbnormal; + false; examination.isNormal = - !examination.isNormal; + true; + examination.notExamined = false; }); }), SizedBox( @@ -290,12 +293,63 @@ class _UpdateObjectivePageState extends State { ), )), ), + onTap: () { + setState(() { + examination.isNormal = + false; + examination.isAbnormal = + true; + examination.notExamined = false; + }); + }),SizedBox( + width: 12, + ), + InkWell( + child: Center( + child: Container( + height: + screenSize.height * + 0.070, + decoration: + containerBorderDecoration( + examination + .notExamined + ? Color( + 0xFF515A5D) + : Colors + .white, + Colors.black), + child: Center( + child: Padding( + padding: + const EdgeInsets + .all(8.0), + child: Text( + "Not Examined", + style: TextStyle( + fontSize: 12, + color: + examination + .notExamined + ? Colors.white + : Colors + .black, + //Colors.black, + fontWeight: + FontWeight + .bold, + ), + ), + ), + )), + ), onTap: () { setState(() { examination.isAbnormal = - !examination.isAbnormal; + false; examination.isNormal = - !examination.isNormal; + false; + examination.notExamined = true; }); }), ], @@ -394,13 +448,17 @@ class _UpdateObjectivePageState extends State { examType: exam.selectedExamination.typeId, isAbnormal: exam.isAbnormal, isNormal: exam.isNormal, - masterDescription: exam.selectedExamination, - notExamined: false + // masterDescription: exam.selectedExamination, + notExamined: exam.notExamined, + examinationType: exam.isNormal?1:exam.isAbnormal?2:3, + examinationTypeName: exam.isNormal?"Normal":exam.isAbnormal?'AbNormal':"Not Examined", + isNew:exam.isNew )); }); if(model.patientPhysicalExamList.isEmpty) { + await model.postPhysicalExam(postPhysicalExamRequestModel); } else { await model.patchPhysicalExam(postPhysicalExamRequestModel); From 248367fbe9f7d6c263a1611854b74f99150e2efd Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 7 Feb 2021 15:36:19 +0200 Subject: [PATCH 267/421] fix DA-220 --- lib/config/localized_values.dart | 2 +- .../profile/lab_result/lab_orders_screen.dart | 29 ++++++++++++- .../lab_result/lab_result_secreen.dart | 42 ++++++++++++++----- lib/util/translations_delegate_base.dart | 1 + lib/widgets/doctor/lab_result_widget.dart | 2 +- .../patients/profile/large_avatar.dart | 17 +++++--- 6 files changed, 73 insertions(+), 20 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 697900bf..9b9012b7 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -698,5 +698,5 @@ const Map> localizedValues = { 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, - // 'icd': {'en': "ICD", 'ar': " "}, + 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, }; diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index 3dff441c..75e4c33b 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -143,6 +143,9 @@ class _LabOrdersScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ + if(model + .patientLabResultOrdersList[index] + .doctorName != null ) AppText( '${model .patientLabResultOrdersList[index] @@ -171,7 +174,7 @@ class _LabOrdersScreenState extends State { MainAxisAlignment.start, children: [ AppText( - ' Invoice No :', + TranslationBase.of(context).invoiceNo, fontSize: 2 * SizeConfig .textMultiplier, @@ -187,6 +190,30 @@ class _LabOrdersScreenState extends State { color: Colors.grey[800], ), ], + ),SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).orderNo, + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Colors.grey[800], + ), + AppText( + ' ${model + .patientLabResultOrdersList[index] + .orderNo}', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Colors.grey[800], + ), + ], ) ], ), diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart index d41f388d..dd8ace01 100644 --- a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -37,19 +37,39 @@ class _LabResultState extends State { child: ListView( children: [ CardWithBgWidgetNew( - widget: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).invoiceNo, - fontSize: 2 * SizeConfig.textMultiplier, - color: Colors.grey[800], + widget: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).orderNo, + fontSize: 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + AppText( + ' ${widget.labOrders.orderNo}', + fontSize: 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + ], ), - AppText( - ' ${widget.labOrders.invoiceNo}', - fontSize: 2 * SizeConfig.textMultiplier, - color: Colors.grey[800], + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).invoiceNo, + fontSize: 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + AppText( + ' ${widget.labOrders.invoiceNo}', + fontSize: 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + ], ), + ], ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 30585015..44fc9532 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -248,6 +248,7 @@ class TranslationBase { localizedValues['errorNoProgressNote'][locale.languageCode]; String get invoiceNo => localizedValues['invoiceNo:'][locale.languageCode]; + String get orderNo => localizedValues['orderNo'][locale.languageCode]; String get generalResult => localizedValues['generalResult'][locale.languageCode]; diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index 8b2ab0c4..e897f33e 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -27,7 +27,7 @@ class _LabResultWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.spaceBetween, crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index d18fdf3d..e98c2de4 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -24,16 +25,20 @@ class LargeAvatar extends StatelessWidget { Widget _getAvatar() { if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { - return Center( + return CircleAvatar( + radius: + SizeConfig.imageSizeMultiplier * 12, + // radius: (52) child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(radius)), + borderRadius:BorderRadius.circular(50), + child: Image.network( - url.trim(), - fit: BoxFit.cover, - width: width, - height: height, + url, + fit: BoxFit.fill, + width: 700, ), ), + backgroundColor: Colors.transparent, ); } else if (name == null || name.isEmpty) { return Center( From ff33afd124c9be3fbdcd1490774942e7af408fa0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 7 Feb 2021 17:10:09 +0200 Subject: [PATCH 268/421] fix DA-149 --- lib/models/SOAP/my_selected_examination.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/models/SOAP/my_selected_examination.dart b/lib/models/SOAP/my_selected_examination.dart index d2946f29..393af944 100644 --- a/lib/models/SOAP/my_selected_examination.dart +++ b/lib/models/SOAP/my_selected_examination.dart @@ -12,9 +12,9 @@ class MySelectedExamination { MySelectedExamination( {this.selectedExamination, this.remark, - this.isNormal = true, + this.isNormal = false, this.isAbnormal = false, - this.notExamined = false, + this.notExamined = true, this.isNew = true, this.createdBy}); From 8d154239bb76d61f7dd89bc373515fe42d0dbbf1 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 8 Feb 2021 10:57:32 +0200 Subject: [PATCH 269/421] finish admission request feature --- lib/config/config.dart | 2 + lib/config/localized_values.dart | 9 + .../patient-admission-request-service.dart | 49 +- .../patient-admission-request-viewmodel.dart | 24 + lib/routes.dart | 3 +- .../admission-request-first-screen.dart | 487 +++++++++ .../admission-request-third-screen.dart | 717 +++++++------- .../admission-request_second-screen.dart | 932 +++++++----------- lib/util/translations_delegate_base.dart | 12 +- 9 files changed, 1291 insertions(+), 944 deletions(-) create mode 100644 lib/screens/patients/profile/admission-request/admission-request-first-screen.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index c09f57e5..6c4da7b1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -192,7 +192,9 @@ const SEARCH_DRUG = 'Services/DoctorApplication.svc/REST/GetMedicationList'; const DRUG_TO_DRUG = 'Services/DoctorApplication.svc/REST/DrugToDrugInteraction'; const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; +const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; +const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4d47d71c..bad03075 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -699,5 +699,14 @@ const Map> localizedValues = { 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, + 'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"}, + 'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"}, + 'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"}, + 'complications': {'en': "Complications", 'ar': "المضاعفات"}, + 'floor': {'en': "Floor", 'ar': "الطابق"}, + 'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"}, + 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, + 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, + 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, // 'icd': {'en': "ICD", 'ar': " "}, }; diff --git a/lib/core/service/patient-admission-request-service.dart b/lib/core/service/patient-admission-request-service.dart index c287c160..093c4066 100644 --- a/lib/core/service/patient-admission-request-service.dart +++ b/lib/core/service/patient-admission-request-service.dart @@ -8,12 +8,15 @@ class AdmissionRequestService extends LookupService { List clinicList = []; List doctorsList = []; List specialityList = []; + List floorList = []; List wardList = []; + List roomCategoryList = []; List diagnosisTypesList = []; List allergiesLookupList = []; List dietTypesList = []; List icdCodes = []; + setSpecialityList() { specialityList.clear(); listOfSpeciality.forEach((element) { @@ -68,6 +71,28 @@ class AdmissionRequestService extends LookupService { ); } + Future getFloors() async { + hasError = false; + + await baseAppClient.post( + GET_FLOORS, + onSuccess: (dynamic response, int statusCode) { + floorList.clear(); + if (response['AdmissionMasterList'] != null && + response['AdmissionMasterList']['entityList'] != null) { + response['AdmissionMasterList']['entityList'].forEach((v) { + floorList.add(v); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } + Future getWardList() async { hasError = false; @@ -91,6 +116,28 @@ class AdmissionRequestService extends LookupService { ); } + Future getRoomCategories() async { + hasError = false; + + await baseAppClient.post( + GET_ROOM_CATEGORIES, + onSuccess: (dynamic response, int statusCode) { + roomCategoryList.clear(); + if (response['AdmissionMasterList'] != null && + response['AdmissionMasterList']['entityList'] != null) { + response['AdmissionMasterList']['entityList'].forEach((v) { + roomCategoryList.add(v); + }); + } + }, + onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, + body: Map(), + ); + } + Future getDiagnosisTypesList() async { hasError = false; @@ -173,7 +220,7 @@ class AdmissionRequestService extends LookupService { await baseAppClient.post( POST_ADMISSION_REQUEST, onSuccess: (dynamic response, int statusCode) { - print(response); + print(response["admissionResponse"]["success"]); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/core/viewModel/patient-admission-request-viewmodel.dart b/lib/core/viewModel/patient-admission-request-viewmodel.dart index 5b079512..44261c26 100644 --- a/lib/core/viewModel/patient-admission-request-viewmodel.dart +++ b/lib/core/viewModel/patient-admission-request-viewmodel.dart @@ -19,8 +19,12 @@ class AdmissionRequestViewModel extends BaseViewModel{ List get speciality => _admissionRequestService.specialityList; + List get floorList => _admissionRequestService.floorList; + List get wardList => _admissionRequestService.wardList; + List get roomCategoryList => _admissionRequestService.roomCategoryList; + List get admissionTypeList => _admissionRequestService.listOfAdmissionType; List get diagnosisTypesList => _admissionRequestService.diagnosisTypesList; @@ -63,6 +67,16 @@ class AdmissionRequestViewModel extends BaseViewModel{ setState(ViewState.Idle); } + Future getFloors() async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getFloors(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future getWards() async { setState(ViewState.BusyLocal); await _admissionRequestService.getWardList(); @@ -73,6 +87,16 @@ class AdmissionRequestViewModel extends BaseViewModel{ setState(ViewState.Idle); } + Future getRoomCategories() async { + setState(ViewState.BusyLocal); + await _admissionRequestService.getRoomCategories(); + if (_admissionRequestService.hasError) { + error = _admissionRequestService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future getDiagnosis() async { setState(ViewState.BusyLocal); await _admissionRequestService.getDiagnosisTypesList(); diff --git a/lib/routes.dart b/lib/routes.dart index 6c5fc954..a339e664 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -45,6 +45,7 @@ import 'landing_page.dart'; import 'screens/doctor/doctor_reply_screen.dart'; import 'screens/live_care/panding_list.dart'; import 'screens/patients/profile/admission-request/admission-request-detail-screen.dart'; +import 'screens/patients/profile/admission-request/admission-request-first-screen.dart'; import 'screens/patients/profile/admission-request/admission-request-third-screen.dart'; import 'screens/patients/profile/admission-request/admission-request_second-screen.dart'; import 'screens/patients/profile/referral/my-referral-detail-screen.dart'; @@ -137,7 +138,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), - PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestThirdScreen(), + PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), // PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart new file mode 100644 index 00000000..0c1f0de2 --- /dev/null +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -0,0 +1,487 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; +import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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_buttons_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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +import '../../../../routes.dart'; + +class AdmissionRequestFirstScreen extends StatefulWidget { + @override + _AdmissionRequestThirdScreenState createState() => + _AdmissionRequestThirdScreenState(); +} + +class _AdmissionRequestThirdScreenState + extends State { + final _dietTypeRemarksController = TextEditingController(); + final _sickLeaveCommentsController = TextEditingController(); + final _postMedicalHistoryController = TextEditingController(); + final _postSurgicalHistoryController = TextEditingController(); + + dynamic _selectedClinic; + dynamic _selectedDoctor; + dynamic _selectedDietType; + + bool _isSickLeaveRequired = false; + bool _patientPregnant = false; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + final screenSize = MediaQuery.of(context).size; + ProjectViewModel projectViewModel = Provider.of(context); + + return BaseView( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).admissionRequest, + body: GestureDetector( + onTap: (){ + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + }, + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context) + .specialityAndDoctorDetail, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.clinicList != null && + model.clinicList.length > 0 + ? () { + openListDialogField( + 'clinicGroupName', + 'clinicID', + model.clinicList, + (selectedValue) { + setState(() { + _selectedClinic = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getClinics().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.clinicList.length > 0) { + openListDialogField( + 'clinicGroupName', + 'clinicID', + model.clinicList, + (selectedValue) { + setState(() { + _selectedClinic = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .clinic, + _selectedClinic != null + ? _selectedClinic[ + 'clinicGroupName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 20, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: _selectedClinic != null + ? model.doctorsList != null && + model.doctorsList.length > 0 + ? () { + openListDialogField( + 'DoctorName', + 'DoctorID', + model.doctorsList, + (selectedValue) { + setState(() { + _selectedDoctor = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils + .showMyDialog(context); + await model + .getClinicDoctors( + _selectedClinic[ + 'clinicID']) + .then((_) => + GifLoaderDialogUtils + .hideDialog( + context)); + if (model.state == + ViewState.Idle && + model.doctorsList.length > + 0) { + openListDialogField( + 'DoctorName', + 'DoctorID', + model.doctorsList, + (selectedValue) { + setState(() { + _selectedDoctor = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + } + : null, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .doctor, + _selectedDoctor != null + ? _selectedDoctor[ + 'DoctorName'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).patientDetails, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context).patientPregnant, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _patientPregnant, + onChanged: (newValue) { + setState(() { + _patientPregnant = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + CheckboxListTile( + title: AppText( + TranslationBase.of(context) + .isSickLeaveRequired, + fontWeight: FontWeight.normal, + fontSize: SizeConfig.textMultiplier * 2.1, + ), + value: _isSickLeaveRequired, + onChanged: (newValue) { + setState(() { + _isSickLeaveRequired = newValue; + }); + }, + controlAffinity: + ListTileControlAffinity.leading, + contentPadding: EdgeInsets.all(0), + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .sickLeaveComments, + null, + false), + enabled: true, + controller: _sickLeaveCommentsController, + keyboardType: TextInputType.text, + minLines: 2, + maxLines: 4, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.dietTypesList != null && + model.dietTypesList.length > 0 + ? () { + openListDialogField('nameEn', 'id', + model.dietTypesList, + (selectedValue) { + setState(() { + _selectedDietType = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getDietTypes().then( + (_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.dietTypesList.length > + 0) { + openListDialogField('nameEn', + 'id', model.dietTypesList, + (selectedValue) { + setState(() { + _selectedDietType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .dietType, + _selectedDietType != null + ? _selectedDietType['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .dietTypeRemarks, + null, + false), + enabled: true, + controller: _dietTypeRemarksController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .pastMedicalHistory, + null, + false), + enabled: true, + controller: _postMedicalHistoryController, + keyboardType: TextInputType.text, + minLines: 2, + maxLines: 4, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .pastSurgicalHistory, + null, + false), + enabled: true, + controller: _postSurgicalHistoryController, + keyboardType: TextInputType.text, + minLines: 2, + maxLines: 4, + )), + ], + ), + ), + ], + ), + ), + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: () { + model.admissionRequestData = AdmissionRequest(); + if (_selectedClinic != null && + _selectedDoctor != null && + _sickLeaveCommentsController.text != "" && + _postMedicalHistoryController.text != "" && + _postSurgicalHistoryController.text != "") { + model.admissionRequestData.patientMRN = + patient.patientMRN; + model.admissionRequestData.appointmentNo = + patient.appointmentNo; + model.admissionRequestData.episodeID = + patient.episodeNo; + model.admissionRequestData.admissionRequestNo = 0; + + model.admissionRequestData.admitToClinic = + _selectedClinic['clinicID']; + model.admissionRequestData.mrpDoctorID = + _selectedDoctor['DoctorID']; + + model.admissionRequestData.isPregnant = + _patientPregnant; + model.admissionRequestData.isSickLeaveRequired = + _isSickLeaveRequired; + model.admissionRequestData.sickLeaveComments = + _sickLeaveCommentsController.text; + model.admissionRequestData.isDietType = + _selectedDietType != null ? true : false; + model.admissionRequestData.dietType = + _selectedDietType != null + ? _selectedDietType['id'] + : 0; + model.admissionRequestData.dietRemarks = + _dietTypeRemarksController.text; + model.admissionRequestData.pastMedicalHistory = + _postMedicalHistoryController.text; + model.admissionRequestData.pastSurgicalHistory = + _postSurgicalHistoryController.text; + Navigator.of(context).pushNamed( + PATIENT_ADMISSION_REQUEST_2, + arguments: { + 'patient': patient, + 'admission-data': model.admissionRequestData + }); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + } + }, + ), + ), + ], + ), + ), + ), + ); + } + + Future _selectDate(BuildContext context, DateTime dateTime, + Function(DateTime picked) updateDate) async { + final DateTime picked = await showDatePicker( + context: context, + initialDate: dateTime, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != dateTime) { + updateDate(picked); + } + } + + void openListDialogField(String attributeName, String attributeValueId, + List list, Function(dynamic selectedValue) okFunction) { + ListSelectDialog dialog = ListSelectDialog( + list: list, + attributeName: attributeName, + attributeValueId: attributeValueId, + usingSearch: true, + okText: TranslationBase.of(context).ok, + okFunction: (selectedValue) { + okFunction(selectedValue); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } +} diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index f5dbf704..342d2e72 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-viewmodel.dart'; @@ -31,19 +32,21 @@ class AdmissionRequestThirdScreen extends StatefulWidget { class _AdmissionRequestThirdScreenState extends State { - final _postPlansEstimatedCostController = TextEditingController(); - final _dietTypeRemarksController = TextEditingController(); - final _estimatedCostController = TextEditingController(); + final _treatmentLineController = TextEditingController(); + final _complicationsController = TextEditingController(); + final _otherProceduresController = TextEditingController(); - // DateTime _dischargeDate; - dynamic _selectedClinic; - dynamic _selectedDoctor; - dynamic _selectedDietType; + dynamic _selectedAdmissionType; + dynamic _selectedDiagnosis; + dynamic _selectedIcd; + dynamic _selectedDiagnosisType; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + AdmissionRequest admissionRequest = routeArgs['admission-data']; + final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); @@ -51,375 +54,375 @@ class _AdmissionRequestThirdScreenState builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).admissionRequest, - body: model.doctorsList != null - ? Column( - children: [ - Expanded( - child: SingleChildScrollView( + body: GestureDetector( + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + }, + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: + EdgeInsets.symmetric(vertical: 16, horizontal: 16), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).treatmentLine, + null, + false), + enabled: true, + controller: _treatmentLineController, + keyboardType: TextInputType.text, + minLines: 3, + maxLines: 5, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).complications, + null, + false), + enabled: true, + controller: _complicationsController, + keyboardType: TextInputType.text, + minLines: 3, + maxLines: 5, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).otherProcedure, + null, + false), + enabled: true, + controller: _otherProceduresController, + keyboardType: TextInputType.text, + minLines: 3, + maxLines: 5, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.admissionTypeList != null && + model.admissionTypeList.length > 0 + ? () { + openListDialogField('nameEn', 'id', + model.admissionTypeList, + (selectedValue) { + setState(() { + _selectedAdmissionType = + selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getMasterLookup(MasterKeysService + .AdmissionRequestType) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.admissionTypeList.length > 0) { + openListDialogField('nameEn', 'id', + model.admissionTypeList, + (selectedValue) { + setState(() { + _selectedAdmissionType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).admissionType, + _selectedAdmissionType != null + ? _selectedAdmissionType['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context).diagnosisDetail, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context) - .specialityAndDoctorDetail, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 20, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.clinicList != null && - model.clinicList.length > 0 - ? () { - openListDialogField( - 'clinicGroupName', - 'clinicID', - model.clinicList, - (selectedValue) { - setState(() { - _selectedClinic = selectedValue; - }); - }); - } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getClinics().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.clinicList.length > 0) { - openListDialogField( - 'clinicGroupName', - 'clinicID', - model.clinicList, - (selectedValue) { - setState(() { - _selectedClinic = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .clinic, - _selectedClinic != null - ? _selectedClinic[ - 'clinicGroupName'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 20, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: _selectedClinic != null - ? model.doctorsList != null && - model.doctorsList.length > 0 - ? () { - openListDialogField( - 'DoctorName', - 'DoctorID', - model.doctorsList, - (selectedValue) { - setState(() { - _selectedDoctor = - selectedValue; - }); - }); - } - : () async { - GifLoaderDialogUtils - .showMyDialog(context); - await model - .getClinicDoctors( - _selectedClinic[ - 'clinicID']) - .then((_) => - GifLoaderDialogUtils - .hideDialog( - context)); - if (model.state == - ViewState.Idle && - model.doctorsList.length > - 0) { - openListDialogField( - 'DoctorName', - 'DoctorID', - model.doctorsList, - (selectedValue) { - setState(() { - _selectedDoctor = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - } + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.diagnosisTypesList != null && + model.diagnosisTypesList.length > 0 + ? () { + openListDialogField('nameEn', 'id', + model.diagnosisTypesList, + (selectedValue) { + setState(() { + _selectedDiagnosis = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getDiagnosis().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.diagnosisTypesList.length > 0) { + openListDialogField('nameEn', 'id', + model.diagnosisTypesList, + (selectedValue) { + setState(() { + _selectedDiagnosis = selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } + }, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).diagnosis, + _selectedDiagnosis != null + ? _selectedDiagnosis['nameEn'] : null, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .doctor, - _selectedDoctor != null - ? _selectedDoctor[ - 'DoctorName'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - AppText( - TranslationBase.of(context) - .postPlansEstimatedCost, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .estimatedCost, - null, - false), - enabled: true, - controller: _estimatedCostController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).postPlans, - null, - false), - enabled: true, - controller: _postPlansEstimatedCostController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 10, - ), - /* Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () { - if (_dischargeDate == null) { - _dischargeDate = DateTime.now(); + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.icdCodes != null && + model.icdCodes.length > 0 + ? () { + openListDialogField( + 'description', 'code', model.icdCodes, + (selectedValue) { + setState(() { + _selectedIcd = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getICDCodes(patient.patientMRN) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.icdCodes.length > 0) { + openListDialogField( + 'description', + 'code', + model.icdCodes, (selectedValue) { + setState(() { + _selectedIcd = selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); } - _selectDate(context, _dischargeDate, - (picked) { + }, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).icd, + _selectedIcd != null + ? _selectedIcd['description'] + : null, + true), + enabled: false, + ), + ), + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.listOfDiagnosisSelectionTypes != + null && + model.listOfDiagnosisSelectionTypes + .length > + 0 + ? () { + openListDialogField('description', 'code', + model.listOfDiagnosisSelectionTypes, + (selectedValue) { setState(() { - _dischargeDate = picked; + _selectedDiagnosisType = + selectedValue; }); }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model + .getMasterLookup(MasterKeysService + .DiagnosisSelectionType) + .then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.listOfDiagnosisSelectionTypes + .length > + 0) { + openListDialogField( + 'description', + 'code', + model.listOfDiagnosisSelectionTypes, + (selectedValue) { + setState(() { + _selectedDiagnosisType = + selectedValue; + }); + }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); + } }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .expectedAdmissionDate, - _dischargeDate != null - ? "${DateUtils.convertStringToDateFormat(_dischargeDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ),*/ - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.dietTypesList != null && - model.dietTypesList.length > 0 - ? () { - openListDialogField('nameEn', 'id', - model.dietTypesList, - (selectedValue) { - setState(() { - _selectedDietType = - selectedValue; - }); - }); - } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getDietTypes().then( - (_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.dietTypesList.length > - 0) { - openListDialogField('nameEn', - 'id', model.dietTypesList, - (selectedValue) { - setState(() { - _selectedDietType = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .dietType, - _selectedDietType != null - ? _selectedDietType['nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .dietTypeRemarks, - null, - false), - enabled: true, - controller: _dietTypeRemarksController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - ], + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).diagnoseType, + _selectedDiagnosisType != null + ? _selectedDiagnosisType['description'] + : null, + true), + enabled: false, + ), ), ), + SizedBox( + height: 10, + ), ], ), ), - ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#B8382B"), - onPressed: () { - model.admissionRequestData = AdmissionRequest(); - if (_selectedClinic != null && - _selectedDoctor != null && - _estimatedCostController.text != "" && - _postPlansEstimatedCostController.text != "") { - model.admissionRequestData.patientMRN = patient.patientMRN; - model.admissionRequestData.appointmentNo = patient.appointmentNo; - model.admissionRequestData.episodeID = patient.episodeNo; - model.admissionRequestData.admissionRequestNo = 0; + ], + ), + )), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: () async { + if (_treatmentLineController.text != "" && + _complicationsController.text != "" && + _otherProceduresController.text != "" && + _selectedAdmissionType != null && + _selectedDiagnosis != null && + _selectedIcd != null && + _selectedDiagnosisType != null) { + model.admissionRequestData = admissionRequest; + + model.admissionRequestData.mainLineOfTreatment = + _treatmentLineController.text; + model.admissionRequestData.complications = + _complicationsController.text; + model.admissionRequestData.otherProcedures = + _otherProceduresController.text; + model.admissionRequestData.admissionType = + _selectedAdmissionType['id']; - model.admissionRequestData.admitToClinic = _selectedClinic['clinicID']; - model.admissionRequestData.mrpDoctorID = _selectedDoctor['DoctorID']; - model.admissionRequestData.estimatedCost = int.parse(_estimatedCostController.text); - model.admissionRequestData.elementsForImprovement = _postPlansEstimatedCostController.text; - model.admissionRequestData.isDietType = _selectedDietType != null ? true : false; - model.admissionRequestData.dietType = _selectedDietType != null ? _selectedDietType['id'] : 0; - model.admissionRequestData.dietRemarks = _dietTypeRemarksController.text; - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_2, - arguments: {'patient': patient, 'admission-data' : model.admissionRequestData}); - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + dynamic admissionRequestDiagnoses = [ + { + 'diagnosisDescription': _selectedDiagnosis['nameEn'], + 'diagnosisType': _selectedDiagnosis['id'], + 'icdCode': _selectedIcd['code'], + 'icdCodeDescription': _selectedIcd['description'], + 'type': _selectedDiagnosisType['code'], + 'remarks': "", + 'isActive': true, } - }, - ), - ), - ], - ) - : Container(), - ), - ); - } + ]; + model.admissionRequestData.admissionRequestDiagnoses = + admissionRequestDiagnoses; - Future _selectDate(BuildContext context, DateTime dateTime, - Function(DateTime picked) updateDate) async { - final DateTime picked = await showDatePicker( - context: context, - initialDate: dateTime, - firstDate: DateTime.now(), - lastDate: DateTime(2040), - initialEntryMode: DatePickerEntryMode.calendar, + await model.makeAdmissionRequest(); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context).admissionRequestSuccessMsg); + Navigator.popUntil(context, ModalRoute.withName(PATIENTS_PROFILE)); + } + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + } + }, + ), + ), + ], + ), + ), + ), ); - if (picked != null && picked != dateTime) { - updateDate(picked); - } } void openListDialogField(String attributeName, String attributeValueId, diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index 2ffd5455..91885724 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -32,24 +32,16 @@ class AdmissionRequestSecondScreen extends StatefulWidget { class _AdmissionRequestSecondScreenState extends State { + final _postPlansEstimatedCostController = TextEditingController(); + final _estimatedCostController = TextEditingController(); final _expectedDaysController = TextEditingController(); - final _treatmentLineController = TextEditingController(); + final _otherDepartmentsInterventionsController = TextEditingController(); - // final _preOperativeOrdersController = TextEditingController(); DateTime _expectedAdmissionDate; - // bool _emergencyAdmission = false; - bool _isSickLeaveRequired = false; - bool _patientPregnant = false; - - // bool _preAnesthesiaReferred = false; + dynamic _selectedFloor; dynamic _selectedWard; - dynamic _selectedAdmissionType; - dynamic _selectedDiagnosis; - dynamic _selectedIcd; - dynamic _selectedDiagnosisType; - - // dynamic _selectedAllergies; + dynamic _selectedRoomCategory; @override Widget build(BuildContext context) { @@ -62,614 +54,388 @@ class _AdmissionRequestSecondScreenState return BaseView( builder: (_, model, w) => AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).admissionRequest, - body: model.doctorsList != null - ? Column( - children: [ - Expanded( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - PatientPageHeaderWidget(patient), - Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).otherInformation, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .expectedDays, - null, - false), - enabled: true, - controller: _expectedDaysController, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], - keyboardType: TextInputType.number, - )), - SizedBox( - height: 10, - ), - Container( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).admissionRequest, + body: GestureDetector( + onTap: () { + FocusScopeNode currentFocus = FocusScope.of(context); + if (!currentFocus.hasPrimaryFocus) { + currentFocus.unfocus(); + } + }, + child: Column( + children: [ + Expanded( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientPageHeaderWidget(patient), + Container( + margin: EdgeInsets.symmetric( + vertical: 16, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 16, + ), + AppText( + TranslationBase.of(context) + .postPlansEstimatedCost, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .estimatedCost, + null, + false), + enabled: true, + controller: _estimatedCostController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).postPlans, + null, + false), + enabled: true, + controller: _postPlansEstimatedCostController, + keyboardType: TextInputType.text, + minLines: 4, + maxLines: 6, + )), + SizedBox( + height: 10, + ), + Container( + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .otherDepartmentsInterventions, + null, + false), + enabled: true, + controller: + _otherDepartmentsInterventionsController, + keyboardType: TextInputType.multiline, + minLines: 2, + maxLines: 4, + )), + SizedBox( + height: 10, + ), + AppText( + TranslationBase.of(context).otherInformation, + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + ), + SizedBox( + height: 10, + ), + Container( height: screenSize.height * 0.070, - child: InkWell( - onTap: () { - if (_expectedAdmissionDate == null) { - _expectedAdmissionDate = DateTime.now(); - } - _selectDate( - context, _expectedAdmissionDate, - (picked) { - setState(() { - _expectedAdmissionDate = picked; - }); + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedDays, + null, + false), + enabled: true, + controller: _expectedDaysController, + inputFormatters: [ + FilteringTextInputFormatter.allow( + RegExp(ONLY_NUMBERS)) + ], + keyboardType: TextInputType.number, + )), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () { + if (_expectedAdmissionDate == null) { + _expectedAdmissionDate = DateTime.now(); + } + _selectDate(context, _expectedAdmissionDate, + (picked) { + setState(() { + _expectedAdmissionDate = picked; }); - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .expectedAdmissionDate, - _expectedAdmissionDate != null - ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), -/* - CheckboxListTile( - title: AppText( - TranslationBase.of(context) - .emergencyAdmission, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _emergencyAdmission, - onChanged: (newValue) { - setState(() { - _emergencyAdmission = newValue; }); }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), -*/ - CheckboxListTile( - title: AppText( - TranslationBase.of(context) - .isSickLeaveRequired, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, + child: TextField( + decoration: Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .expectedAdmissionDate, + _expectedAdmissionDate != null + ? "${DateUtils.convertStringToDateFormat(_expectedAdmissionDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, ), - value: _isSickLeaveRequired, - onChanged: (newValue) { - setState(() { - _isSickLeaveRequired = newValue; - }); - }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), - CheckboxListTile( - title: AppText( - TranslationBase.of(context).patientPregnant, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _patientPregnant, - onChanged: (newValue) { - setState(() { - _patientPregnant = newValue; - }); - }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ), - Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .treatmentLine, - null, - false), - enabled: true, - controller: _treatmentLineController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 10, ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.wardList != null && - model.wardList.length > 0 - ? () { + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.floorList != null && + model.floorList.length > 0 + ? () { + openListDialogField( + 'description', + 'floorID', + model.floorList, (selectedValue) { + setState(() { + _selectedFloor = selectedValue; + }); + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getFloors().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.floorList.length > 0) { openListDialogField('description', - 'description', model.wardList, + 'floorID', model.floorList, (selectedValue) { setState(() { - _selectedWard = selectedValue; + _selectedFloor = selectedValue; }); }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getWards().then((_) => - GifLoaderDialogUtils.hideDialog( - context)); - if (model.state == ViewState.Idle && - model.wardList.length > 0) { - openListDialogField('description', - 'description', model.wardList, - (selectedValue) { - setState(() { - _selectedWard = selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).ward, - _selectedWard != null - ? _selectedWard['description'] - : null, - true), - enabled: false, - ), + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).floor, + _selectedFloor != null + ? _selectedFloor['description'] + : null, + true), + enabled: false, ), ), - /* CheckboxListTile( - title: AppText( - TranslationBase.of(context) - .preAnesthesiaReferred, - fontWeight: FontWeight.normal, - fontSize: SizeConfig.textMultiplier * 2.1, - ), - value: _preAnesthesiaReferred, - onChanged: (newValue) { - setState(() { - _preAnesthesiaReferred = newValue; - }); - }, - controlAffinity: - ListTileControlAffinity.leading, - contentPadding: EdgeInsets.all(0), - ),*/ - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.admissionTypeList != null && - model.admissionTypeList.length > 0 - ? () { - openListDialogField('nameEn', 'id', - model.admissionTypeList, - (selectedValue) { - setState(() { - _selectedAdmissionType = - selectedValue; - }); + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.wardList != null && + model.wardList.length > 0 + ? () { + openListDialogField( + 'description', + 'nursingStationID', + model.wardList, (selectedValue) { + setState(() { + _selectedWard = selectedValue; }); - } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getMasterLookup( - MasterKeysService - .AdmissionRequestType) - .then((_) => - GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.admissionTypeList.length > - 0) { - openListDialogField('nameEn', - 'id', model.admissionTypeList, - (selectedValue) { - setState(() { - _selectedAdmissionType = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .admissionType, - _selectedAdmissionType != null - ? _selectedAdmissionType[ - 'nameEn'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - SizedBox( - height: 16, - ), - AppText( - TranslationBase.of(context).diagnosisDetail, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.diagnosisTypesList != null && - model.diagnosisTypesList.length > 0 - ? () { - openListDialogField('nameEn', 'id', - model.diagnosisTypesList, + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getWards().then((_) => + GifLoaderDialogUtils.hideDialog( + context)); + if (model.state == ViewState.Idle && + model.wardList.length > 0) { + openListDialogField( + 'description', + 'nursingStationID', + model.wardList, (selectedValue) { setState(() { - _selectedDiagnosis = - selectedValue; + _selectedWard = selectedValue; }); }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model.getDiagnosis().then( - (_) => GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.diagnosisTypesList - .length > - 0) { - openListDialogField( - 'nameEn', - 'id', - model.diagnosisTypesList, - (selectedValue) { - setState(() { - _selectedDiagnosis = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .diagnosis, - _selectedDiagnosis != null - ? _selectedDiagnosis['nameEn'] - : null, - true), - enabled: false, - ), + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).ward, + _selectedWard != null + ? _selectedWard['description'] + : null, + true), + enabled: false, ), ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.icdCodes != null && - model.icdCodes.length > 0 - ? () { - openListDialogField('description', - 'code', model.icdCodes, - (selectedValue) { - setState(() { - _selectedIcd = selectedValue; - }); + ), + SizedBox( + height: 10, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.roomCategoryList != null && + model.roomCategoryList.length > 0 + ? () { + openListDialogField( + 'description', + 'categoryID', + model.roomCategoryList, + (selectedValue) { + setState(() { + _selectedRoomCategory = + selectedValue; }); - } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getICDCodes(patient.patientMRN) - .then((_) => - GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.icdCodes.length > 0) { - openListDialogField('description', - 'code', model.icdCodes, - (selectedValue) { - setState(() { - _selectedIcd = selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).icd, - _selectedIcd != null - ? _selectedIcd['description'] - : null, - true), - enabled: false, - ), - ), - ), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.listOfDiagnosisSelectionTypes != - null && - model.listOfDiagnosisSelectionTypes - .length > - 0 - ? () { + }); + } + : () async { + GifLoaderDialogUtils.showMyDialog( + context); + await model.getRoomCategories().then( + (_) => GifLoaderDialogUtils + .hideDialog(context)); + if (model.state == ViewState.Idle && + model.roomCategoryList.length > + 0) { openListDialogField( 'description', - 'code', - model - .listOfDiagnosisSelectionTypes, + 'categoryID', + model.roomCategoryList, (selectedValue) { setState(() { - _selectedDiagnosisType = + _selectedRoomCategory = selectedValue; }); }); + } else if (model.state == + ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast( + model.error); + } else { + DrAppToastMsg.showErrorToast( + "Empty List"); } - : () async { - GifLoaderDialogUtils.showMyDialog( - context); - await model - .getMasterLookup( - MasterKeysService - .DiagnosisSelectionType) - .then((_) => - GifLoaderDialogUtils - .hideDialog(context)); - if (model.state == ViewState.Idle && - model.listOfDiagnosisSelectionTypes - .length > - 0) { - openListDialogField( - 'description', - 'code', - model - .listOfDiagnosisSelectionTypes, - (selectedValue) { - setState(() { - _selectedDiagnosisType = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .diagnoseType, - _selectedDiagnosisType != null - ? _selectedDiagnosisType[ - 'description'] - : null, - true), - enabled: false, - ), + }, + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context) + .roomCategory, + _selectedRoomCategory != null + ? _selectedRoomCategory[ + 'description'] + : null, + true), + enabled: false, ), ), - SizedBox( - height: 10, - ), - /*Container( - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .preOperativeOrders, - null, - false), - enabled: true, - controller: _preOperativeOrdersController, - keyboardType: TextInputType.text, - minLines: 4, - maxLines: 6, - )), - SizedBox( - height: 10, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.allergiesList != null && - model.allergiesList.length > 0 - ? () { - openListDialogField('nameEn', 'id', - model.allergiesList, - (selectedValue) { - setState(() { - _selectedAllergies = - selectedValue; - }); - }); - } - : () async { - await model.getAllergies(); - if (model.state == ViewState.Idle && - model.allergiesList.length > - 0) { - openListDialogField('nameEn', - 'id', model.allergiesList, - (selectedValue) { - setState(() { - _selectedAllergies = - selectedValue; - }); - }); - } else if (model.state == - ViewState.ErrorLocal) { - DrAppToastMsg.showErrorToast( - model.error); - } else { - DrAppToastMsg.showErrorToast( - "Empty List"); - } - }, - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .allergies, - _selectedAllergies != null - ? _selectedAllergies['nameEn'] - : null, - true), - enabled: false, - ), - ), - ),*/ - ], - ), + ), + SizedBox( + height: 10, + ), + ], ), - ], - ), + ), + ], ), ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).save, - color: HexColor("#B8382B"), - onPressed: () async { - if (_expectedDaysController.text != "" && - _expectedAdmissionDate != null && - _treatmentLineController.text != "" && - _selectedWard != null && - _selectedAdmissionType != null && - _selectedDiagnosis != null && - _selectedIcd != null && - _selectedDiagnosisType != null) { - model.admissionRequestData = admissionRequest; + ), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).next, + color: HexColor("#B8382B"), + onPressed: () async { + if (_estimatedCostController.text != "" && + _postPlansEstimatedCostController.text != "" && + _expectedDaysController.text != "" && + _expectedAdmissionDate != null && + _otherDepartmentsInterventionsController.text != "" && + _selectedFloor != null && + _selectedRoomCategory != + null /*_selectedWard is not required*/) { + model.admissionRequestData = admissionRequest; - model.admissionRequestData.expectedDays = int.parse(_expectedDaysController.text); - model.admissionRequestData.admissionDate = _expectedAdmissionDate.toIso8601String(); - model.admissionRequestData.isSickLeaveRequired = _isSickLeaveRequired; - model.admissionRequestData.isPregnant = _patientPregnant; - model.admissionRequestData.mainLineOfTreatment = _treatmentLineController.text; - model.admissionRequestData.wardID = 0; - model.admissionRequestData.admissionType = _selectedAdmissionType['id']; - dynamic admissionRequestDiagnoses = [ - { - 'diagnosisDescription' : _selectedDiagnosis['nameEn'], - 'diagnosisType' : _selectedDiagnosis['id'], - 'icdCode' : _selectedIcd['code'], - 'icdCodeDescription' : _selectedIcd['description'], - 'type' : _selectedDiagnosisType['code'], - 'remarks' : "", - 'isActive' : true, - } - ]; - model.admissionRequestData.admissionRequestDiagnoses = admissionRequestDiagnoses; - model.admissionRequestData.admissionRequestProcedures = []; - await model.makeAdmissionRequest(); - if(model.state == ViewState.ErrorLocal){ - DrAppToastMsg.showErrorToast( - model.error); - } - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); - } - }, - ), + model.admissionRequestData.estimatedCost = + int.parse(_estimatedCostController.text); + model.admissionRequestData.elementsForImprovement = + _postPlansEstimatedCostController.text; + + model.admissionRequestData.expectedDays = + int.parse(_expectedDaysController.text); + model.admissionRequestData.admissionDate = + _expectedAdmissionDate.toIso8601String(); + model.admissionRequestData + .otherDepartmentInterventions = + _otherDepartmentsInterventionsController.text; + model.admissionRequestData.admissionLocationID = + _selectedFloor['floorID']; + model.admissionRequestData.wardID = + _selectedWard != null + ? _selectedWard['nursingStationID'] + : 0; + model.admissionRequestData.roomCategoryID = + _selectedRoomCategory['categoryID']; + + model.admissionRequestData.admissionRequestProcedures = + []; + Navigator.of(context) + .pushNamed(PATIENT_ADMISSION_REQUEST_3, arguments: { + 'patient': patient, + 'admission-data': model.admissionRequestData + }); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + } + }, ), - ], - ) - : Container(), - ), + ), + ], + ), + )), ); } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 11b5fa7f..98e0cb19 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1092,8 +1092,16 @@ class TranslationBase { String get patientName => localizedValues['patient-name'][locale.languageCode]; - String get appointmentNumber => - localizedValues['appointmentNumber'][locale.languageCode]; + String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => localizedValues['complications'][locale.languageCode]; + String get floor => localizedValues['floor'][locale.languageCode]; + String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 87f67ea2e8e0c9fa9def58594f5fca6ea195b8fb Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 8 Feb 2021 12:13:24 +0200 Subject: [PATCH 270/421] DA-273 solve --- .../profile/referral/refer-patient-screen.dart | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index 3903b46a..b2a71f4b 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -91,20 +91,20 @@ class _PatientMakeReferralScreenState extends State { model.patientReferral.length == 0 ? ReferralForm(model, screenSize) : PatientReferralItemWidget( - "${model.patientReferral[0].patientID}", - patientName: model.patientReferral[0].patientName, + "${model.patientReferral[model.patientReferral.length -1].patientID}", + patientName: model.patientReferral[model.patientReferral.length -1].patientName, referralStatus: - "${model.patientReferral[0].referralStatus}", + "${model.patientReferral[model.patientReferral.length -1].referralStatus}", isReferredTo: true, isSameBranch: model - .patientReferral[0].isReferralDoctorSameBranch, + .patientReferral[model.patientReferral.length -1].isReferralDoctorSameBranch, referralDoctorName: - model.patientReferral[0].referredByDoctorInfo, + model.patientReferral[model.patientReferral.length -1].referredByDoctorInfo, clinicDescription: null, - remark: model.patientReferral[0].remarksFromSource, - referredOn: model.patientReferral[0].referredOn, + remark: model.patientReferral[model.patientReferral.length -1].remarksFromSource, + referredOn: model.patientReferral[model.patientReferral.length -1].referredOn, answerFromTarget: - model.patientReferral[0].answerFromTarget, + model.patientReferral[model.patientReferral.length -1].answerFromTarget, ), ], ), From 5bde14813a3e41efce8dd7289b70ddf3ec2a3f44 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 9 Feb 2021 16:22:22 +0200 Subject: [PATCH 271/421] fixing bugs --- lib/core/viewModel/procedure_View_model.dart | 4 +- .../prescription/prescription_screen.dart | 58 ++++++++++++------- lib/screens/procedures/procedure_screen.dart | 8 +++ lib/screens/procedures/update-procedure.dart | 17 ++++-- lib/widgets/shared/TextFields.dart | 3 +- pubspec.lock | 6 +- 6 files changed, 64 insertions(+), 32 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6be63be0..440724b7 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -32,7 +32,7 @@ class ProcedureViewModel extends BaseViewModel { Future getProcedureCategory({String categoryName}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _procedureService.getProcedureCategory(categoryName: categoryName); if (_procedureService.hasError) { error = _procedureService.error; @@ -80,6 +80,6 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); - // await getProcedure(mrn: mrn); + await getProcedure(mrn: mrn); } } diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 5a212f56..11541e39 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -200,7 +200,7 @@ class _NewPrescriptionScreenState extends State { context) .size .height * - 0.33, + 0.21, width: MediaQuery.of( context) .size @@ -235,11 +235,11 @@ class _NewPrescriptionScreenState extends State { ), ), Container( - height: MediaQuery.of( - context) - .size - .height * - 0.3899, + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.3499, width: MediaQuery.of( context) .size @@ -348,13 +348,20 @@ class _NewPrescriptionScreenState extends State { 17.0, ), Expanded( - child: AppText( - model - .prescriptionList[0] - .entityList[index] - .indication, - fontSize: 15.0), - ) + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].indication), + ), + ), ], ), SizedBox( @@ -413,15 +420,24 @@ class _NewPrescriptionScreenState extends State { Expanded( child: Container( - height: - 25, + // height: MediaQuery.of(context).size.height * + // 0.038, child: - AppText( - model.prescriptionList[0].entityList[index].remarks == null - ? "" - : model.prescriptionList[0].entityList[index].remarks, - fontSize: - 12.5, + RichText( + // maxLines: + // 2, + // overflow: + // TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 10.0), + text: + TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].remarks != null + ? model.prescriptionList[0].entityList[index].remarks + : "", + ), ), ), ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index bb897351..28906d07 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -441,6 +441,14 @@ class _ProcedureScreenState extends State { // .updateProcedure(); updateProcedureForm( context, + model: + model, + orderNo: model + .procedureList[ + 0] + .entityList[ + index] + .orderNo, remarks: model .procedureList[ 0] diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index c1dc31f3..3e567c1f 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -14,18 +14,21 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, {String procedureName, + int orderNo, PatiantInformtion patient, String orderType, String procedureId, String remarks, + ProcedureViewModel model, String categoreId}) { - ProcedureViewModel model = ProcedureViewModel(); + //ProcedureViewModel model2 = ProcedureViewModel(); TextEditingController remarksController = TextEditingController(); TextEditingController orderController = TextEditingController(); showModalBottomSheet( @@ -40,6 +43,7 @@ void updateProcedureForm(context, model: model, procedureId: procedureId, categoryId: categoreId, + orderNo: orderNo, ); }); } @@ -52,6 +56,7 @@ class UpdateProcedureWidget extends StatefulWidget { final TextEditingController remarksController; final String procedureId; final String categoryId; + final int orderNo; UpdateProcedureWidget( {this.model, @@ -60,7 +65,8 @@ class UpdateProcedureWidget extends StatefulWidget { this.remarksController, this.patient, this.procedureId, - this.categoryId}); + this.categoryId, + this.orderNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -85,7 +91,7 @@ class _UpdateProcedureWidgetState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( - baseViewModel: model, + baseViewModel: widget.model, child: DraggableScrollableSheet( minChildSize: 0.90, initialChildSize: 0.95, @@ -226,6 +232,7 @@ class _UpdateProcedureWidgetState extends State { controller: widget.remarksController, maxLines: 3, minLines: 2, + onChanged: (value) {}, ), ), SizedBox( @@ -244,6 +251,7 @@ class _UpdateProcedureWidgetState extends State { onPressed: () { Navigator.pop(context); updateProcedure( + orderNo: widget.orderNo, orderType: selectedType.toString(), categorieId: widget.categoryId, procedureId: widget.procedureId, @@ -272,6 +280,7 @@ class _UpdateProcedureWidgetState extends State { updateProcedure( {ProcedureViewModel model, String remarks, + int orderNo, String newProcedureId, String newCategorieId, List entityList, @@ -289,7 +298,7 @@ class _UpdateProcedureWidgetState extends State { updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.lineItemNo = 1; - updateProcedureReqModel.orderNo = 0; + updateProcedureReqModel.orderNo = orderNo; controls.add( Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index d2807a26..4972d854 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -246,8 +246,7 @@ class _TextFieldsState extends State { }); } } - - widget.onChanged(value); + if (widget.onChanged != null) widget.onChanged(value); }, focusNode: _focusNode, maxLength: widget.maxLength ?? null, diff --git a/pubspec.lock b/pubspec.lock index 94f07eea..addef845 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -559,7 +559,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -830,7 +830,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -965,5 +965,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 400f8e25f6fc770132f854bed16f4f55dba056e7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 9 Feb 2021 21:21:00 +0300 Subject: [PATCH 272/421] bug xis --- lib/config/shared_pref_kay.dart | 1 + lib/screens/dashboard_screen.dart | 9 ++++----- lib/widgets/auth/verification_methods.dart | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 376c8dab..eea2ce76 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -13,3 +13,4 @@ final DASHBOARD_DATA = 'dashboard-data'; final OTP_TYPE = 'otp-type'; final LAST_LOGIN_USER = 'last-login-user'; final PASSWORD = 'password'; +final CLINIC_NAME = 'clinic-name'; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 717dbaa6..30dc2700 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -58,6 +58,7 @@ class _DashboardScreenState extends State { DoctorProfileModel profile; bool isExpanded = false; String isInpatient = ""; + var clinicName = []; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -72,7 +73,8 @@ class _DashboardScreenState extends State { .listen((IosNotificationSettings settings) { print("Settings registered: $settings"); }); - + clinicName = await sharedPref.getObj(CLINIC_NAME); + print(clinicName); _firebaseMessaging.getToken().then((String token) async { if (token != '') { DEVICE_TOKEN = token; @@ -721,10 +723,7 @@ class _DashboardScreenState extends State { child: Column( children: [ AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[6]) - : "", + clinicName.length.toString(), fontSize: SizeConfig.textMultiplier * 6, color: Colors.white, ), diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b5111704..04a82a80 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -486,7 +486,11 @@ class _VerificationMethodsState extends State { case 3: return InkWell( onTap: () => { - authenticateUser(3, BiometricType.fingerprint.index, authProv) + if (checkIfBiometricAvailable(BiometricType.fingerprint)) + { + authenticateUser( + 3, BiometricType.fingerprint.index, authProv) + } }, child: RoundedContainer( backgroundColor: @@ -518,8 +522,11 @@ class _VerificationMethodsState extends State { break; case 4: return InkWell( - onTap: () => - {authenticateUser(4, BiometricType.face.index, authProv)}, + onTap: () { + if (checkIfBiometricAvailable(BiometricType.face)) { + authenticateUser(4, BiometricType.face.index, authProv); + } + }, child: RoundedContainer( backgroundColor: checkIfBiometricAvailable(BiometricType.face) ? Colors.white @@ -739,7 +746,9 @@ class _VerificationMethodsState extends State { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { loginProcessCompleted(res['List_DoctorProfile'][0], authProv); + sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']); } else { + sharedPref.setObj(CLINIC_NAME, res['List_DoctorsClinic']); ClinicModel clinic = ClinicModel.fromJson(res['List_DoctorsClinic'][0]); getDocProfiles(clinic, authProv); From 3d608131464c6fbe629e2c10458085ecb8be1632 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 10 Feb 2021 15:12:26 +0200 Subject: [PATCH 273/421] bug fixing --- .../prescription/add_prescription_form.dart | 143 ++++++++++++------ .../procedures/add-procedure-form.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 12 +- lib/screens/procedures/update-procedure.dart | 2 +- 4 files changed, 102 insertions(+), 57 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 80d77f3e..b1e79ae2 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -543,56 +543,101 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), - //model.patientAssessmentList.forEach((element) { }). - Column( - children: model.patientAssessmentList - .map((element) { - return Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - indication = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - element.icdCode10ID - .toString(), - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, - ), + + if (model.patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indication = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, ), - ); - }).toList(), - ), + ), + ), + //model.patientAssessmentList.forEach((element) { }). + // Column( + // children: model.patientAssessmentList + // .map((element) { + // return Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: indicationList != null + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: indicationList, + // attributeName: 'name', + // attributeValueId: 'id', + // okText: TranslationBase.of( + // context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // indication = + // selectedValue; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: + // (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // child: TextField( + // decoration: + // textFieldSelectorDecoration( + // element.icdCode10ID + // .toString(), + // indication != null + // ? indication['name'] + // : null, + // true), + // enabled: true, + // readOnly: true, + // ), + // ), + // ); + // }).toList(), + // ), SizedBox(height: spaceBetweenTextFileds), Container( diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 81452c63..0d34da6b 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -221,7 +221,7 @@ class _AddSelectedProcedureState extends State { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text('routine'), Radio( activeColor: Color(0xFFB9382C), groupValue: selectedType, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 28906d07..dd5c2952 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -259,11 +259,11 @@ class _ProcedureScreenState extends State { ), Expanded( child: Container( - height: MediaQuery.of( - context) - .size - .height * - 0.21, + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.21, width: MediaQuery.of( context) .size @@ -312,7 +312,7 @@ class _ProcedureScreenState extends State { AppText( model.procedureList[0].entityList[index].orderType == 1 - ? 'Regular' + ? 'Routine' : 'Urgent', fontSize: 13.0, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 3e567c1f..9239527c 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -212,7 +212,7 @@ class _UpdateProcedureWidgetState extends State { setSelectedType(value); }, ), - Text(TranslationBase.of(context).regular), + Text('routine'), ], ), ), From 498c6c00af3c62a818ef69c899432137c3af97f0 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 10 Feb 2021 15:13:14 +0200 Subject: [PATCH 274/421] fix minor issue bugs (DA-273, DA-361, DA-362, DA-363) --- lib/core/service/patient-doctor-referral-service.dart | 6 +++--- lib/core/service/patient-ucaf-service.dart | 4 ++-- lib/models/patient/patiant_info_model.dart | 6 +++++- .../profile/referral/my-referral-detail-screen.dart | 2 ++ .../patients/profile/PatientHeaderWidgetNoAvatar.dart | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 77af017c..813fef35 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -198,9 +198,9 @@ class PatientReferralService extends LookupService { Map body = Map(); body['PatientMRN'] = pendingReferral.patientID; - body['AppointmentNo'] = pendingReferral.sourceAppointmentNo; - body['SetupID'] = pendingReferral.sourceSetupID; - body['ProjectID'] = pendingReferral.sourceProjectId; + body['AppointmentNo'] = pendingReferral.targetAppointmentNo; + body['SetupID'] = pendingReferral.targetSetupID; + body['ProjectID'] = pendingReferral.targetProjectId; body['IsAccepted'] = isAccepted; body['PatientName'] = pendingReferral.patientName; body['ReferralResponse'] = pendingReferral.remarksFromSource; diff --git a/lib/core/service/patient-ucaf-service.dart b/lib/core/service/patient-ucaf-service.dart index 429e78a9..90a45ee2 100644 --- a/lib/core/service/patient-ucaf-service.dart +++ b/lib/core/service/patient-ucaf-service.dart @@ -106,8 +106,8 @@ class UcafService extends LookupService { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientMRN; - // body['AppointmentNo'] = patient.appointmentNo; - // body['EpisodeID'] = patient.episodeNo; + body['AppointmentNo'] = patient.appointmentNo; + body['EpisodeID'] = patient.episodeNo; await baseAppClient.post (GET_ORDER_PROCEDURE, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 3547a73d..ceb84175 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -54,6 +54,7 @@ class PatiantInformtion { String genderDescription; String nursingStationName; String startTime; + String visitType; PatiantInformtion({ this.list, @@ -105,7 +106,9 @@ class PatiantInformtion { this.genderInt, this.isSigned, this.medicationOrders, - this.nationality,this.patientMRN + this.nationality, + this.patientMRN, + this.visitType, }); factory PatiantInformtion.fromJson(Map json) => @@ -159,6 +162,7 @@ class PatiantInformtion { medicationOrders :json['medicationOrders'], nationality :json['nationality']??json['NationalityNameN'], patientMRN :json['patientMRN'] ?? json['PatientMRN'], + visitType :json['visitType'] ?? json['visitType'], ); } diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index f1f3c918..8a919709 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -157,6 +157,7 @@ class MyReferralDetailScreen extends StatelessWidget { } else { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgAccept); Navigator.pop(context); + Navigator.pop(context); } }, ), @@ -180,6 +181,7 @@ class MyReferralDetailScreen extends StatelessWidget { } else { DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsgReject); Navigator.pop(context); + Navigator.pop(context); } }, ), diff --git a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart index 1f1c4079..aef7a161 100644 --- a/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart +++ b/lib/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart @@ -43,7 +43,7 @@ class PatientHeaderWidgetNoAvatar extends StatelessWidget { ], ), AppText( - "NEW VISIT", + patient.visitType ?? "", fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.0, ), From c8e5a7eeef7551d873627f11c25e8cd5c058a321 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 10 Feb 2021 17:00:50 +0200 Subject: [PATCH 275/421] fix PatientCard --- ios/Podfile.lock | 4 +- .../ClingoVideoCallViewController.swift | 446 +++++++++++++++ lib/screens/patients/patients_screen.dart | 527 +++--------------- lib/widgets/patients/PatientCard.dart | 244 ++++++++ 4 files changed, 774 insertions(+), 447 deletions(-) create mode 100644 ios/Runner/ClingoVideoCallViewController.swift create mode 100644 lib/widgets/patients/PatientCard.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index fb65ae25..9c86879d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -18,7 +18,7 @@ PODS: - Firebase/Messaging (6.33.0): - Firebase/CoreOnly - FirebaseMessaging (~> 4.7.0) - - firebase_core (0.5.2): + - firebase_core (0.5.3): - Firebase/CoreOnly (~> 6.33.0) - Flutter - firebase_core_web (0.1.0): @@ -250,7 +250,7 @@ SPEC CHECKSUMS: connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 - firebase_core: 350ba329d1641211bc6183a3236893cafdacfea7 + firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd diff --git a/ios/Runner/ClingoVideoCallViewController.swift b/ios/Runner/ClingoVideoCallViewController.swift new file mode 100644 index 00000000..b1bacdae --- /dev/null +++ b/ios/Runner/ClingoVideoCallViewController.swift @@ -0,0 +1,446 @@ +// +// ViewController.swift +// Lets-Build-OTPublisher +// +// Created by Roberto Perez Cubero on 11/08/16. +// Copyright © 2016 tokbox. All rights reserved. +// + +import UIKit +import OpenTok + +// The converted code is limited to 2 KB. +// Refill your credit or upgrade your plan to remove this limitation. +// +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +// +// ClingoVideoCallViewController.m +// Runner +// +// Created by Mohammad Aljammal & Elham on 23/6/20. +// Copyright © 2020 The Chromium Authors. All rights reserved. +// + + + + +import AVFoundation + +var dateFormatter: DateFormatter? + + +class ClingoVideoCallViewController : UIViewController, OTSessionDelegate, OTSubscriberDelegate, OTPublisherDelegate{ + + var kApiKey: String? + var kSessionId: String? + var kToken: String? + var session: OTSession? + var publisher: OTPublisher? + var subscriber: OTSubscriber? + var callDuration: String? + var warningDuration: String? + var appLang: String? + + + + @IBOutlet weak var localVideo: UIView! + @IBOutlet weak var remoteVideo: UIView! + @IBOutlet weak var controlButtons: UIView! + @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! + @IBOutlet weak var localVideoMutedBg: UIImageView! + @IBOutlet weak var localVideoMutedIndicator: UIImageView! + @IBOutlet weak var remainingTimeLBL: UILabel! + @IBOutlet weak var pgView: UIProgressView! + var timer: Timer? + + + + + func viewDidLoad() { + super.viewDidLoad() + dateFormatter = DateFormatter() + + setupButtons() + askForMicrophonePermission() + requestCameraPermissionsIfNeeded() + hideVideoMuted() + setupSession() + // Do any additional setup after loading the view. + } + + func viewDidDisappear(_ animated: Bool) { + sessionDisconnect() + timer.invalidate() + timer = nil + PgView.hidden = true + remainingTimeLBL.hidden = true + } + +// MARK: -Microphone Camera and Permission Request + func askForMicrophonePermission() { + switch AVAudioSession.sharedInstance().recordPermission { + case AVAudioSessionRecordPermissionGranted: + break + case AVAudioSessionRecordPermissionDenied: + break + case AVAudioSessionRecordPermissionUndetermined: + // This is the initial state before a user has made any choice + // You can use this spot to request permission here if you want + AVAudioSession.sharedInstance().requestRecordPermission({ granted in + // Check for granted + }) + default: + break + } + } + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +func requestCameraPermissionsIfNeeded() { + + // check camera authorization status + let authStatus: AVAuthorizationStatus = AVCaptureDevice.authorizationStatus(for: .video) + switch authStatus { + case .authorized: break + // camera authorized + // do camera intensive stuff + case .notDetermined: + // request authorization + + AVCaptureDevice.requestAccess(for: .video, completionHandler: { granted in + DispatchQueue.main.async(execute: { + + if granted { + // do camera intensive stuff + } else { + self.notifyUserOfCameraAccessDenial() + } + }) + }) + case .restricted, .denied: + DispatchQueue.main.async(execute: { + self.notifyUserOfCameraAccessDenial() + }) + default: + break + } +} + +func notifyUserOfCameraAccessDenial() { + // display a useful message asking the user to grant permissions from within Settings > Privacy > Camera +} + +// MARK: - OpenTok methods +func showAlert(_ string: String?) { + // show alertview on main UI + DispatchQueue.main.async(execute: { + let alertVC = UIAlertController( + title: "OTError", + message: string, + preferredStyle: .alert) + self.present(alertVC, animated: true) + }) +} + +// MARK: - OpenTok methods +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +/// Asynchronously begins the session connect process. Some time later, we will +/// expect a delegate method to call us back with the results of this action. +func setupSession() { + //setup one time session + if session { + session = nil + } + session = OTSession( + apiKey: kApiKey, + sessionId: kSessionId, + delegate: self) + do { + try session.connect(withToken: kToken) + } catch { + } + +} + +/// Sets up an instance of OTPublisher to use with this session. OTPubilsher +/// binds to the device camera and microphone, and will provide A/V streams +/// to the OpenTok session. +func setupPublisher() { + let settings = OTPublisherSettings() + settings.name = UIDevice.current.name + publisher = OTPublisher(delegate: self, settings: settings) + + var error: OTError? = nil + session.publish(publisher, error: &error) + if error != nil { + showAlert(error?.localizedDescription()) + } + localVideo.addSubview(publisher.view) + publisher.view.frame = CGRect(x: localVideo.bounds.origin.x, y: localVideo.bounds.origin.y, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) + +} + +/// Cleans up the publisher and its view. At this point, the publisher should not +/// be attached to the session any more. +func cleanupPublisher() { + publisher?.view.removeFromSuperview() + publisher = nil + // this is a good place to notify the end-user that publishing has stopped. +} + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +/// Instantiates a subscriber for the given stream and asynchronously begins the +/// process to begin receiving A/V content for this stream. Unlike doPublish, +/// this method does not add the subscriber to the view hierarchy. Instead, we +/// add the subscriber only after it has connected and begins receiving data. +func setupSubscribe(_ stream: OTStream?) { + subscriber = OTSubscriber(stream: stream, delegate: self) + + var error: OTError? = nil + session.subscribe(subscriber, error: &error) + if error != nil { + showAlert(error?.localizedDescription()) + } +} + +/// Cleans the subscriber from the view hierarchy, if any. +/// NB: You do *not* have to call unsubscribe in your controller in response to +/// a streamDestroyed event. Any subscribers (or the publisher) for a stream will +/// be automatically removed from the session during cleanup of the stream. +func cleanupSubscriber() { + subscriber.view.removeFromSuperview() + subscriber = nil +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +// MARK: - OTSession delegate callbacks +func sessionDidConnect(_ session: OTSession?) { + if let sessionId = session?.sessionId { + print("sessionDidConnect (\(sessionId))") + } + + // Step 2: We have successfully connected, now instantiate a publisher and + // begin pushing A/V streams into OpenTok. + setupPublisher() +} + +func sessionDidDisconnect(_ session: OTSession?) { + var alertMessage: String? = nil + if let sessionId = session?.sessionId { + alertMessage = "Session disconnected: (\(sessionId))" + } + print("sessionDidDisconnect (\(alertMessage ?? ""))") +} + +func session( + _ mySession: OTSession?, + streamCreated stream: OTStream? +) { + if let streamId = stream?.streamId { + print("session streamCreated (\(streamId))") + } + + if nil == subscriber { + setupSubscribe(stream) + } +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +func session( + _ session: OTSession?, + streamDestroyed stream: OTStream? +) { + if let streamId = stream?.streamId { + print("session streamDestroyed (\(streamId))") + } + + if subscriber.stream.streamId == stream?.streamId { + cleanupSubscriber() + } +} + +func session( + _ session: OTSession?, + connectionCreated connection: OTConnection? +) { + startTimer(callDuration, warningDuration) + if let connectionId = connection?.connectionId { + print("session connectionCreated (\(connectionId))") + } +} + +func session( + _ session: OTSession?, + connectionDestroyed connection: OTConnection? +) { + if let connectionId = connection?.connectionId { + print("session connectionDestroyed (\(connectionId))") + } + if subscriber.stream.connection.connectionId == connection?.connectionId { + cleanupSubscriber() + } + sessionDisconnect() +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +func session( + _ session: ARSession, + didFailWithError error: Error +) { + print("didFailWithError: (\(error))") +} + +func session(_ session: OTSession, receivedSignalType type: String?, from connection: OTConnection?, with string: String?) { + print("\(session)") +} + +func sessionDisconnect() { + if session && session.sessionConnectionStatus == OTSessionConnectionStatusConnected { + print("disconnecting....") + session.disconnect(nil) + dismiss(animated: true) + return + } + dismiss(animated: true) +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +//do { +// print( +// "subscriberDidConnectToStream (\(subscriber.stream.connection.connectionId))") +// assert(subscriber == subscriber) +// remoteVideo.addSubview(subscriber.view) +// subscriber.view.frame = remoteVideo.bounds +// // self.remoteVideo=_publisher.view; +//} + +- +do { + print( + "subscriber \(subscriber.stream.streamId) didFailWithError \(error)") +} + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +// MARK: - OTPublisher delegate callbacks +func publisher( + _ publisher: OTPublisherKit?, + streamCreated stream: OTStream? +) { + print("Publishing") +} + +func publisher( + _ publisher: OTPublisherKit?, + streamDestroyed stream: OTStream? +) { + if subscriber.stream.streamId == stream?.streamId { + cleanupSubscriber() + } + + cleanupPublisher() +} + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +func publisher( + _ publisher: OTPublisherKit?, + didFailWithError error: OTError? +) { + if let error = error { + print("publisher didFailWithError \(error)") + } + cleanupPublisher() +} + +// MARK: - Ui Handel +func hideVideoMuted() { + remoteVideoMutedIndicator.hidden = true + localVideoMutedBg.hidden = true + localVideoMutedIndicator.hidden = true +} + +func setupButtons() { + perform(#selector(hideControlButtons), with: nil, afterDelay: 3) + let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(remoteVideoTapped(_:))) + view.addGestureRecognizer(tapGestureRecognizer) + view.isUserInteractionEnabled = true +} + + // Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +@objc func hideControlButtons() { + controlButtons.hidden = true +} + +func remoteVideoTapped(_ recognizer: UITapGestureRecognizer?) { + if controlButtons.hidden { + controlButtons.hidden = false + perform(#selector(hideControlButtons), with: nil, afterDelay: 3) + } +} + +func resetHideButtonsTimer() { + ClingoVideoCallViewController.cancelPreviousPerformRequests(withTarget: self) + perform(#selector(hideControlButtons), with: nil, afterDelay: 3) +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +@IBAction func didClickMuteButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + publisher.publishAudio = !sender.isSelected + resetHideButtonsTimer() +} + +@IBAction func didClickSpeakerButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + subscriber.subscribeToAudio = !sender.isSelected + resetHideButtonsTimer() +} + +@IBAction func didClickVideoMuteButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + if publisher.publishVideo { + publisher.publishVideo = false + } else { + publisher.publishVideo = true + } + localVideo.hidden = sender.isSelected + localVideoMutedBg.hidden = !sender.isSelected + localVideoMutedIndicator.hidden = !sender.isSelected + resetHideButtonsTimer() +} + + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +@IBAction func didClickSwitchCameraButton(_ sender: UIButton) { + sender.isSelected = !sender.isSelected + if sender.isSelected { + publisher.cameraPosition = RPCameraPosition(rawValue: AVCaptureDevice.Position.back.rawValue) + } else { + publisher.cameraPosition = RPCameraPosition(rawValue: AVCaptureDevice.Position.front.rawValue) + } + resetHideButtonsTimer() +} + +@IBAction func hangUp(_ sender: UIButton) { + sessionDisconnect() +} + +// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ +func startTimer(_ callDuration: String?, _ warningTime: String?) { +} + + func -currentTime as? Date! +do { + let startCallTime = Date() + dateFormatter.dateFormat = "yyyyMMddHHmmss" + let resultString = dateFormatter.string(from: startCallTime) + let date = dateFormatter.date(from: resultString) + return date +} + + +} diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 50b89148..733a1b9c 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,12 +1,3 @@ -/* - *@author: Amjad Amireh Merge to Elham rababah - *@Date:27/4/2020 - *@param: - *@return:PatientsScreen - - *@desc: - */ - import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -19,6 +10,7 @@ import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/PatientCard.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'; @@ -93,14 +85,6 @@ class _PatientsScreenState extends State { } } -/* - *@author: Amjad Amireh - *@Date:5/5/2020 - *@param: - *@return:Convert time from Milesecond to date with time - - *@desc: - */ convertDate(String str) { String timeConvert; const start = "/Date("; @@ -129,14 +113,6 @@ class _PatientsScreenState extends State { return newDateformat.toString(); } -/* - *@author: Amjad Amireh - *@Date:5/5/2020 - *@param: - *@return:Convert time from Milesecond to date - - *@desc: - */ convertDateFormat(String str) { String timeConvert; const start = "/Date("; @@ -156,24 +132,6 @@ class _PatientsScreenState extends State { return newDate.toString(); } - convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); - } filterBooking(String str) { this.responseModelList = this.responseModelList2; @@ -228,14 +186,6 @@ class _PatientsScreenState extends State { return TranslationBase.of(context).all; } -/* - *@author: Amjad Amireh Modified New design - *@Date:21/5/2020 - *@param: - *@return:PatientsScreen - - *@desc: - */ @override Widget build(BuildContext context) { _locations = [ @@ -401,322 +351,19 @@ class _PatientsScreenState extends State { children: responseModelList .map((PatiantInformtion item) { - return Container( - decoration: - myBoxDecoration(), - 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) - ], - borderRadius: - BorderRadius.all( - Radius.circular(35.0)), - color: Color( - 0xffCCCCCC), - ), - width: 70, - height: 70, - child: Icon( - item.genderDescription == - "Male" - ? DoctorApp - .male - : DoctorApp - .female_icon, - size: 70, - color: Colors - .white, - ), - ), - ), - ], - ), - - SizedBox( - width: 10, - ), - - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - Column( - children: [ - SizedBox( - height: - 10.0, - ), - AppText( - item.firstName + - " " + - item.lastName, - fontSize: - 2.0 * SizeConfig.textMultiplier, - fontWeight: - FontWeight.bold, - backGroundcolor: - Colors.white, - ), - SizedBox( - height: - 5, - ), - ], - ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: < - Widget>[ - Wrap( - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.patientId.toString(), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - SizedBox( - width: 10, - ), - ], - ), - SizedBox( - height: - 2.5, - ), - Container( - child: - AppText( - TranslationBase.of(context).nationality + " : " + (item.nationalityName ?? item.nationality), - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - margin: - EdgeInsets.only(right: projectsProvider.isArabic ? 0 : 10, left: projectsProvider.isArabic ? 10 : 0), - ), - SizedBox( - width: - 10, - ), - SizedBox( - height: - 15.5, - ), - SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - item.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(item.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ) - : SizedBox( - height: 5, - ), - ], - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - // mainAxisAlignment: - // MainAxisAlignment - // .spaceBetween, - children: < - Widget>[ - SizedBox( - height: - 0.5, - ), - SizedBox( - height: - 0, - ), - Wrap( - children: [ - AppText( - TranslationBase - .of( - context) - .age2, - fontSize: 1.8 * - SizeConfig - .textMultiplier, - fontWeight: FontWeight - .bold, - backGroundcolor: Colors - .white, - ), - AppText( - " ${DateUtils.getAgeByBirthday(item.dateofBirth, context)}", - - fontSize: 1.8 * - SizeConfig - .textMultiplier, - fontWeight: FontWeight - .w300, - backGroundcolor: Colors - .white, - ), - SizedBox( - width: 10, - ), - ], - ), - SizedBox( - height: - 2.5, - ), - - Wrap( - children: [ - AppText( - TranslationBase.of(context).gender2, - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - AppText( - item.gender.toString() == '1' ? 'Male' : 'Female', - fontSize: 1.8 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - backGroundcolor: Colors.white, - ), - ], - ), - SizedBox( - height: - 8, - ), - SERVICES_PATIANT2[int.parse(patientType)] == "List_MyOutPatient" - ? Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - height: 15, - width: 60, - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(25), - color: HexColor("#20A169"), - ), - child: AppText( - item.startTime, - color: Colors.white, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(item.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - SizedBox( - height: 25.5, - ), - ], - ) - : SizedBox( - height: 15, - ), - ], - ), - ), - ], - ), - ], - ), - ), - // Divider(color: Colors.grey) - ], - ), - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType":patientType, - "from" : patient.getFrom, - "to" : patient.getTo, - }); - }, - ), - ); + return PatientCard(patientInfo: item, + patientType: patientType, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType":patientType, + "from" : patient.getFrom, + "to" : patient.getTo, + }); + },); }).toList(), ) : Center( @@ -754,88 +401,78 @@ class _PatientsScreenState extends State { } Widget _locationBar(BuildContext _context) { - return Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.0619, - width: SizeConfig.screenWidth * 0.94, - decoration: BoxDecoration( - color: Color(0Xffffffff), - borderRadius: BorderRadius.circular(12.5), - border: Border.all( - width: 0.5, - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Center( - child: Expanded( - child: Container( - height: MediaQuery.of(context).size.height * 0.058, - width: SizeConfig.screenWidth * 0.2334, - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(12.5), - topRight: Radius.circular(12.5), - topLeft: Radius.circular(9.5), - bottomLeft: Radius.circular(9.5)), - color: - _isActive ? HexColor("#B8382B") : Colors.white, - ), - child: Center( - child: Text( - item, - style: TextStyle( - fontSize: 12, - color: _isActive - ? Colors.white - : Colors.black, //Colors.black, - - fontWeight: FontWeight.normal, - ), - ), - )), - ), - ), - onTap: () { - filterBooking(item.toString()); - - setState(() { - _activeLocation = _locations.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(10), - topRight: Radius.circular(10)), - color: Colors.white), - alignment: Alignment.center, - height: 1, - width: SizeConfig.screenWidth * 0.23, - ) - : Container() - ]); - }).toList(), + return Container( + height: MediaQuery.of(context).size.height * 0.0619, + width: SizeConfig.screenWidth * 0.94, + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: BorderRadius.circular(12.5), + border: Border.all( + width: 0.5, ), ), - ); - } + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Center( + child: Container( + height: MediaQuery.of(context).size.height * 0.058, + width: SizeConfig.screenWidth * 0.2334, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(12.5), + topRight: Radius.circular(12.5), + topLeft: Radius.circular(9.5), + bottomLeft: Radius.circular(9.5)), + color: + _isActive ? HexColor("#B8382B") : Colors.white, + ), + child: Center( + child: Text( + item, + style: TextStyle( + fontSize: 12, + color: _isActive + ? Colors.white + : Colors.black, //Colors.black, + + fontWeight: FontWeight.normal, + ), + ), + )), + ), + onTap: () { + filterBooking(item.toString()); - myBoxDecoration() { - return BoxDecoration( - border: Border( - bottom: BorderSide( - color: Color(0xffCCCCCC), - width: 0.5, - ), + setState(() { + _activeLocation = _locations.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(10), + topRight: Radius.circular(10)), + color: Colors.white), + alignment: Alignment.center, + height: 1, + width: SizeConfig.screenWidth * 0.23, + ) + : Container() + ]); + }).toList(), ), ); } + + } + + + diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart new file mode 100644 index 00000000..5ccae18f --- /dev/null +++ b/lib/widgets/patients/PatientCard.dart @@ -0,0 +1,244 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +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); + @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) + ], + 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 , + 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()), + ],),), + ), + 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,) + ]), + 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)), + ],),), + ), + + + 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'), + ],),), + ), + ] + ), + + ], + ), + 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, + ), + Container( + child: AppText( + convertDateFormat2(patientInfo.appointmentDate.toString()), + fontSize: 1.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only(top: 8,), + ) + ], + ), + ), + + // Divider(color: Colors.grey) + ], + ), + onTap: onTap, + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + bottom: BorderSide( + color: Color(0xffCCCCCC), + width: 0.5, + ), + ), + ); + } +} \ No newline at end of file From dcac240ae4e44c76309e57ad9ec388bbe300a030 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 10 Feb 2021 17:15:05 +0200 Subject: [PATCH 276/421] remove files --- .../ClingoVideoCallViewController.swift | 446 ------------------ 1 file changed, 446 deletions(-) delete mode 100644 ios/Runner/ClingoVideoCallViewController.swift diff --git a/ios/Runner/ClingoVideoCallViewController.swift b/ios/Runner/ClingoVideoCallViewController.swift deleted file mode 100644 index b1bacdae..00000000 --- a/ios/Runner/ClingoVideoCallViewController.swift +++ /dev/null @@ -1,446 +0,0 @@ -// -// ViewController.swift -// Lets-Build-OTPublisher -// -// Created by Roberto Perez Cubero on 11/08/16. -// Copyright © 2016 tokbox. All rights reserved. -// - -import UIKit -import OpenTok - -// The converted code is limited to 2 KB. -// Refill your credit or upgrade your plan to remove this limitation. -// -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -// -// ClingoVideoCallViewController.m -// Runner -// -// Created by Mohammad Aljammal & Elham on 23/6/20. -// Copyright © 2020 The Chromium Authors. All rights reserved. -// - - - - -import AVFoundation - -var dateFormatter: DateFormatter? - - -class ClingoVideoCallViewController : UIViewController, OTSessionDelegate, OTSubscriberDelegate, OTPublisherDelegate{ - - var kApiKey: String? - var kSessionId: String? - var kToken: String? - var session: OTSession? - var publisher: OTPublisher? - var subscriber: OTSubscriber? - var callDuration: String? - var warningDuration: String? - var appLang: String? - - - - @IBOutlet weak var localVideo: UIView! - @IBOutlet weak var remoteVideo: UIView! - @IBOutlet weak var controlButtons: UIView! - @IBOutlet weak var remoteVideoMutedIndicator: UIImageView! - @IBOutlet weak var localVideoMutedBg: UIImageView! - @IBOutlet weak var localVideoMutedIndicator: UIImageView! - @IBOutlet weak var remainingTimeLBL: UILabel! - @IBOutlet weak var pgView: UIProgressView! - var timer: Timer? - - - - - func viewDidLoad() { - super.viewDidLoad() - dateFormatter = DateFormatter() - - setupButtons() - askForMicrophonePermission() - requestCameraPermissionsIfNeeded() - hideVideoMuted() - setupSession() - // Do any additional setup after loading the view. - } - - func viewDidDisappear(_ animated: Bool) { - sessionDisconnect() - timer.invalidate() - timer = nil - PgView.hidden = true - remainingTimeLBL.hidden = true - } - -// MARK: -Microphone Camera and Permission Request - func askForMicrophonePermission() { - switch AVAudioSession.sharedInstance().recordPermission { - case AVAudioSessionRecordPermissionGranted: - break - case AVAudioSessionRecordPermissionDenied: - break - case AVAudioSessionRecordPermissionUndetermined: - // This is the initial state before a user has made any choice - // You can use this spot to request permission here if you want - AVAudioSession.sharedInstance().requestRecordPermission({ granted in - // Check for granted - }) - default: - break - } - } - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -func requestCameraPermissionsIfNeeded() { - - // check camera authorization status - let authStatus: AVAuthorizationStatus = AVCaptureDevice.authorizationStatus(for: .video) - switch authStatus { - case .authorized: break - // camera authorized - // do camera intensive stuff - case .notDetermined: - // request authorization - - AVCaptureDevice.requestAccess(for: .video, completionHandler: { granted in - DispatchQueue.main.async(execute: { - - if granted { - // do camera intensive stuff - } else { - self.notifyUserOfCameraAccessDenial() - } - }) - }) - case .restricted, .denied: - DispatchQueue.main.async(execute: { - self.notifyUserOfCameraAccessDenial() - }) - default: - break - } -} - -func notifyUserOfCameraAccessDenial() { - // display a useful message asking the user to grant permissions from within Settings > Privacy > Camera -} - -// MARK: - OpenTok methods -func showAlert(_ string: String?) { - // show alertview on main UI - DispatchQueue.main.async(execute: { - let alertVC = UIAlertController( - title: "OTError", - message: string, - preferredStyle: .alert) - self.present(alertVC, animated: true) - }) -} - -// MARK: - OpenTok methods -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -/// Asynchronously begins the session connect process. Some time later, we will -/// expect a delegate method to call us back with the results of this action. -func setupSession() { - //setup one time session - if session { - session = nil - } - session = OTSession( - apiKey: kApiKey, - sessionId: kSessionId, - delegate: self) - do { - try session.connect(withToken: kToken) - } catch { - } - -} - -/// Sets up an instance of OTPublisher to use with this session. OTPubilsher -/// binds to the device camera and microphone, and will provide A/V streams -/// to the OpenTok session. -func setupPublisher() { - let settings = OTPublisherSettings() - settings.name = UIDevice.current.name - publisher = OTPublisher(delegate: self, settings: settings) - - var error: OTError? = nil - session.publish(publisher, error: &error) - if error != nil { - showAlert(error?.localizedDescription()) - } - localVideo.addSubview(publisher.view) - publisher.view.frame = CGRect(x: localVideo.bounds.origin.x, y: localVideo.bounds.origin.y, width: localVideo.bounds.size.width, height: localVideo.bounds.size.height) - -} - -/// Cleans up the publisher and its view. At this point, the publisher should not -/// be attached to the session any more. -func cleanupPublisher() { - publisher?.view.removeFromSuperview() - publisher = nil - // this is a good place to notify the end-user that publishing has stopped. -} - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -/// Instantiates a subscriber for the given stream and asynchronously begins the -/// process to begin receiving A/V content for this stream. Unlike doPublish, -/// this method does not add the subscriber to the view hierarchy. Instead, we -/// add the subscriber only after it has connected and begins receiving data. -func setupSubscribe(_ stream: OTStream?) { - subscriber = OTSubscriber(stream: stream, delegate: self) - - var error: OTError? = nil - session.subscribe(subscriber, error: &error) - if error != nil { - showAlert(error?.localizedDescription()) - } -} - -/// Cleans the subscriber from the view hierarchy, if any. -/// NB: You do *not* have to call unsubscribe in your controller in response to -/// a streamDestroyed event. Any subscribers (or the publisher) for a stream will -/// be automatically removed from the session during cleanup of the stream. -func cleanupSubscriber() { - subscriber.view.removeFromSuperview() - subscriber = nil -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -// MARK: - OTSession delegate callbacks -func sessionDidConnect(_ session: OTSession?) { - if let sessionId = session?.sessionId { - print("sessionDidConnect (\(sessionId))") - } - - // Step 2: We have successfully connected, now instantiate a publisher and - // begin pushing A/V streams into OpenTok. - setupPublisher() -} - -func sessionDidDisconnect(_ session: OTSession?) { - var alertMessage: String? = nil - if let sessionId = session?.sessionId { - alertMessage = "Session disconnected: (\(sessionId))" - } - print("sessionDidDisconnect (\(alertMessage ?? ""))") -} - -func session( - _ mySession: OTSession?, - streamCreated stream: OTStream? -) { - if let streamId = stream?.streamId { - print("session streamCreated (\(streamId))") - } - - if nil == subscriber { - setupSubscribe(stream) - } -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -func session( - _ session: OTSession?, - streamDestroyed stream: OTStream? -) { - if let streamId = stream?.streamId { - print("session streamDestroyed (\(streamId))") - } - - if subscriber.stream.streamId == stream?.streamId { - cleanupSubscriber() - } -} - -func session( - _ session: OTSession?, - connectionCreated connection: OTConnection? -) { - startTimer(callDuration, warningDuration) - if let connectionId = connection?.connectionId { - print("session connectionCreated (\(connectionId))") - } -} - -func session( - _ session: OTSession?, - connectionDestroyed connection: OTConnection? -) { - if let connectionId = connection?.connectionId { - print("session connectionDestroyed (\(connectionId))") - } - if subscriber.stream.connection.connectionId == connection?.connectionId { - cleanupSubscriber() - } - sessionDisconnect() -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -func session( - _ session: ARSession, - didFailWithError error: Error -) { - print("didFailWithError: (\(error))") -} - -func session(_ session: OTSession, receivedSignalType type: String?, from connection: OTConnection?, with string: String?) { - print("\(session)") -} - -func sessionDisconnect() { - if session && session.sessionConnectionStatus == OTSessionConnectionStatusConnected { - print("disconnecting....") - session.disconnect(nil) - dismiss(animated: true) - return - } - dismiss(animated: true) -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -//do { -// print( -// "subscriberDidConnectToStream (\(subscriber.stream.connection.connectionId))") -// assert(subscriber == subscriber) -// remoteVideo.addSubview(subscriber.view) -// subscriber.view.frame = remoteVideo.bounds -// // self.remoteVideo=_publisher.view; -//} - -- -do { - print( - "subscriber \(subscriber.stream.streamId) didFailWithError \(error)") -} - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -// MARK: - OTPublisher delegate callbacks -func publisher( - _ publisher: OTPublisherKit?, - streamCreated stream: OTStream? -) { - print("Publishing") -} - -func publisher( - _ publisher: OTPublisherKit?, - streamDestroyed stream: OTStream? -) { - if subscriber.stream.streamId == stream?.streamId { - cleanupSubscriber() - } - - cleanupPublisher() -} - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -func publisher( - _ publisher: OTPublisherKit?, - didFailWithError error: OTError? -) { - if let error = error { - print("publisher didFailWithError \(error)") - } - cleanupPublisher() -} - -// MARK: - Ui Handel -func hideVideoMuted() { - remoteVideoMutedIndicator.hidden = true - localVideoMutedBg.hidden = true - localVideoMutedIndicator.hidden = true -} - -func setupButtons() { - perform(#selector(hideControlButtons), with: nil, afterDelay: 3) - let tapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(remoteVideoTapped(_:))) - view.addGestureRecognizer(tapGestureRecognizer) - view.isUserInteractionEnabled = true -} - - // Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -@objc func hideControlButtons() { - controlButtons.hidden = true -} - -func remoteVideoTapped(_ recognizer: UITapGestureRecognizer?) { - if controlButtons.hidden { - controlButtons.hidden = false - perform(#selector(hideControlButtons), with: nil, afterDelay: 3) - } -} - -func resetHideButtonsTimer() { - ClingoVideoCallViewController.cancelPreviousPerformRequests(withTarget: self) - perform(#selector(hideControlButtons), with: nil, afterDelay: 3) -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -@IBAction func didClickMuteButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - publisher.publishAudio = !sender.isSelected - resetHideButtonsTimer() -} - -@IBAction func didClickSpeakerButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - subscriber.subscribeToAudio = !sender.isSelected - resetHideButtonsTimer() -} - -@IBAction func didClickVideoMuteButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - if publisher.publishVideo { - publisher.publishVideo = false - } else { - publisher.publishVideo = true - } - localVideo.hidden = sender.isSelected - localVideoMutedBg.hidden = !sender.isSelected - localVideoMutedIndicator.hidden = !sender.isSelected - resetHideButtonsTimer() -} - - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -@IBAction func didClickSwitchCameraButton(_ sender: UIButton) { - sender.isSelected = !sender.isSelected - if sender.isSelected { - publisher.cameraPosition = RPCameraPosition(rawValue: AVCaptureDevice.Position.back.rawValue) - } else { - publisher.cameraPosition = RPCameraPosition(rawValue: AVCaptureDevice.Position.front.rawValue) - } - resetHideButtonsTimer() -} - -@IBAction func hangUp(_ sender: UIButton) { - sessionDisconnect() -} - -// Converted to Swift 5.2 by Swiftify v5.2.26743 - https://swiftify.com/ -func startTimer(_ callDuration: String?, _ warningTime: String?) { -} - - func -currentTime as? Date! -do { - let startCallTime = Date() - dateFormatter.dateFormat = "yyyyMMddHHmmss" - let resultString = dateFormatter.string(from: startCallTime) - let date = dateFormatter.date(from: resultString) - return date -} - - -} From d4ea9019061a1d17050b50a6cecb35dd906f8ee8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 10 Feb 2021 17:35:55 +0200 Subject: [PATCH 277/421] bugs fix --- lib/screens/prescription/add_prescription_form.dart | 4 +++- lib/screens/prescription/prescription_screen.dart | 10 +++++++++- lib/screens/prescription/update_prescription_form.dart | 4 +++- lib/screens/procedures/procedure_screen.dart | 8 ++++---- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b1e79ae2..0b9750fc 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -338,7 +338,9 @@ class _PrescriptionFormWidgetState extends State { 0.550, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter(4) + LengthLimitingTextInputFormatter(4), + WhitelistingTextInputFormatter + .digitsOnly ], hintText: TranslationBase.of(context) .strength, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 11541e39..216ffa05 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -375,7 +375,7 @@ class _NewPrescriptionScreenState extends State { FontWeight .w700, fontSize: - 17.0, + 15.0, ), Expanded( child: AppText( @@ -417,6 +417,14 @@ class _NewPrescriptionScreenState extends State { ), Row( children: [ + AppText( + 'Doctor Remarks : ', + fontWeight: + FontWeight + .w700, + fontSize: + 13.0, + ), Expanded( child: Container( diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 714659ac..885386a6 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -214,7 +214,9 @@ class _UpdatePrescriptionFormState extends State { 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter(4) + LengthLimitingTextInputFormatter(4), + WhitelistingTextInputFormatter + .digitsOnly ], hintText: widget.doseStreangth, fontSize: 15.0, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index dd5c2952..1e225ce9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -281,7 +281,7 @@ class _ProcedureScreenState extends State { FontWeight .w700, fontSize: - 15.0, + 13.0, ), AppText( model @@ -292,7 +292,7 @@ class _ProcedureScreenState extends State { .procedureId .toString(), fontSize: - 13.0, + 12.0, ), SizedBox( width: 12.0, @@ -305,7 +305,7 @@ class _ProcedureScreenState extends State { FontWeight .w700, fontSize: - 14.0, + 13.0, ), Expanded( child: @@ -315,7 +315,7 @@ class _ProcedureScreenState extends State { ? 'Routine' : 'Urgent', fontSize: - 13.0, + 11.5, color: Color( 0xFFB9382C), ), From 28370e7492831c8fa8c9a93ce69262bb5f8bf326 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 10 Feb 2021 19:49:41 +0200 Subject: [PATCH 278/421] fix bugs --- .../model/procedure/get_procedure_req_model.dart | 8 ++++---- lib/core/service/procedure_service.dart | 9 +++++---- lib/core/viewModel/procedure_View_model.dart | 7 ++++--- lib/screens/procedures/add-procedure-form.dart | 12 +++++++++++- .../entity_list_checkbox_search_widget.dart | 7 +++++++ lib/screens/procedures/update-procedure.dart | 12 +++++++++++- 6 files changed, 42 insertions(+), 13 deletions(-) diff --git a/lib/core/model/procedure/get_procedure_req_model.dart b/lib/core/model/procedure/get_procedure_req_model.dart index 1769f43f..6202a520 100644 --- a/lib/core/model/procedure/get_procedure_req_model.dart +++ b/lib/core/model/procedure/get_procedure_req_model.dart @@ -4,7 +4,7 @@ class GetProcedureReqModel { int pageSize; int pageIndex; List search; - dynamic categoryId; + dynamic category; String vidaAuthTokenID; GetProcedureReqModel( @@ -13,7 +13,7 @@ class GetProcedureReqModel { this.pageSize, this.pageIndex, this.search, - this.categoryId, + this.category, this.vidaAuthTokenID}); GetProcedureReqModel.fromJson(Map json) { @@ -22,7 +22,7 @@ class GetProcedureReqModel { pageSize = json['PageSize']; pageIndex = json['PageIndex']; search = json['Search'].cast(); - categoryId = json['CategoryId']; + category = json['Category']; vidaAuthTokenID = json['VidaAuthTokenID']; } @@ -33,7 +33,7 @@ class GetProcedureReqModel { data['PageSize'] = this.pageSize; data['PageIndex'] = this.pageIndex; data['Search'] = this.search; - data['CategoryId'] = this.categoryId; + data['Category'] = this.category; data['VidaAuthTokenID'] = this.vidaAuthTokenID; return data; } diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 515e0e50..1ec996fb 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -73,13 +73,14 @@ class ProcedureService extends BaseService { }, body: Map()); } - Future getProcedureCategory({String categoryName}) async { + Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [categoryName], + search: [""], patientMRN: 0, - pageIndex: 1, + pageIndex: 0, clinicId: 0, - pageSize: 300, + pageSize: 0, + category: categoryID, ); hasError = false; _categoriesList.clear(); diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 440724b7..a753052c 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -29,11 +29,12 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.Idle); } - Future getProcedureCategory({String categoryName}) async { + Future getProcedureCategory({String categoryName, String categoryID}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); - await _procedureService.getProcedureCategory(categoryName: categoryName); + setState(ViewState.Busy); + await _procedureService.getProcedureCategory( + categoryName: categoryName, categoryID: categoryID); if (_procedureService.hasError) { error = _procedureService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 0d34da6b..11eadbb0 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -147,7 +147,17 @@ class _AddSelectedProcedureState extends State { selectedCategory = selectedValue; model.getProcedureCategory( categoryName: selectedCategory[ - 'categoryName']); + 'categoryName'], + categoryID: selectedCategory[ + 'categoryId'] <= + 9 + ? "0" + + selectedCategory[ + 'categoryId'] + .toString() + : selectedCategory[ + 'categoryId'] + .toString()); }); }, ); diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 7036bc0d..a29100f5 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -37,6 +37,13 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { + int selectedType; + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + List items = List(); @override diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 9239527c..2c502334 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -135,7 +135,17 @@ class _UpdateProcedureWidgetState extends State { model.getProcedureCategory( categoryName: selectedCategory[ - 'categoryName']); + 'categoryName'], + categoryID: selectedCategory[ + 'categoryId'] <= + 9 + ? "0" + + selectedCategory[ + 'categoryId'] + .toString() + : selectedCategory[ + 'categoryId'] + .toString()); }); }, ); From 60e416e63272d4f2bfe3fc7f6bb38f3d7b4eafb5 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 11 Feb 2021 11:34:32 +0200 Subject: [PATCH 279/421] add done button in all pages user keyboard and hide the keyboard when the user click on background --- ios/Podfile.lock | 2 +- .../patients/patient_search_screen.dart | 697 ++++----- .../prescription/add_prescription_form.dart | 1135 +++++++------- .../update_prescription_form.dart | 905 +++++------ .../reschedule-leaves/reschedule_leave.dart | 1329 +++++++++-------- lib/screens/sick-leave/sick_leave.dart | 575 +++---- lib/util/helpers.dart | 5 + lib/widgets/shared/TextFields.dart | 2 +- lib/widgets/shared/app_text_form_field.dart | 10 +- pubspec.lock | 6 +- 10 files changed, 2359 insertions(+), 2307 deletions(-) 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/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 0b13bd2d..994048a7 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -46,6 +46,10 @@ class _PatientSearchScreenState extends State { bool isFormSubmitted = false; + FocusNode _nodeText1 = FocusNode(); + FocusNode _nodeText2 = FocusNode(); + FocusNode _nodeText3 = FocusNode(); + var _patientSearchFormValues = PatientModel( FirstName: "0", MiddleName: "0", @@ -110,374 +114,383 @@ class _PatientSearchScreenState extends State { @override Widget build(BuildContext context) { projectsProvider = Provider.of(context); - return AppScaffold( - appBarTitle: TranslationBase.of(context).searchPatient, - 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, + return GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + appBarTitle: TranslationBase.of(context).searchPatient, + 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: 5.0), - child: AppText( - TranslationBase.of(context) - .searchPatientImageCaptionBody, - fontSize: SizeConfig.heightMultiplier * 2, + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: AppText( + TranslationBase.of(context) + .searchPatientImageCaptionTitle + .toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.heightMultiplier * 2.5, + ), ), - ) - ], - ), - Container( - padding: EdgeInsets.all(15), - width: SizeConfig.screenWidth * 1, - child: Form( - key: _formKey, - autovalidate: _autoValidate, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 5, + Padding( + padding: const EdgeInsets.only(top: 5.0), + child: AppText( + TranslationBase.of(context) + .searchPatientImageCaptionBody, + fontSize: SizeConfig.heightMultiplier * 2, ), - 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)), - ), + ) + ], + ), + Container( + padding: EdgeInsets.all(15), + width: SizeConfig.screenWidth * 1, + child: Form( + key: _formKey, + autovalidate: _autoValidate, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 5, ), - 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, - ), - ], + 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(); - }, - 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(), - )), - ), - ], + }).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.only(top: 5), - child: AppTextFormField( - labelText: - TranslationBase.of(context).firstName, - borderColor: Colors.white, - onSaved: (value) { - value == null || value == '' - ? _patientSearchFormValues.setFirstName = - "0" - : _patientSearchFormValues.setFirstName = - value; + 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).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( + 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, + ), + 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, + TranslationBase.of(context).phoneNumber, borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues.setLastName = - "0" - : _patientSearchFormValues.setLastName = - value; + ? _patientSearchFormValues + .setPatientMobileNumber = "0" + : _patientSearchFormValues + .setPatientMobileNumber = value; + if (value != null && value .toString() .trim() .isEmpty) { - _patientSearchFormValues.setLastName = "0"; + _patientSearchFormValues + .setPatientMobileNumber = "0"; } }, - 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).phoneNumber, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - 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( + 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), + child: AppTextFormField( labelText: - TranslationBase.of(context).patientID, + TranslationBase.of(context).patientFile, borderColor: Colors.white, textInputType: TextInputType.number, + focusNode: _nodeText3, inputFormatter: ONLY_NUMBERS, - 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), - child: AppTextFormField( - labelText: - TranslationBase.of(context).patientFile, - borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - onSaved: (value) {}, + 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, - ), - ], + (!(_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, + ), + ], + ), ), - ), - ) - ], + ) + ], + ), ), - ), - Container( - margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context).search, - onPressed: () { - _validateInputs(); - }, - ), - ], + 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/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0b9750fc..0f681c4d 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -209,368 +209,334 @@ class _PrescriptionFormWidgetState extends State { ) => NetworkBaseView( baseViewModel: model, - child: DraggableScrollableSheet( - initialChildSize: 0.90, - maxChildSize: 0.90, - minChildSize: 0.9, - builder: (BuildContext context, ScrollController scrollController) { - return SingleChildScrollView( - child: Container( - height: 1010, - child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - //mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Form( - key: formKey, - child: Column( - //mainAxisAlignment: MainAxisAlignment.end, - 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, - ), - itemSubmitted: (item) => setState( - () => - _selectedMedication = item), - key: key, - suggestions: - model.allMedicationList, - itemBuilder: (context, - suggestion) => - new Padding( - child: Texts(suggestion + child: GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: DraggableScrollableSheet( + initialChildSize: 0.90, + maxChildSize: 0.90, + minChildSize: 0.9, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: 1010, + child: Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + //mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + AppText( + TranslationBase.of(context).medicines.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: spaceBetweenTextFileds, + ), + Container( + child: Form( + key: formKey, + child: Column( + //mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + Helpers.hideKeyboard(context); + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .genericName + : null, + true, + ), + 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( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication .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( - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication - .description + - ('${_selectedMedication.genericName}') - : null, - true, + ('${_selectedMedication.genericName}') + : null, + true, + ), + enabled: false, ), - enabled: false, - ), + ), ), - ), - SizedBox( - height: spaceBetweenTextFileds, - ), - Container( - child: Row( - children: [ - AppText('Order Type'), - Radio( - activeColor: Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('Regular'), - ], + SizedBox( + height: spaceBetweenTextFileds, ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - width: double.infinity, - child: Row( - children: [ - Container( - width: - MediaQuery.of(context).size.width * - 0.550, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter(4), - WhitelistingTextInputFormatter - .digitsOnly - ], - hintText: TranslationBase.of(context) - .strength, - controller: strengthController, - keyboardType: TextInputType.number, - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 4) { - DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); - } + Container( + child: Row( + children: [ + AppText('Order Type'), + Radio( + activeColor: Color(0xFFB9382C), + value: 1, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: - MediaQuery.of(context).size.width * - 0.350, - child: InkWell( - onTap: model.medicationStrengthList != - null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units['nameEn'] - : null, - true), - enabled: false, + Text('Regular'), + ], + ), + ), + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + width: double.infinity, + child: Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * + 0.550, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter(4), + WhitelistingTextInputFormatter + .digitsOnly + ], + hintText: TranslationBase.of(context) + .strength, + controller: strengthController, + keyboardType: TextInputType.number, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, ), ), - ), - ], - ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.medicationRouteList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - helpers.showErrorToast( - 'plase fill'); - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).route, - route != null - ? route['nameEn'] - : null, - true), - enabled: false, + SizedBox( + width: 10.0, + ), + Container( + width: + MediaQuery.of(context).size.width * + 0.350, + child: InkWell( + onTap: model.medicationStrengthList != + null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['nameEn'] + : null, + true), + enabled: false, + ), + ), + ), + ], ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.medicationFrequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequency = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, - frequency != null - ? frequency['nameEn'] - : null, - true), - enabled: false, + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.medicationRouteList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.medicationRouteList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + helpers.showErrorToast( + 'plase fill'); + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).route, + route != null + ? route['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.medicationDoseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), - enabled: false, + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.medicationFrequencyList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationFrequencyList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequency = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequency != null + ? frequency['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - - if (model.patientAssessmentList.isNotEmpty) + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, child: InkWell( - onTap: indicationList != null + onTap: model.medicationDoseTimeList != null ? () { - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: indicationList, - attributeName: 'name', + list: + model.medicationDoseTimeList, + attributeName: 'nameEn', attributeValueId: 'id', okText: TranslationBase.of(context) .ok, okFunction: (selectedValue) { setState(() { - indication = selectedValue; + doseTime = selectedValue; }); }, ); showDialog( barrierDismissible: false, context: context, - builder: - (BuildContext context) { + builder: (BuildContext context) { return dialog; }, ); @@ -578,262 +544,309 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0] - .icdCode10ID - .toString(), - indication != null - ? indication['name'] + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['nameEn'] : null, true), - enabled: true, - readOnly: true, + enabled: false, ), ), ), - //model.patientAssessmentList.forEach((element) { }). - // Column( - // children: model.patientAssessmentList - // .map((element) { - // return Container( - // height: screenSize.height * 0.070, - // child: InkWell( - // onTap: indicationList != null - // ? () { - // ListSelectDialog dialog = - // ListSelectDialog( - // list: indicationList, - // attributeName: 'name', - // attributeValueId: 'id', - // okText: TranslationBase.of( - // context) - // .ok, - // okFunction: (selectedValue) { - // setState(() { - // indication = - // selectedValue; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: - // (BuildContext context) { - // return dialog; - // }, - // ); - // } - // : null, - // child: TextField( - // decoration: - // textFieldSelectorDecoration( - // element.icdCode10ID - // .toString(), - // indication != null - // ? indication['name'] - // : null, - // true), - // enabled: true, - // readOnly: true, - // ), - // ), - // ); - // }).toList(), - // ), + SizedBox(height: spaceBetweenTextFileds), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).date, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + if (model.patientAssessmentList.isNotEmpty) + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: indicationList, + attributeName: 'name', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + indication = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + model.patientAssessmentList[0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, + true), + enabled: true, + readOnly: true, + ), + ), + ), + //model.patientAssessmentList.forEach((element) { }). + // Column( + // children: model.patientAssessmentList + // .map((element) { + // return Container( + // height: screenSize.height * 0.070, + // child: InkWell( + // onTap: indicationList != null + // ? () { + // ListSelectDialog dialog = + // ListSelectDialog( + // list: indicationList, + // attributeName: 'name', + // attributeValueId: 'id', + // okText: TranslationBase.of( + // context) + // .ok, + // okFunction: (selectedValue) { + // setState(() { + // indication = + // selectedValue; + // }); + // }, + // ); + // showDialog( + // barrierDismissible: false, + // context: context, + // builder: + // (BuildContext context) { + // return dialog; + // }, + // ); + // } + // : null, + // child: TextField( + // decoration: + // textFieldSelectorDecoration( + // element.icdCode10ID + // .toString(), + // indication != null + // ? indication['name'] + // : null, + // true), + // enabled: true, + // readOnly: true, + // ), + // ), + // ); + // }).toList(), + // ), + + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: model.medicationDurationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - duration = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration, - duration != null - ? duration['nameEn'] - : null, - true), - enabled: false, + SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.medicationDurationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + duration != null + ? duration['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - maxLines: 6, - minLines: 4, - hintText: - TranslationBase.of(context).instruction, - controller: instructionController, - //keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, + SizedBox(height: spaceBetweenTextFileds), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + maxLines: 6, + minLines: 4, + hintText: + TranslationBase.of(context).instruction, + controller: instructionController, + //keyboardType: TextInputType.number, + validator: (value) { + if (value.isEmpty) + return TranslationBase.of(context) + .emptyMessage; + else + return null; + }, + ), ), - ), - SizedBox(height: spaceBetweenTextFileds), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: TranslationBase.of(context) - .addMedication, - onPressed: () { - // formKey.currentState.save(); - // Navigator.pop(context); - // openDrugToDrug(); - if (route == null || - frequency == null || - doseTime == null || - duration == null || - selectedDate == null || - units == null) { - DrAppToastMsg.showErrorToast( - "Please Fill All Fields"); - return; - } + SizedBox(height: spaceBetweenTextFileds), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addMedication, + onPressed: () { + // formKey.currentState.save(); + // Navigator.pop(context); + // openDrugToDrug(); + if (route == null || + frequency == null || + doseTime == null || + duration == null || + selectedDate == null || + units == null) { + DrAppToastMsg.showErrorToast( + "Please Fill All Fields"); + return; + } - if (formKey.currentState.validate()) { - Navigator.pop(context); - { - // var x = model - // .patientAssessmentList - // .map((value) => - // value.icdCode10ID) - // .toList() - // .join(','); - postProcedure( - icdCode: model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty - ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - // icdCode: model + if (formKey.currentState.validate()) { + Navigator.pop(context); + { + // var x = model // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) + // .map((value) => + // value.icdCode10ID) // .toList() - // .join(' '), - dose: strengthController.text, - doseUnit: - units['id'].toString(), - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: - frequency['id'].toString(), - route: route['id'].toString(), - drugId: _selectedMedication - .itemId - .toString(), - strength: - strengthController.text, - indication: - indicationController.text, - instruction: - instructionController.text, - doseTime: selectedDate, - ); + // .join(','); + postProcedure( + icdCode: model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty + ? "test" + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + // icdCode: model + // .patientAssessmentList + // .map((value) => value + // .icdCode10ID + // .trim()) + // .toList() + // .join(' '), + dose: strengthController.text, + doseUnit: + units['id'].toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: + frequency['id'].toString(), + route: route['id'].toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController.text, + doseTime: selectedDate, + ); + } } - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], + ), ), - ), - ], + ], + ), ), ), - ), - ], + ], + ), ), ), - ), - ); - }), + ); + }), + ), ), ); } selectDate(BuildContext context, PrescriptionViewModel model) async { + Helpers.hideKeyboard(context); DateTime selectedDate; selectedDate = DateTime.now(); final DateTime picked = await showDatePicker( diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 885386a6..0f48f5c1 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.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/TextFields.dart'; @@ -103,469 +104,479 @@ class _UpdatePrescriptionFormState extends State { (BuildContext context, MedicineViewModel model, Widget child) => NetworkBaseView( baseViewModel: model, - child: DraggableScrollableSheet( - initialChildSize: 0.95, - maxChildSize: 0.99, - minChildSize: 0.6, - builder: - (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 1.3, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( - children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // setState(() { - // newSelectedMedication = null; - // }); - // } - // : null, - // child: newSelectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // decoration: - // textFieldSelectorDecoration( - // widget.drugNameGeneric, - // newSelectedMedication != null - // ? newSelectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => newSelectedMedication = - // 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( - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // newSelectedMedication != null - // ? newSelectedMedication - // .description + - // ('${newSelectedMedication.genericName}') - // : null, - // true, - // ), - // enabled: false, - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - Container( - height: MediaQuery.of(context).size.height * - 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: - MediaQuery.of(context).size.width * - 0.4900, - height: - MediaQuery.of(context).size.height * - 0.55, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter(4), - WhitelistingTextInputFormatter - .digitsOnly - ], - hintText: widget.doseStreangth, - fontSize: 15.0, - controller: strengthController, - keyboardType: TextInputType.number, - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 4) { - DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, + child: GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: DraggableScrollableSheet( + initialChildSize: 0.95, + maxChildSize: 0.99, + minChildSize: 0.6, + builder: + (BuildContext context, ScrollController scrollController) { + return Container( + height: MediaQuery.of(context).size.height * 1.3, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.drugName.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 10.0, + ), + Column( + children: [ + // Container( + // height: MediaQuery.of(context).size.height * + // 0.070, + // child: InkWell( + // onTap: model.allMedicationList != null + // ? () { + // setState(() { + // newSelectedMedication = null; + // }); + // } + // : null, + // child: newSelectedMedication == null + // ? AutoCompleteTextField< + // GetMedicationResponseModel>( + // decoration: + // textFieldSelectorDecoration( + // widget.drugNameGeneric, + // newSelectedMedication != null + // ? newSelectedMedication + // .genericName + // : null, + // true, + // ), + // itemSubmitted: (item) => setState( + // () => newSelectedMedication = + // 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( + // decoration: + // textFieldSelectorDecoration( + // TranslationBase.of(context) + // .searchMedicineNameHere, + // newSelectedMedication != null + // ? newSelectedMedication + // .description + + // ('${newSelectedMedication.genericName}') + // : null, + // true, + // ), + // enabled: false, + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + Container( + height: MediaQuery.of(context).size.height * + 0.060, + width: double.infinity, + child: Row( + children: [ + Container( + width: + MediaQuery.of(context).size.width * + 0.4900, + height: + MediaQuery.of(context).size.height * + 0.55, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter(4), + WhitelistingTextInputFormatter + .digitsOnly + ], + hintText: widget.doseStreangth, + fontSize: 15.0, + controller: strengthController, + keyboardType: TextInputType.number, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: - MediaQuery.of(context).size.width * - 0.3700, - child: InkWell( - onTap: model.medicationStrengthList != - null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units['nameEn'] - : null, - true), - enabled: false, + SizedBox( + width: 10.0, + ), + Container( + width: + MediaQuery.of(context).size.width * + 0.3700, + child: InkWell( + onTap: model.medicationStrengthList != + null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['nameEn'] + : null, + true), + enabled: false, + ), ), ), + ], + ), + ), + SizedBox( + height: 12, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationRouteList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.medicationRouteList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + 'Route', + route != null + ? route['nameEn'] + : null, + true), + enabled: false, ), - ], + ), + ), + SizedBox( + height: 12.0, ), - ), - SizedBox( - height: 12, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationRouteList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'Route', - route != null - ? route['nameEn'] - : null, - true), - enabled: false, + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDoseTimeList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).doseTime, + doseTime != null + ? doseTime['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDoseTimeList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationFrequencyList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationFrequencyList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).frequency, + frequencyUpdate != null + ? frequencyUpdate['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationFrequencyList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, - frequencyUpdate != null - ? frequencyUpdate['nameEn'] - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + height: MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDurationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).duration, + updatedDuration != null + ? updatedDuration['nameEn'] + .toString() + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDurationList != null - ? () { - ListSelectDialog dialog = - ListSelectDialog( - list: - model.medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration, - updatedDuration != null - ? updatedDuration['nameEn'] - .toString() - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + hintText: widget.remarks, + controller: remarksController, + maxLines: 7, + minLines: 4, ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, + SizedBox( + height: 12.0, ), - ), - SizedBox( - height: 12.0, - ), - SizedBox( - height: - MediaQuery.of(context).size.height * 0.12, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: - 'update prescription'.toUpperCase(), - onPressed: () { - updatePrescription( - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController.text - : widget.doseStreangth, - newUnit: units != - null - ? units['id'].toString() - : widget.doseUnit, - doseUnit: widget.doseUnit, - doseStreangth: widget - .doseStreangth, - duration: widget.duration, - startDate: widget.startDate, - doseId: widget.dose, - frequencyId: widget.frequency, - routeId: widget.route, - patient: widget.patient, - model: widget.model, - newDuration: - updatedDuration != - null - ? updatedDuration[ - 'id'] - .toString() - : widget.duration, - drugId: widget.drugId, - remarks: remarksController.text, - route: route != - null - ? route['id'].toString() - : widget.route, - frequency: - frequencyUpdate != - null - ? frequencyUpdate['id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'].toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); - Navigator.pop(context); - }, - ), - ], + SizedBox( + height: + MediaQuery.of(context).size.height * 0.12, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: + 'update prescription'.toUpperCase(), + onPressed: () { + updatePrescription( + newDoseStreangth: + strengthController + .text.isNotEmpty + ? strengthController.text + : widget.doseStreangth, + newUnit: units != + null + ? units['id'].toString() + : widget.doseUnit, + doseUnit: widget.doseUnit, + doseStreangth: widget + .doseStreangth, + duration: widget.duration, + startDate: widget.startDate, + doseId: widget.dose, + frequencyId: widget.frequency, + routeId: widget.route, + patient: widget.patient, + model: widget.model, + newDuration: + updatedDuration != + null + ? updatedDuration[ + 'id'] + .toString() + : widget.duration, + drugId: widget.drugId, + remarks: remarksController.text, + route: route != + null + ? route['id'].toString() + : widget.route, + frequency: + frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, + dose: doseTime != null + ? doseTime['id'].toString() + : widget.dose, + enteredRemarks: + widget.enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - )); - }), + )); + }), + ), ), ); }); diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index d5daf67c..7b034431 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -113,360 +113,242 @@ class _RescheduleLeaveScreen extends State { model2.getReasons(18), model2.getCoveringDoctors() }, - builder: (_, model2, w) => AppScaffold( - baseViewModel: model2, - isShowAppBar: false, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - Container( + builder: (_, model2, w) => GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: false, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + dropdownColor: + Colors.grey, + value: getClinicName( + model) ?? + "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .grey[500], + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), + ); + }).toList(), + ))), + ), + ], + ) + ], + ), + )), + + Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: Colors.grey, + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + new IgnorePointer( + ignoring: true, + child: AppTextFormField( + readOnly: true, + hintText: profile != null + ? profile['DoctorName'] + : "", + borderColor: Colors.white, + onSaved: (value) {}, + inputFormatter: ONLY_NUMBERS)) + ], + ), + ), + + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allOffTime.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + // focusColor: Colors.grey, isExpanded: true, - dropdownColor: - Colors.grey, - value: getClinicName( - model) ?? - "", - iconSize: 0, + value: offTime == null + ? model2.allOffTime[0] + ['code'] + : offTime, + iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() + (BuildContext context) { + return model2.allOffTime .map((item) { return Row( mainAxisSize: - MainAxisSize - .max, + MainAxisSize.max, children: [ AppText( - item, + item[ + 'description'], fontSize: SizeConfig .textMultiplier * 2.1, - color: Colors - .grey[500], + // color: + // Colors.grey, ), ], ); }).toList(); }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() + onChanged: (newValue) => { + setState(() { + offTime = newValue; + }), + if (offTime == '1') + {model2.getReasons(18)} + else if (offTime == '2') + {model2.getReasons(19)} + else if (offTime == '3' || + offTime == '5') + {model2.getReasons(102)} + }, + items: model2.allOffTime .map((item) { - return DropdownMenuItem( - value: - item.toString(), + return DropdownMenuItem< + String>( + value: item['code'] + .toString(), child: Text( - item, + item['description'], textAlign: TextAlign.end, ), ); }).toList(), - ))), - ), - ], - ) - ], - ), - )), - - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - new IgnorePointer( - ignoring: true, - child: AppTextFormField( - readOnly: true, - hintText: profile != null - ? profile['DoctorName'] - : "", - borderColor: Colors.white, - onSaved: (value) {}, - inputFormatter: ONLY_NUMBERS)) - ], - ), - ), - - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allOffTime.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: DropdownButton( - // focusColor: Colors.grey, - isExpanded: true, - value: offTime == null - ? model2.allOffTime[0] - ['code'] - : offTime, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model2.allOffTime - .map((item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - AppText( - item[ - 'description'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => { - setState(() { - offTime = newValue; - }), - if (offTime == '1') - {model2.getReasons(18)} - else if (offTime == '2') - {model2.getReasons(19)} - else if (offTime == '3' || - offTime == '5') - {model2.getReasons(102)} - }, - items: model2.allOffTime - .map((item) { - return DropdownMenuItem< - String>( - value: item['code'] - .toString(), - child: Text( - item['description'], - textAlign: - TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - offTime == '1' - ? Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: - TranslationBase.of(context) - .fromDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons.calendar_today)), - textInputType: - TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker( - 'fromDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (val) => - fromDate = val, - onSaved: (val) => - fromDate = val, - ) - ], - )), - Row( - children: [ - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .fromTime, - type: - DateTimePickerType.time, - controller: _controller4, - onChanged: (val) => - fromTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => - fromTime = val, + )), ) - ], - ), - ), - ), - Expanded( - child: Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: - HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - DateTimePicker( - timeHintText: - TranslationBase.of( - context) - .toTime, - type: - DateTimePickerType.time, - controller: _controller5, - onChanged: (val) => - toTime = val, - validator: (val) { - print(val); - // setState( - // () => _valueToValidate4 = val); - return null; - }, - onSaved: (val) => - toTime = val, - ) - ], - ), - ), - ) - ], - ) - ], - ) - : Column( - children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + : SizedBox(), + ], + ) + ], + ), + )), + offTime == '1' + ? Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: + TranslationBase.of(context) + .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon(Icons - .calendar_today)), + icon: Icon( + Icons.calendar_today)), textInputType: TextInputType.number, controller: _toDateController, @@ -475,364 +357,487 @@ class _RescheduleLeaveScreen extends State { 'fromDate'); }, inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppTextFormField( - hintText: TranslationBase - .of(context) - .toDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon( - Icons - .calendar_today)), - textInputType: - TextInputType.number, - controller: - _toDateController2, - onTap: () { - _presentDatePicker( - 'toDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - setState(() { - toDate = value; - }); - }), - ], - )) - ], - ), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.allReasons.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - value: reason == null - ? model2.allReasons[0] - ['id'] - .toString() - : reason, - iconSize: 40, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return model2.allReasons - .map((item) { - return Row( - mainAxisSize: - MainAxisSize.max, - children: [ - AppText( - projectsProvider - .isArabic - ? item[ - 'nameAr'] - : item[ - 'nameEn'], - fontSize: SizeConfig - .textMultiplier * - 2.1, - // color: - // Colors.grey, - ), - ], - ); - }).toList(); + onChanged: (val) => + fromDate = val, + onSaved: (val) => + fromDate = val, + ) + ], + )), + Row( + children: [ + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .fromTime, + type: + DateTimePickerType.time, + controller: _controller4, + onChanged: (val) => + fromTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => + fromTime = val, + ) + ], + ), + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: + HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + DateTimePicker( + timeHintText: + TranslationBase.of( + context) + .toTime, + type: + DateTimePickerType.time, + controller: _controller5, + onChanged: (val) => + toTime = val, + validator: (val) { + print(val); + // setState( + // () => _valueToValidate4 = val); + return null; + }, + onSaved: (val) => + toTime = val, + ) + ], + ), + ), + ) + ], + ) + ], + ) + : Column( + children: [ + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase.of( + context) + .fromDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker( + 'fromDate'); }, - onChanged: (newValue) => { + inputFormatter: ONLY_DATE, + onChanged: (value) { setState(() { - reason = newValue; - }) + toDate = value; + }); + }), + ], + )), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppTextFormField( + hintText: TranslationBase + .of(context) + .toDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon( + Icons + .calendar_today)), + textInputType: + TextInputType.number, + controller: + _toDateController2, + onTap: () { + _presentDatePicker( + 'toDate'); }, - items: model2.allReasons - .map((item) { - return DropdownMenuItem< - String>( - value: item['id'] - .toString(), - child: Text( - projectsProvider - .isArabic - ? item['nameAr'] - : item['nameEn'], - textAlign: - TextAlign.end, - ), - ); - }).toList(), - )), - ) - : SizedBox(), - ], - ) - ], - ), - )), + inputFormatter: ONLY_DATE, + onChanged: (value) { + setState(() { + toDate = value; + }); + }), + ], + )) + ], + ), + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.allReasons.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: + DropdownButtonHideUnderline( + child: DropdownButton( + focusColor: Colors.grey, + isExpanded: true, + value: reason == null + ? model2.allReasons[0] + ['id'] + .toString() + : reason, + iconSize: 40, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return model2.allReasons + .map((item) { + return Row( + mainAxisSize: + MainAxisSize.max, + children: [ + AppText( + projectsProvider + .isArabic + ? item[ + 'nameAr'] + : item[ + 'nameEn'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + // color: + // Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => { + setState(() { + reason = newValue; + }) + }, + items: model2.allReasons + .map((item) { + return DropdownMenuItem< + String>( + value: item['id'] + .toString(), + child: Text( + projectsProvider + .isArabic + ? item['nameAr'] + : item['nameEn'], + textAlign: + TextAlign.end, + ), + ); + }).toList(), + )), + ) + : SizedBox(), + ], + ) + ], + ), + )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - model2.coveringDoctors.length > 0 - ? Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownSearch( - mode: Mode.BOTTOM_SHEET, + Container( + margin: EdgeInsets.all(8), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + mainAxisSize: MainAxisSize.max, + children: [ + model2.coveringDoctors.length > 0 + ? Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownSearch( + mode: Mode.BOTTOM_SHEET, - dropdownSearchDecoration: - InputDecoration( - contentPadding: - EdgeInsets.all( - 0), - border: InputBorder - .none), - //maxHeight: 300, - items: model2 - .coveringDoctors - .map((item) { - return projectsProvider - .isArabic - ? item['doctorNameN'] - : item['doctorName']; - }).toList(), - // label: "Doctor List", - onChanged: (item) { - model2.coveringDoctors - .forEach((newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal[ - 'DoctorID'] - } - }); - }, - selectedItem: - getSelectedDoctor( - model2), - showSearchBox: true, - searchBoxDecoration: - InputDecoration( - border: - OutlineInputBorder(), - contentPadding: - EdgeInsets.fromLTRB( - 12, 12, 8, 0), - labelText: - "Search Doctor", - ), - popupTitle: Container( - height: 50, - decoration: BoxDecoration( - color: Theme.of(context) - .primaryColorDark, + dropdownSearchDecoration: + InputDecoration( + contentPadding: + EdgeInsets.all( + 0), + border: InputBorder + .none), + //maxHeight: 300, + items: model2 + .coveringDoctors + .map((item) { + return projectsProvider + .isArabic + ? item['doctorNameN'] + : item['doctorName']; + }).toList(), + // label: "Doctor List", + onChanged: (item) { + model2.coveringDoctors + .forEach((newVal) => { + if (newVal['doctorName'] == + item || + newVal['doctorName'] == + item) + { + doctorID = + newVal[ + 'DoctorID'] + } + }); + }, + selectedItem: + getSelectedDoctor( + model2), + showSearchBox: true, + searchBoxDecoration: + InputDecoration( + border: + OutlineInputBorder(), + contentPadding: + EdgeInsets.fromLTRB( + 12, 12, 8, 0), + labelText: + "Search Doctor", + ), + popupTitle: Container( + height: 50, + decoration: BoxDecoration( + color: Theme.of(context) + .primaryColorDark, + borderRadius: + BorderRadius.only( + topLeft: + Radius.circular( + 20), + topRight: + Radius.circular( + 20), + ), + ), + child: Center( + child: Text( + '', + style: TextStyle( + fontSize: 24, + fontWeight: + FontWeight.bold, + color: Colors.white, + ), + ), + ), + ), + popupShape: + RoundedRectangleBorder( borderRadius: BorderRadius.only( topLeft: - Radius.circular( - 20), + Radius.circular(24), topRight: - Radius.circular( - 20), - ), - ), - child: Center( - child: Text( - '', - style: TextStyle( - fontSize: 24, - fontWeight: - FontWeight.bold, - color: Colors.white, - ), + Radius.circular(24), ), ), ), - popupShape: - RoundedRectangleBorder( - borderRadius: - BorderRadius.only( - topLeft: - Radius.circular(24), - topRight: - Radius.circular(24), - ), - ), - ), - // DropdownButtonHideUnderline( - // child: DropdownButton( - // focusColor: Colors.grey, - // isExpanded: true, - // value: doctorID == null - // ? model2 - // .coveringDoctors[0] - // ['doctorID'] - // .toString() - // : doctorID, - // iconSize: 40, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return model2 - // .coveringDoctors - // .map((item) { - // return Row( - // mainAxisSize: - // MainAxisSize.max, - // children: [ - // AppText( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // fontSize: SizeConfig - // .textMultiplier * - // 2.1, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) => { - // setState(() { - // doctorID = newValue; - // }) - // }, - // items: model2 - // .coveringDoctors - // .map((item) { - // return DropdownMenuItem< - // String>( - // value: item['doctorID'] - // .toString(), - // child: Text( - // projectsProvider - // .isArabic - // ? item[ - // 'doctorNameN'] - // : item[ - // 'doctorName'], - // textAlign: - // TextAlign.start, - // ), - // ); - // }).toList(), - // )), - ) - : SizedBox(), - ], - ) - ], - ), - )), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isUpdate == true - ? TranslationBase.of(context).update - : TranslationBase.of(context).add, - onPressed: () { - if (offTime == '1' || offTime == '2') { - if (widget.isUpdate == true) { - updateRecheduleLeave(model2); + // DropdownButtonHideUnderline( + // child: DropdownButton( + // focusColor: Colors.grey, + // isExpanded: true, + // value: doctorID == null + // ? model2 + // .coveringDoctors[0] + // ['doctorID'] + // .toString() + // : doctorID, + // iconSize: 40, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return model2 + // .coveringDoctors + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize.max, + // children: [ + // AppText( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // fontSize: SizeConfig + // .textMultiplier * + // 2.1, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) => { + // setState(() { + // doctorID = newValue; + // }) + // }, + // items: model2 + // .coveringDoctors + // .map((item) { + // return DropdownMenuItem< + // String>( + // value: item['doctorID'] + // .toString(), + // child: Text( + // projectsProvider + // .isArabic + // ? item[ + // 'doctorNameN'] + // : item[ + // 'doctorName'], + // textAlign: + // TextAlign.start, + // ), + // ); + // }).toList(), + // )), + ) + : SizedBox(), + ], + ) + ], + ), + )), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isUpdate == true + ? TranslationBase.of(context).update + : TranslationBase.of(context).add, + onPressed: () { + if (offTime == '1' || offTime == '2') { + if (widget.isUpdate == true) { + updateRecheduleLeave(model2); + } else { + addRecheduleLeave(model2); + } } else { - addRecheduleLeave(model2); + DrAppToastMsg.showErrorToast( + TranslationBase.of(context) + .onlyOfftimeHoliday); } - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context) - .onlyOfftimeHoliday); - } - }, - ), - ], + }, + ), + ], + ), ), - ), - // Column( - // children: [ - // Texts(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + // Column( + // children: [ + // Texts(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], + ), ), ), ), ), - ))); + ))); } getProfile() async { diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index b4ee3ace..103c133b 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -83,315 +83,320 @@ class _SickLeaveScreenState extends State { builder: (_, model, w) => BaseView( onModelReady: (model2) => model2.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN), - builder: (_, model2, w) => AppScaffold( - baseViewModel: model2, - isShowAppBar: false, - body: Center( - child: Container( - margin: EdgeInsets.only(top: 10), - child: FractionallySizedBox( - widthFactor: 0.9, - child: ListView( - children: [ - Padding( - child: AppText( - widget.isExtended == true - ? TranslationBase.of(context) - .extendSickLeave - : TranslationBase.of(context) - .addSickLeave, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10)), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppTextFormField( - borderColor: Colors.white, - onChanged: (value) { - addSickLeave.noOfDays = value; - if (widget.extendedData != null) { - widget.extendedData.noOfDays = - int.parse(value); - } - }, - hintText: widget.extendedData != null - ? widget.extendedData.noOfDays - .toString() - : TranslationBase.of(context) - .sickLeaveDays, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS) - ]), - ), - SizedBox( - height: 10, - ), - Container( + builder: (_, model2, w) => GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( + baseViewModel: model2, + isShowAppBar: false, + body: Center( + child: Container( + margin: EdgeInsets.only(top: 10), + child: FractionallySizedBox( + widthFactor: 0.9, + child: ListView( + children: [ + Padding( + child: AppText( + widget.isExtended == true + ? TranslationBase.of(context) + .extendSickLeave + : TranslationBase.of(context) + .addSickLeave, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10)), + Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).sickLeaveDate, - // fontSize: 10, - // ), - AppTextFormField( - hintText: widget.extendedData != null - ? widget.extendedData.startDate - : TranslationBase.of(context) - .sickLeaveDate, - borderColor: Colors.white, - prefix: IconButton( - icon: Icon(Icons.calendar_today)), - textInputType: TextInputType.number, - controller: _toDateController, - onTap: () { - _presentDatePicker('_selectedToDate'); - }, - inputFormatter: ONLY_DATE, - onChanged: (value) { - addSickLeave.startDate = value; - if (widget.extendedData != null) { - widget.extendedData.startDate = - value; - } - }), - ], - )), - Container( - margin: EdgeInsets.only( - top: 10, left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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), + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppTextFormField( + borderColor: Colors.white, + onChanged: (value) { + addSickLeave.noOfDays = value; + if (widget.extendedData != null) { + widget.extendedData.noOfDays = + int.parse(value); + } + }, + hintText: widget.extendedData != null + ? widget.extendedData.noOfDays + .toString() + : TranslationBase.of(context) + .sickLeaveDays, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS) + ]), + ), + SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ // AppText( - // TranslationBase.of(context).clinicName, + // TranslationBase.of(context).sickLeaveDate, // fontSize: 10, // ), - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model + AppTextFormField( + hintText: widget.extendedData != null + ? widget.extendedData.startDate + : TranslationBase.of(context) + .sickLeaveDate, + borderColor: Colors.white, + prefix: IconButton( + icon: Icon(Icons.calendar_today)), + textInputType: TextInputType.number, + controller: _toDateController, + onTap: () { + _presentDatePicker('_selectedToDate'); + }, + inputFormatter: ONLY_DATE, + onChanged: (value) { + addSickLeave.startDate = value; + if (widget.extendedData != null) { + widget.extendedData.startDate = + value; + } + }), + ], + )), + Container( + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + 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: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).clinicName, + // fontSize: 10, + // ), + Row( + mainAxisSize: MainAxisSize.max, + children: [ + Expanded( + // add Expanded to have your dropdown button fill remaining space + child: DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: + Colors.grey, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) => + {}, + items: model .getClinicNameList() .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: - Colors.grey, - ), - ], + return DropdownMenuItem( + value: + item.toString(), + child: Text( + item, + textAlign: + TextAlign.end, + ), ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), - ), - ], - ) - ], - ), - )), - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'] != - null - ? Padding( - child: AppText( - model2.sickLeaveStatistics[ - 'recommendedSickLeaveDays'], - fontWeight: FontWeight.bold, - textAlign: TextAlign.start, + }).toList(), + ))), + ), + ], + ) + ], ), - padding: EdgeInsets.all(10), - ) - : SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).doctorName, - // fontSize: 10, - // ), - new IgnorePointer( - ignoring: true, - child: AppTextFormField( - readOnly: true, - hintText: profile['DoctorName'], - borderColor: Colors.white, - onSaved: (value) {}, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_NUMBERS)) - ], + )), + model2.sickLeaveStatistics[ + 'recommendedSickLeaveDays'] != + null + ? Padding( + child: AppText( + model2.sickLeaveStatistics[ + 'recommendedSickLeaveDays'], + fontWeight: FontWeight.bold, + textAlign: TextAlign.start, + ), + padding: EdgeInsets.all(10), + ) + : SizedBox( + height: 10, + ), + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).doctorName, + // fontSize: 10, + // ), + new IgnorePointer( + ignoring: true, + child: AppTextFormField( + readOnly: true, + hintText: profile['DoctorName'], + borderColor: Colors.white, + onSaved: (value) {}, + // validator: (value) { + // return TextValidator().validateName(value); + // }, + inputFormatter: ONLY_NUMBERS)) + ], + ), + ), + SizedBox( + height: 10, ), - ), - SizedBox( - height: 10, - ), - Container( - margin: EdgeInsets.only(left: 10, right: 10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // AppText( - // TranslationBase.of(context).remarks, - // fontSize: 10, - // ), - TextField( - maxLines: 3, - decoration: InputDecoration( - contentPadding: EdgeInsets.all(20.0), - border: InputBorder.none, - hintText: widget.extendedData != null - ? widget.extendedData.remarks - : TranslationBase.of(context) - .remarks), - onChanged: (value) { - addSickLeave.remarks = value; - if (widget.extendedData != null) { - widget.extendedData.remarks = value; - } - }, - ) - ], + Container( + margin: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC"))), + padding: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // AppText( + // TranslationBase.of(context).remarks, + // fontSize: 10, + // ), + TextField( + maxLines: 3, + decoration: InputDecoration( + contentPadding: EdgeInsets.all(20.0), + border: InputBorder.none, + hintText: widget.extendedData != null + ? widget.extendedData.remarks + : TranslationBase.of(context) + .remarks), + onChanged: (value) { + addSickLeave.remarks = value; + if (widget.extendedData != null) { + widget.extendedData.remarks = value; + } + }, + ) + ], + ), ), - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 5), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: widget.isExtended == true - ? TranslationBase.of(context).extend - : TranslationBase.of(context).add, - onPressed: () async { - if (widget.isExtended) { - await model2.extendSickLeave( - widget.extendedData); + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: widget.isExtended == true + ? TranslationBase.of(context).extend + : TranslationBase.of(context).add, + onPressed: () async { + if (widget.isExtended) { + await model2.extendSickLeave( + widget.extendedData); - DrAppToastMsg.showSuccesToast( - model2.sickleaveResponse[ - 'ListSickLeavesToExtent'] - ['success']); - Navigator.of(context).popUntil((route) { - return route.settings.name == - PATIENTS_PROFILE; - }); - Navigator.of(context).pushNamed( - ADD_SICKLEAVE, - arguments: { - 'patient': widget.patient - }); - //print(value); - //}); - } else { - _validateInputs(model2); - } - }, - ), - ], + DrAppToastMsg.showSuccesToast( + model2.sickleaveResponse[ + 'ListSickLeavesToExtent'] + ['success']); + Navigator.of(context).popUntil((route) { + return route.settings.name == + PATIENTS_PROFILE; + }); + Navigator.of(context).pushNamed( + ADD_SICKLEAVE, + arguments: { + 'patient': widget.patient + }); + //print(value); + //}); + } else { + _validateInputs(model2); + } + }, + ), + ], + ), ), - ), - // Column( - // children: [ - // Texts(TranslationBase.of(context) - // .previousSickLeaveIssue + - // ' ') - // ], - // ) - ], + // Column( + // children: [ + // Texts(TranslationBase.of(context) + // .previousSickLeaveIssue + + // ' ') + // ], + // ) + ], + ), ), ), ), ), - ))); + ))); } void _validateInputs(model2) async { diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 07709fc9..9ae35747 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -408,4 +408,9 @@ class Helpers { )), ); } + + /// hides the keyboard if its already open + static hideKeyboard(BuildContext context) { + FocusScope.of(context).unfocus(); + } } diff --git a/lib/widgets/shared/TextFields.dart b/lib/widgets/shared/TextFields.dart index 4972d854..706c65b7 100644 --- a/lib/widgets/shared/TextFields.dart +++ b/lib/widgets/shared/TextFields.dart @@ -54,7 +54,7 @@ class TextFields extends StatefulWidget { this.focus = false, this.maxLengthEnforced = true, this.suffixIconColor, - this.inputAction, + this.inputAction = TextInputAction.done, this.onSubmit, this.keepPadding = true, this.textCapitalization = TextCapitalization.none, diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 82a273bb..8fed3cd8 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -17,7 +17,7 @@ class AppTextFormField extends FormField { TextInputType textInputType, String hintText, FocusNode focusNode, - TextInputAction textInputAction, + TextInputAction textInputAction=TextInputAction.done, ValueChanged onFieldSubmitted, IconButton prefix, String labelText, @@ -38,10 +38,10 @@ class AppTextFormField extends FormField { focusNode: focusNode, keyboardType: textInputType, readOnly: readOnly, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(inputFormatter)), - ], + // inputFormatters: [ + // FilteringTextInputFormatter.allow( + // RegExp(inputFormatter)), + // ], onChanged: onChanged ?? (value) { state.didChange(value); diff --git a/pubspec.lock b/pubspec.lock index addef845..94f07eea 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -559,7 +559,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: @@ -830,7 +830,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: @@ -965,5 +965,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 0dc25a4a034b95671ba040f8ca4b3094924c2497 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 11 Feb 2021 12:38:27 +0300 Subject: [PATCH 280/421] bug fixes --- lib/screens/prescription/prescription_screen.dart | 10 ++++++---- lib/screens/sick-leave/add-sickleave.dart | 10 ++++++++-- lib/util/helpers.dart | 2 +- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 11541e39..e0223d41 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -379,10 +379,12 @@ class _NewPrescriptionScreenState extends State { ), Expanded( child: AppText( - model.prescriptionList[0].entityList[index].pharmacistRemarks == null - ? "" - : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: 15.0), + "", // commening below code because there is an error coming in the model please fix it before pushing it + // model.prescriptionList[0].entityList[index].pharmacistRemarks == null + // ? "" + // : model.prescriptionList[0].entityList[index].pharmacistRemarks, + fontSize: + 15.0), ) ], ), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 93353d85..81d62513 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -116,11 +116,17 @@ class AddSickLeavScreen extends StatelessWidget { icon: Icon( Icons.open_in_full, size: 25, + color: item.status == 1 + ? Colors.grey[400] + : Colors.black, ), // color: Colors.green, //Colors.black, onPressed: () => { - openSickLeave(context, true, - extendedData: item) + if (item.status != 1) + { + openSickLeave(context, true, + extendedData: item) + } }, )) : SizedBox(), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 07709fc9..45134699 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -109,7 +109,7 @@ class Helpers { itemExtent: 25, //height of each item - looping: true, + looping: false, onSelectedItemChanged: (int index) { // selectitem =index; cupertinoPickerIndex = index; From 62d45d4e1c3a77e70e2c9d0c40155dbee2134cd0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 11 Feb 2021 14:02:15 +0200 Subject: [PATCH 281/421] hide the keyboard when the user click on background --- lib/widgets/shared/app_scaffold_widget.dart | 97 +++++++++++---------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index d60edb9f..e337b72d 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -29,53 +29,58 @@ class AppScaffold extends StatelessWidget { Widget build(BuildContext context) { AppGlobal.CONTEX = context; ProjectViewModel projectProvider = Provider.of(context); - return Scaffold( - backgroundColor: Colors.white, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: Text(appBarTitle.toUpperCase()), - leading: Builder(builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pop(context), - ); - }), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), - ), - ], - ) - : null, - body: projectProvider.isInternetConnection - ? baseViewModel != null - ? NetworkBaseView( - baseViewModel: baseViewModel, - child: body, - ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) - : Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - "assets/images/undraw_connected_world_wuay.png", - height: 250, - ), - AppText('No Internet Connection') - ], + return GestureDetector( + onTap: (){ + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: Scaffold( + backgroundColor: Colors.white, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: HexColor('#515B5D'), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), + title: Text(appBarTitle.toUpperCase()), + leading: Builder(builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pop(context), + ); + }), + centerTitle: true, + actions: [ + IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ), + ], + ) + : null, + body: projectProvider.isInternetConnection + ? baseViewModel != null + ? NetworkBaseView( + baseViewModel: baseViewModel, + child: body, + ) + : Stack( + children: [body, buildAppLoaderWidget(isLoading)]) + : Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + "assets/images/undraw_connected_world_wuay.png", + height: 250, + ), + AppText('No Internet Connection') + ], + ), ), - ), + ), ); } From cd94b835b54e74bc200dd3de260e29e8a26ee28a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 11 Feb 2021 17:32:30 +0200 Subject: [PATCH 282/421] bug fixing --- lib/screens/medical-file/medical_file_details.dart | 4 ++-- lib/screens/prescription/add_prescription_form.dart | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index a148610b..431342eb 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -589,7 +589,7 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model @@ -763,7 +763,7 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0b9750fc..1a6c6e26 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -752,6 +752,13 @@ class _PrescriptionFormWidgetState extends State { "Please Fill All Fields"); return; } + if (int.parse( + strengthController.text) > + 1000) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); + return; + } if (formKey.currentState.validate()) { Navigator.pop(context); From 8bf578082b17cf8915796b9b51653a97807a4916 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 11 Feb 2021 17:46:42 +0200 Subject: [PATCH 283/421] bug fixing --- .../prescription/add_prescription_form.dart | 368 ++++++++++-------- 1 file changed, 198 insertions(+), 170 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index efbdcfd5..6ecf37d3 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -210,20 +210,21 @@ class _PrescriptionFormWidgetState extends State { NetworkBaseView( baseViewModel: model, child: GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: DraggableScrollableSheet( initialChildSize: 0.90, maxChildSize: 0.90, minChildSize: 0.9, - builder: (BuildContext context, ScrollController scrollController) { + builder: + (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( height: 1010, child: Padding( - padding: - EdgeInsets.symmetric(horizontal: 12.0, vertical: 10.0), + padding: EdgeInsets.symmetric( + horizontal: 12.0, vertical: 10.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -247,8 +248,8 @@ class _PrescriptionFormWidgetState extends State { child: InkWell( onTap: model.allMedicationList != null ? () { - Helpers.hideKeyboard(context); - setState(() { + Helpers.hideKeyboard(context); + setState(() { _selectedMedication = null; }); } @@ -267,8 +268,8 @@ class _PrescriptionFormWidgetState extends State { true, ), itemSubmitted: (item) => setState( - () => - _selectedMedication = item), + () => _selectedMedication = + item), key: key, suggestions: model.allMedicationList, @@ -278,19 +279,18 @@ class _PrescriptionFormWidgetState extends State { child: Texts(suggestion .description + '/' + - suggestion.genericName), + suggestion + .genericName), padding: EdgeInsets.all(8.0)), itemSorter: (a, b) => 1, itemFilter: (suggestion, input) => - suggestion.genericName - .toLowerCase() - .startsWith( - input.toLowerCase()) || + suggestion.genericName.toLowerCase().startsWith( + input.toLowerCase()) || suggestion.description .toLowerCase() - .startsWith( - input.toLowerCase()) || + .startsWith(input + .toLowerCase()) || suggestion.keywords .toLowerCase() .startsWith( @@ -338,17 +338,20 @@ class _PrescriptionFormWidgetState extends State { child: Row( children: [ Container( - width: - MediaQuery.of(context).size.width * - 0.550, + width: MediaQuery.of(context) + .size + .width * + 0.550, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter(4), + LengthLimitingTextInputFormatter( + 4), WhitelistingTextInputFormatter .digitsOnly ], - hintText: TranslationBase.of(context) - .strength, + hintText: + TranslationBase.of(context) + .strength, controller: strengthController, keyboardType: TextInputType.number, onChanged: (String value) { @@ -375,40 +378,49 @@ class _PrescriptionFormWidgetState extends State { width: 10.0, ), Container( - width: - MediaQuery.of(context).size.width * - 0.350, + width: MediaQuery.of(context) + .size + .width * + 0.350, child: InkWell( - onTap: model.medicationStrengthList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, + onTap: + model.medicationStrengthList != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: + 'nameEn', + attributeValueId: + 'id', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( @@ -430,8 +442,8 @@ class _PrescriptionFormWidgetState extends State { child: InkWell( onTap: model.medicationRouteList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( list: model.medicationRouteList, attributeName: 'nameEn', @@ -452,7 +464,8 @@ class _PrescriptionFormWidgetState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -473,13 +486,14 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != null + onTap: model.medicationFrequencyList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationFrequencyList, + list: model + .medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -494,7 +508,8 @@ class _PrescriptionFormWidgetState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -502,7 +517,8 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, + TranslationBase.of(context) + .frequency, frequency != null ? frequency['nameEn'] : null, @@ -515,13 +531,14 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != null + onTap: model.medicationDoseTimeList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationDoseTimeList, + list: model + .medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -536,7 +553,8 @@ class _PrescriptionFormWidgetState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -544,7 +562,8 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, + TranslationBase.of(context) + .doseTime, doseTime != null ? doseTime['nameEn'] : null, @@ -561,18 +580,19 @@ class _PrescriptionFormWidgetState extends State { child: InkWell( onTap: indicationList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( list: indicationList, attributeName: 'name', attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, + okText: TranslationBase.of( + context) + .ok, okFunction: (selectedValue) { setState(() { - indication = selectedValue; + indication = + selectedValue; }); }, ); @@ -587,14 +607,15 @@ class _PrescriptionFormWidgetState extends State { } : null, child: TextField( - decoration: textFieldSelectorDecoration( - model.patientAssessmentList[0] - .icdCode10ID - .toString(), - indication != null - ? indication['name'] - : null, - true), + decoration: + textFieldSelectorDecoration( + model.patientAssessmentList[0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), enabled: true, readOnly: true, ), @@ -660,7 +681,8 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: Helpers.textFieldSelectorDecoration( - TranslationBase.of(context).date, + TranslationBase.of(context) + .date, selectedDate != null ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, @@ -677,13 +699,14 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.medicationDurationList != null + onTap: model.medicationDurationList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationDurationList, + list: model + .medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -698,7 +721,8 @@ class _PrescriptionFormWidgetState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -706,7 +730,8 @@ class _PrescriptionFormWidgetState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration, + TranslationBase.of(context) + .duration, duration != null ? duration['nameEn'] : null, @@ -726,8 +751,8 @@ class _PrescriptionFormWidgetState extends State { child: TextFields( maxLines: 6, minLines: 4, - hintText: - TranslationBase.of(context).instruction, + hintText: TranslationBase.of(context) + .instruction, controller: instructionController, //keyboardType: TextInputType.number, validator: (value) { @@ -763,90 +788,93 @@ class _PrescriptionFormWidgetState extends State { "Please Fill All Fields"); return; } - if (int.parse( - strengthController.text) > - 1000) { - DrAppToastMsg.showErrorToast( - "1000 is the MAX for the strength"); - return; - } + if (int.parse( + strengthController.text) > + 1000) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); + return; + } - if (formKey.currentState.validate()) { - Navigator.pop(context); - { - // var x = model - // .patientAssessmentList - // .map((value) => - // value.icdCode10ID) - // .toList() - // .join(','); - postProcedure( - icdCode: model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty - ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - // icdCode: model + if (formKey.currentState + .validate()) { + Navigator.pop(context); + { + // var x = model // .patientAssessmentList - // .map((value) => value - // .icdCode10ID - // .trim()) + // .map((value) => + // value.icdCode10ID) // .toList() - // .join(' '), - dose: strengthController.text, - doseUnit: - units['id'].toString(), - patient: widget.patient, - doseTimeIn: - doseTime['id'].toString(), - model: widget.model, - duration: - duration['id'].toString(), - frequency: - frequency['id'].toString(), - route: route['id'].toString(), - drugId: _selectedMedication - .itemId - .toString(), - strength: - strengthController.text, - indication: - indicationController.text, - instruction: - instructionController.text, - doseTime: selectedDate, - ); + // .join(','); + postProcedure( + icdCode: model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty + ? "test" + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + // icdCode: model + // .patientAssessmentList + // .map((value) => value + // .icdCode10ID + // .trim()) + // .toList() + // .join(' '), + dose: strengthController.text, + doseUnit: + units['id'].toString(), + patient: widget.patient, + doseTimeIn: + doseTime['id'].toString(), + model: widget.model, + duration: + duration['id'].toString(), + frequency: frequency['id'] + .toString(), + route: route['id'].toString(), + drugId: _selectedMedication + .itemId + .toString(), + strength: + strengthController.text, + indication: + indicationController.text, + instruction: + instructionController + .text, + doseTime: selectedDate, + ); + } } - } - { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // NewPrescriptionScreen()), - // ); - } - }, - ), - ], + { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // NewPrescriptionScreen()), + // ); + } + }, + ), + ], + ), ), - ), - ], + ], + ), ), ), - ), - ], + ], + ), ), ), - ), - ); - }), + ); + }), + ), ), ); } From d20e83faa5823f1abd41ff12a9f94d66e827bf9a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 13 Feb 2021 23:40:05 +0200 Subject: [PATCH 284/421] bug fixing --- .../prescription/add_prescription_form.dart | 171 ++++----- .../update_prescription_form.dart | 329 +++++++++++++----- 2 files changed, 320 insertions(+), 180 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 6ecf37d3..f262a0f6 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -573,105 +573,74 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), - if (model.patientAssessmentList.isNotEmpty) Container( height: screenSize.height * 0.070, - child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: indicationList, - attributeName: 'name', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: (selectedValue) { - setState(() { - indication = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - model.patientAssessmentList[0] - .icdCode10ID - .toString(), - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, - ), + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.29, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.65, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + maxLines: 5, + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .asciiDesc + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + ], ), ), - //model.patientAssessmentList.forEach((element) { }). - // Column( - // children: model.patientAssessmentList - // .map((element) { - // return Container( - // height: screenSize.height * 0.070, - // child: InkWell( - // onTap: indicationList != null - // ? () { - // ListSelectDialog dialog = - // ListSelectDialog( - // list: indicationList, - // attributeName: 'name', - // attributeValueId: 'id', - // okText: TranslationBase.of( - // context) - // .ok, - // okFunction: (selectedValue) { - // setState(() { - // indication = - // selectedValue; - // }); - // }, - // ); - // showDialog( - // barrierDismissible: false, - // context: context, - // builder: - // (BuildContext context) { - // return dialog; - // }, - // ); - // } - // : null, - // child: TextField( - // decoration: - // textFieldSelectorDecoration( - // element.icdCode10ID - // .toString(), - // indication != null - // ? indication['name'] - // : null, - // true), - // enabled: true, - // readOnly: true, - // ), - // ), - // ); - // }).toList(), - // ), - SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, @@ -755,13 +724,6 @@ class _PrescriptionFormWidgetState extends State { .instruction, controller: instructionController, //keyboardType: TextInputType.number, - validator: (value) { - if (value.isEmpty) - return TranslationBase.of(context) - .emptyMessage; - else - return null; - }, ), ), SizedBox(height: spaceBetweenTextFileds), @@ -795,6 +757,13 @@ class _PrescriptionFormWidgetState extends State { "1000 is the MAX for the strength"); return; } + if (int.parse( + strengthController.text) == + 0) { + DrAppToastMsg.showErrorToast( + "Streangth can't be zero"); + return; + } if (formKey.currentState .validate()) { diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 0f48f5c1..af1fbb07 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; @@ -36,6 +37,7 @@ class UpdatePrescriptionForm extends StatefulWidget { final String startDate; final String frequency; final String drugNameGeneric; + final PrescriptionViewModel model; UpdatePrescriptionForm( @@ -71,14 +73,44 @@ class _UpdatePrescriptionFormState extends State { GetMedicationResponseModel newSelectedMedication; GlobalKey key = new GlobalKey>(); - + List indicationList; + dynamic indication; + DateTime selectedDate; @override void initState() { super.initState(); + + indicationList = List(); + + dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; + dynamic indication2 = {"id": 546, "name": "Mild Drowsiness"}; + dynamic indication3 = {"id": 547, "name": "Hypertrichosis"}; + dynamic indication4 = {"id": 548, "name": "Mild Dizziness"}; + dynamic indication5 = {"id": 549, "name": "Enlargement of Facial Features"}; + dynamic indication6 = { + "id": 550, + "name": "Phenytoin Hypersensitivity Syndrome" + }; + dynamic indication7 = {"id": 551, "name": "Asterixis"}; + dynamic indication8 = {"id": 552, "name": "Bullous Dermatitis"}; + dynamic indication9 = {"id": 554, "name": "Purpuric Dermatitis"}; + dynamic indication10 = {"id": 555, "name": "Systemic Lupus Erythematosus"}; + + indicationList.add(indication1); + indicationList.add(indication2); + indicationList.add(indication3); + indicationList.add(indication4); + indicationList.add(indication5); + indicationList.add(indication6); + indicationList.add(indication7); + indicationList.add(indication8); + indicationList.add(indication9); + indicationList.add(indication10); } @override Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; return StatefulBuilder(builder: (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( @@ -105,17 +137,17 @@ class _UpdatePrescriptionFormState extends State { NetworkBaseView( baseViewModel: model, child: GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: DraggableScrollableSheet( - initialChildSize: 0.95, + initialChildSize: 0.98, maxChildSize: 0.99, minChildSize: 0.6, builder: (BuildContext context, ScrollController scrollController) { return Container( - height: MediaQuery.of(context).size.height * 1.3, + height: MediaQuery.of(context).size.height * 2.5, child: Form( child: Padding( padding: EdgeInsets.symmetric( @@ -211,15 +243,18 @@ class _UpdatePrescriptionFormState extends State { child: Row( children: [ Container( - width: - MediaQuery.of(context).size.width * - 0.4900, - height: - MediaQuery.of(context).size.height * - 0.55, + width: MediaQuery.of(context) + .size + .width * + 0.4900, + height: MediaQuery.of(context) + .size + .height * + 0.55, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter(4), + LengthLimitingTextInputFormatter( + 4), WhitelistingTextInputFormatter .digitsOnly ], @@ -251,40 +286,49 @@ class _UpdatePrescriptionFormState extends State { width: 10.0, ), Container( - width: - MediaQuery.of(context).size.width * - 0.3700, + width: MediaQuery.of(context) + .size + .width * + 0.3700, child: InkWell( - onTap: model.medicationStrengthList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, + onTap: + model.medicationStrengthList != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: + 'nameEn', + attributeValueId: + 'id', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( @@ -309,8 +353,8 @@ class _UpdatePrescriptionFormState extends State { child: InkWell( onTap: model.medicationRouteList != null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( list: model.medicationRouteList, attributeName: 'nameEn', @@ -330,7 +374,8 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -354,13 +399,14 @@ class _UpdatePrescriptionFormState extends State { height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != null + onTap: model.medicationDoseTimeList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationDoseTimeList, + list: model + .medicationDoseTimeList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -375,7 +421,8 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -383,7 +430,8 @@ class _UpdatePrescriptionFormState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).doseTime, + TranslationBase.of(context) + .doseTime, doseTime != null ? doseTime['nameEn'] : null, @@ -399,13 +447,14 @@ class _UpdatePrescriptionFormState extends State { height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != null + onTap: model.medicationFrequencyList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationFrequencyList, + list: model + .medicationFrequencyList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -421,7 +470,8 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -429,7 +479,8 @@ class _UpdatePrescriptionFormState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).frequency, + TranslationBase.of(context) + .frequency, frequencyUpdate != null ? frequencyUpdate['nameEn'] : null, @@ -445,13 +496,14 @@ class _UpdatePrescriptionFormState extends State { height: MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDurationList != null + onTap: model.medicationDurationList != + null ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = + Helpers.hideKeyboard(context); + ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationDurationList, + list: model + .medicationDurationList, attributeName: 'nameEn', attributeValueId: 'id', okText: @@ -467,7 +519,8 @@ class _UpdatePrescriptionFormState extends State { showDialog( barrierDismissible: false, context: context, - builder: (BuildContext context) { + builder: + (BuildContext context) { return dialog; }, ); @@ -475,7 +528,8 @@ class _UpdatePrescriptionFormState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - TranslationBase.of(context).duration, + TranslationBase.of(context) + .duration, updatedDuration != null ? updatedDuration['nameEn'] .toString() @@ -488,6 +542,100 @@ class _UpdatePrescriptionFormState extends State { SizedBox( height: 12.0, ), + Container( + height: screenSize.height * 0.070, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.29, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.61, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + maxLines: 3, + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .asciiDesc + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: + Helpers.textFieldSelectorDecoration( + widget.startDate, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, + ), + ), + ), + SizedBox( + height: 12.0, + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -503,11 +651,11 @@ class _UpdatePrescriptionFormState extends State { ), ), SizedBox( - height: 12.0, + height: 10.0, ), SizedBox( - height: - MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * + 0.08, ), Container( margin: EdgeInsets.all( @@ -516,19 +664,22 @@ class _UpdatePrescriptionFormState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: - 'update prescription'.toUpperCase(), + title: 'update prescription' + .toUpperCase(), onPressed: () { updatePrescription( + newStartDate: selectedDate, newDoseStreangth: strengthController .text.isNotEmpty - ? strengthController.text + ? strengthController + .text : widget.doseStreangth, - newUnit: units != - null - ? units['id'].toString() - : widget.doseUnit, + newUnit: + units != + null + ? units['id'].toString() + : widget.doseUnit, doseUnit: widget.doseUnit, doseStreangth: widget .doseStreangth, @@ -582,6 +733,24 @@ class _UpdatePrescriptionFormState extends State { }); } + selectDate(BuildContext context, PrescriptionViewModel model) async { + Helpers.hideKeyboard(context); + DateTime selectedDate; + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now(), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + this.selectedDate = picked; + }); + } + } + InputDecoration textFieldSelectorDecoration( String hintText, String selectedText, bool isDropDown, {Icon suffixIcon}) { @@ -626,6 +795,7 @@ class _UpdatePrescriptionFormState extends State { String route, String routeId, String startDate, + DateTime newStartDate, String doseUnit, String doseStreangth, String newDoseStreangth, @@ -664,7 +834,8 @@ class _UpdatePrescriptionFormState extends State { duration: newDuration.isNotEmpty ? int.parse(newDuration) : int.parse(duration), - doseStartDate: startDate)); + doseStartDate: + newStartDate != null ? newStartDate.toIso8601String() : startDate)); updatePrescriptionReqModel.prescriptionRequestModel = sss; //postProcedureReqModel.procedures = controlsProcedure; From a047255f2ce917a4657155852bd2ddf1f2653bb8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 14 Feb 2021 09:47:54 +0200 Subject: [PATCH 285/421] add referral get facilties --- lib/config/config.dart | 3 ++- .../patient-doctor-referral-service.dart | 14 ++++++++++++ .../viewModel/patient-referral-viewmodel.dart | 6 ++--- .../referral/refer-patient-screen.dart | 22 ++++++++++++++----- 4 files changed, 35 insertions(+), 10 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 6c4da7b1..6afcb64f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL = const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -//const GET_PROJECTS = 'Services/Lists.svc/REST/GetProjectForDoctorAPP'; +const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; + const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; const GET_PATIENT_VITAL_SIGN = diff --git a/lib/core/service/patient-doctor-referral-service.dart b/lib/core/service/patient-doctor-referral-service.dart index 813fef35..3136b549 100644 --- a/lib/core/service/patient-doctor-referral-service.dart +++ b/lib/core/service/patient-doctor-referral-service.dart @@ -49,6 +49,20 @@ class PatientReferralService extends LookupService { }, body: info); } + Future getReferralFacilities() async { + hasError = false; + + Map body = Map(); + body['isSameBranch'] = false; + + await baseAppClient.post(GET_REFERRAL_FACILITIES, onSuccess: (response, statusCode) async { + projectsList = response['ProjectInfo']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + Future getProjectInfo(int projectId) async { Map body = Map(); body['ProjectID'] = projectId; diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 5771d1db..00ef09f6 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -62,7 +62,7 @@ class PatientReferralViewModel extends BaseViewModel { Future getBranches() async { setState(ViewState.BusyLocal); - await _referralPatientService.getProjectsList(); + await _referralPatientService.getReferralFacilities(); if (_referralPatientService.hasError) { error = _referralPatientService.error; setState(ViewState.Error); @@ -77,7 +77,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getProjectInfo(projectId); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } @@ -87,7 +87,7 @@ class PatientReferralViewModel extends BaseViewModel { await _referralPatientService.getDoctorsList(clinicId); if (_referralPatientService.hasError) { error = _referralPatientService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index b2a71f4b..6f053089 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -177,15 +178,18 @@ class _PatientMakeReferralScreenState extends State { _selectedBranch = null; _selectedClinic = null; _selectedDoctor = null; - model.getDoctorBranch().then((value) { + model.getDoctorBranch().then((value) async { _selectedBranch = value; if (_referTo['id'] == 1) { GifLoaderDialogUtils.showMyDialog(context); - model + await model .getClinics(_selectedBranch['facilityId']) .then((_) => GifLoaderDialogUtils.hideDialog( context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } } }); }); @@ -226,15 +230,18 @@ class _PatientMakeReferralScreenState extends State { attributeValueId: 'facilityId', okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { - setState(() { + setState(() async { _selectedBranch = selectedValue; _selectedClinic = null; _selectedDoctor = null; GifLoaderDialogUtils.showMyDialog(context); - model + await model .getClinics(_selectedBranch['facilityId']) .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } }); }, ); @@ -277,15 +284,18 @@ class _PatientMakeReferralScreenState extends State { TranslationBase.of(context).clinicSearch, okText: TranslationBase.of(context).ok, okFunction: (selectedValue) { - setState(() { + setState(() async { _selectedDoctor = null; _selectedClinic = selectedValue; GifLoaderDialogUtils.showMyDialog(context); - model + await model .getClinicDoctors( _selectedClinic['ClinicID'].toString()) .then((_) => GifLoaderDialogUtils.hideDialog(context)); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } }); }, ); From d8d2e7f1d649c88ef8db297eaaf74ffcb7154b00 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 14 Feb 2021 11:19:30 +0200 Subject: [PATCH 286/421] fix ios issues --- .../prescription/add_prescription_form.dart | 14 +++++++------- .../prescription/update_prescription_form.dart | 12 ++---------- lib/widgets/auth/verification_methods.dart | 13 ++++--------- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f262a0f6..f00bfe72 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -343,17 +343,17 @@ class _PrescriptionFormWidgetState extends State { .width * 0.550, child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 4), - WhitelistingTextInputFormatter - .digitsOnly - ], + // inputFormatters: [ + // LengthLimitingTextInputFormatter( + // 4), + // WhitelistingTextInputFormatter + // .digitsOnly + // ], hintText: TranslationBase.of(context) .strength, controller: strengthController, - keyboardType: TextInputType.number, + keyboardType: TextInputType.numberWithOptions(decimal: true,), onChanged: (String value) { setState(() { strengthChar = value.length; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index af1fbb07..938f24bc 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -562,11 +562,7 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), + model.patientAssessmentList.isNotEmpty? model.patientAssessmentList[0].icdCode10ID.toString():'', indication != null ? indication['name'] : null, @@ -592,11 +588,7 @@ class _UpdatePrescriptionFormState extends State { maxLines: 3, decoration: textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), + model.patientAssessmentList.isNotEmpty? model.patientAssessmentList[0].asciiDesc.toString():'', indication != null ? indication['name'] : null, diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 04a82a80..adb0aef0 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -233,11 +233,7 @@ class _VerificationMethodsState extends State { Expanded( child: InkWell( onTap: () => { - authenticateUser( - 3, - BiometricType - .face.index, - authProv) + authenticateUser(3, true, authProv) }, child: getButton( user.logInTypeID, @@ -488,8 +484,7 @@ class _VerificationMethodsState extends State { onTap: () => { if (checkIfBiometricAvailable(BiometricType.fingerprint)) { - authenticateUser( - 3, BiometricType.fingerprint.index, authProv) + authenticateUser(3, true, authProv) } }, child: RoundedContainer( @@ -524,7 +519,7 @@ class _VerificationMethodsState extends State { return InkWell( onTap: () { if (checkIfBiometricAvailable(BiometricType.face)) { - authenticateUser(4, BiometricType.face.index, authProv); + authenticateUser(4, true, authProv); } }, child: RoundedContainer( @@ -706,7 +701,7 @@ class _VerificationMethodsState extends State { } loginWithFingurePrintFace(type, isActive, authProv) async { - if (isActive == 1) { + if (isActive) { // this.startBiometricLoginIfAvailable(); authenticated = await auth.authenticateWithBiometrics( localizedReason: 'Scan your fingerprint to authenticate', From 39d2fe879c03140ceb3761e5a348e0764b8d72bc Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 14 Feb 2021 16:44:47 +0200 Subject: [PATCH 287/421] jira bug fixing --- .../prescription/prescription_screen.dart | 16 +- .../update_prescription_form.dart | 1129 +++++++++-------- 2 files changed, 581 insertions(+), 564 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 9cc208c5..f7012f1d 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -214,16 +214,16 @@ class _NewPrescriptionScreenState extends State { 0] .entityList[ index] - .startDate) + .createdOn) .day .toString(), color: Colors .green, ), AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].startDate != + Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].startDate) + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) .month) : DateTime.now() .month) @@ -261,9 +261,13 @@ class _NewPrescriptionScreenState extends State { child: AppText( model - .prescriptionList[0] - .entityList[index] - .startDate, + .prescriptionList[ + 0] + .entityList[ + index] + .startDate + .replaceAll("-", + "/"), fontSize: 12.0, ), diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index af1fbb07..6efc5900 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -79,7 +79,7 @@ class _UpdatePrescriptionFormState extends State { @override void initState() { super.initState(); - + remarksController.text = widget.remarks; indicationList = List(); dynamic indication1 = {"id": 545, "name": "Gingival Hyperplasia"}; @@ -146,586 +146,599 @@ class _UpdatePrescriptionFormState extends State { minChildSize: 0.6, builder: (BuildContext context, ScrollController scrollController) { - return Container( - height: MediaQuery.of(context).size.height * 2.5, - child: Form( - child: Padding( - padding: EdgeInsets.symmetric( - horizontal: 20.0, vertical: 12.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.drugName.toUpperCase(), - fontWeight: FontWeight.w900, - ), - SizedBox( - height: 10.0, - ), - Column( - children: [ - // Container( - // height: MediaQuery.of(context).size.height * - // 0.070, - // child: InkWell( - // onTap: model.allMedicationList != null - // ? () { - // setState(() { - // newSelectedMedication = null; - // }); - // } - // : null, - // child: newSelectedMedication == null - // ? AutoCompleteTextField< - // GetMedicationResponseModel>( - // decoration: - // textFieldSelectorDecoration( - // widget.drugNameGeneric, - // newSelectedMedication != null - // ? newSelectedMedication - // .genericName - // : null, - // true, - // ), - // itemSubmitted: (item) => setState( - // () => newSelectedMedication = - // 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( - // decoration: - // textFieldSelectorDecoration( - // TranslationBase.of(context) - // .searchMedicineNameHere, - // newSelectedMedication != null - // ? newSelectedMedication - // .description + - // ('${newSelectedMedication.genericName}') - // : null, - // true, - // ), - // enabled: false, - // ), - // ), - // ), - // SizedBox( - // height: 12, - // ), - Container( - height: MediaQuery.of(context).size.height * - 0.060, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.4900, - height: MediaQuery.of(context) - .size - .height * - 0.55, - child: TextFields( - inputFormatters: [ - LengthLimitingTextInputFormatter( - 4), - WhitelistingTextInputFormatter - .digitsOnly - ], - hintText: widget.doseStreangth, - fontSize: 15.0, - controller: strengthController, - keyboardType: TextInputType.number, - onChanged: (String value) { - setState(() { - strengthChar = value.length; - }); - if (strengthChar >= 4) { - DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); - } - }, - // validator: (value) { - // if (value.isEmpty && - // strengthController.text.length > - // 4) - // return TranslationBase.of(context) - // .emptyMessage; - // else - // return null; - // }, + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 2.0, + child: Form( + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 20.0, vertical: 12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + widget.drugName.toUpperCase(), + fontWeight: FontWeight.w900, + ), + SizedBox( + height: 10.0, + ), + Column( + children: [ + // Container( + // height: MediaQuery.of(context).size.height * + // 0.070, + // child: InkWell( + // onTap: model.allMedicationList != null + // ? () { + // setState(() { + // newSelectedMedication = null; + // }); + // } + // : null, + // child: newSelectedMedication == null + // ? AutoCompleteTextField< + // GetMedicationResponseModel>( + // decoration: + // textFieldSelectorDecoration( + // widget.drugNameGeneric, + // newSelectedMedication != null + // ? newSelectedMedication + // .genericName + // : null, + // true, + // ), + // itemSubmitted: (item) => setState( + // () => newSelectedMedication = + // 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( + // decoration: + // textFieldSelectorDecoration( + // TranslationBase.of(context) + // .searchMedicineNameHere, + // newSelectedMedication != null + // ? newSelectedMedication + // .description + + // ('${newSelectedMedication.genericName}') + // : null, + // true, + // ), + // enabled: false, + // ), + // ), + // ), + // SizedBox( + // height: 12, + // ), + Container( + height: + MediaQuery.of(context).size.height * + 0.060, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.4900, + height: MediaQuery.of(context) + .size + .height * + 0.55, + child: TextFields( + inputFormatters: [ + LengthLimitingTextInputFormatter( + 4), + WhitelistingTextInputFormatter + .digitsOnly + ], + hintText: widget.doseStreangth, + fontSize: 15.0, + controller: strengthController, + keyboardType: + TextInputType.number, + onChanged: (String value) { + setState(() { + strengthChar = value.length; + }); + if (strengthChar >= 4) { + DrAppToastMsg.showErrorToast( + "Only 4 Digits allowed for strength"); + } + }, + // validator: (value) { + // if (value.isEmpty && + // strengthController.text.length > + // 4) + // return TranslationBase.of(context) + // .emptyMessage; + // else + // return null; + // }, + ), ), - ), - SizedBox( - width: 10.0, - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.3700, - child: InkWell( - onTap: - model.medicationStrengthList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - 'UNIT Type', - units != null - ? units['nameEn'] - : null, - true), - enabled: false, + SizedBox( + width: 10.0, + ), + Container( + width: MediaQuery.of(context) + .size + .width * + 0.3700, + child: InkWell( + onTap: + model.medicationStrengthList != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog + dialog = + ListSelectDialog( + list: model + .medicationStrengthList, + attributeName: + 'nameEn', + attributeValueId: + 'id', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: + false, + context: context, + builder: + (BuildContext + context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'UNIT Type', + units != null + ? units['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - ], + ], + ), ), - ), - SizedBox( - height: 12, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationRouteList != null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - route = selectedValue; - }); - if (route == null) { - route = route['id']; - } - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - 'Route', - route != null - ? route['nameEn'] - : null, - true), - enabled: false, + SizedBox( + height: 12, + ), + Container( + height: + MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationRouteList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: + model.medicationRouteList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + route = selectedValue; + }); + if (route == null) { + route = route['id']; + } + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'Route', + route != null + ? route['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDoseTimeList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - doseTime = selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .doseTime, - doseTime != null - ? doseTime['nameEn'] - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDoseTimeList != + null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + doseTime = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .doseTime, + doseTime != null + ? doseTime['nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationFrequencyList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - frequencyUpdate = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .frequency, - frequencyUpdate != null - ? frequencyUpdate['nameEn'] - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationFrequencyList != + null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationFrequencyList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + frequencyUpdate = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .frequency, + frequencyUpdate != null + ? frequencyUpdate[ + 'nameEn'] + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: MediaQuery.of(context).size.height * - 0.070, - child: InkWell( - onTap: model.medicationDurationList != - null - ? () { - Helpers.hideKeyboard(context); - ListSelectDialog dialog = - ListSelectDialog( - list: model - .medicationDurationList, - attributeName: 'nameEn', - attributeValueId: 'id', - okText: - TranslationBase.of(context) - .ok, - okFunction: (selectedValue) { - setState(() { - updatedDuration = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: false, - context: context, - builder: - (BuildContext context) { - return dialog; - }, - ); - } - : null, - child: TextField( - decoration: textFieldSelectorDecoration( - TranslationBase.of(context) - .duration, - updatedDuration != null - ? updatedDuration['nameEn'] - .toString() - : null, - true), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + height: + MediaQuery.of(context).size.height * + 0.070, + child: InkWell( + onTap: model.medicationDurationList != + null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .medicationDurationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + updatedDuration = + selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + TranslationBase.of(context) + .duration, + updatedDuration != null + ? updatedDuration[ + 'nameEn'] + .toString() + : null, + true), + enabled: false, + ), ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.29, - child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, + SizedBox( + height: 12.0, + ), + Container( + height: screenSize.height * 0.070, + width: double.infinity, + child: Row( + children: [ + Container( + width: MediaQuery.of(context) + .size + .width * + 0.29, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), ), ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.61, - child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - maxLines: 3, - decoration: - textFieldSelectorDecoration( - model - .patientAssessmentList[ - 0] - .asciiDesc - .toString(), - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, + Container( + width: MediaQuery.of(context) + .size + .width * + 0.61, + child: InkWell( + onTap: indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + maxLines: 3, + decoration: + textFieldSelectorDecoration( + model + .patientAssessmentList[ + 0] + .asciiDesc + .toString(), + indication != null + ? indication['name'] + : null, + true), + enabled: true, + readOnly: true, + ), ), ), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: () => + selectDate(context, widget.model), + child: TextField( + decoration: Helpers + .textFieldSelectorDecoration( + widget.startDate, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), + enabled: false, ), - ], + ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - height: screenSize.height * 0.070, - child: InkWell( - onTap: () => - selectDate(context, widget.model), - child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - widget.startDate, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), - enabled: false, + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + controller: remarksController, + maxLines: 7, + minLines: 4, ), ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - controller: remarksController, - maxLines: 7, - minLines: 4, + SizedBox( + height: 10.0, ), - ), - SizedBox( - height: 10.0, - ), - SizedBox( - height: MediaQuery.of(context).size.height * - 0.08, - ), - Container( - margin: EdgeInsets.all( - SizeConfig.widthMultiplier * 2), - child: Wrap( - alignment: WrapAlignment.center, - children: [ - AppButton( - title: 'update prescription' - .toUpperCase(), - onPressed: () { - updatePrescription( - newStartDate: selectedDate, - newDoseStreangth: - strengthController - .text.isNotEmpty - ? strengthController - .text - : widget.doseStreangth, - newUnit: - units != - null - ? units['id'].toString() - : widget.doseUnit, - doseUnit: widget.doseUnit, - doseStreangth: widget - .doseStreangth, - duration: widget.duration, - startDate: widget.startDate, - doseId: widget.dose, - frequencyId: widget.frequency, - routeId: widget.route, - patient: widget.patient, - model: widget.model, - newDuration: - updatedDuration != - null - ? updatedDuration[ - 'id'] - .toString() - : widget.duration, - drugId: widget.drugId, - remarks: remarksController.text, - route: route != - null - ? route['id'].toString() - : widget.route, - frequency: - frequencyUpdate != - null - ? frequencyUpdate['id'] - .toString() - : widget.frequency, - dose: doseTime != null - ? doseTime['id'].toString() - : widget.dose, - enteredRemarks: - widget.enteredRemarks); - Navigator.pop(context); - }, - ), - ], + SizedBox( + height: + MediaQuery.of(context).size.height * + 0.08, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 2), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: 'update prescription' + .toUpperCase(), + onPressed: () { + updatePrescription( + newStartDate: selectedDate, + newDoseStreangth: + strengthController + .text.isNotEmpty + ? strengthController + .text + : widget + .doseStreangth, + newUnit: units != null + ? units['id'].toString() + : widget.doseUnit, + doseUnit: widget.doseUnit, + doseStreangth: + widget.doseStreangth, + duration: widget.duration, + startDate: widget.startDate, + doseId: widget.dose, + frequencyId: widget.frequency, + routeId: widget.route, + patient: widget.patient, + model: widget.model, + newDuration: updatedDuration != + null + ? updatedDuration['id'] + .toString() + : widget.duration, + drugId: widget.drugId, + remarks: + remarksController.text, + route: route != null + ? route['id'].toString() + : widget.route, + frequency: frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, + dose: doseTime != null + ? doseTime['id'] + .toString() + : widget.dose, + enteredRemarks: + widget.enteredRemarks); + Navigator.pop(context); + }, + ), + ], + ), ), - ), - ], - ), - ], + ], + ), + ], + ), ), - ), - )); + )), + ); }), ), ), From cb8b7a4ec4134171c8c225f2ab5fc76a7ade7500 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 14 Feb 2021 16:46:56 +0200 Subject: [PATCH 288/421] jira bug fixing --- .../update_prescription_form.dart | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 70ff06c2..6086c278 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -577,11 +577,14 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: textFieldSelectorDecoration( - model - .patientAssessmentList.isNotEmpty? model.patientAssessmentList[ - 0] - .icdCode10ID - .toString():'', + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() + : '', indication != null ? indication['name'] : null, @@ -607,11 +610,14 @@ class _UpdatePrescriptionFormState extends State { maxLines: 3, decoration: textFieldSelectorDecoration( - model - .patientAssessmentList.isNotEmpty? model.patientAssessmentList[ - 0] - .asciiDesc - .toString():'', + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .asciiDesc + .toString() + : '', indication != null ? indication['name'] : null, From 344d70793c95010b2fa3ddc8b3fb71798f89ee60 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 14 Feb 2021 19:04:59 +0200 Subject: [PATCH 289/421] fix DA-421 --- lib/screens/QR_reader_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 42278d40..43492149 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -209,7 +209,7 @@ class _QrReaderScreenState extends State { setState(() { isLoading = false; }); - helpers.showErrorToast(error); + helpers.showErrorToast(error.message); //DrAppToastMsg.showErrorToast(error); }); } From 083b49aa0a07ef90255ac1c0f15de380ee7f2289 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 14 Feb 2021 19:30:50 +0200 Subject: [PATCH 290/421] fix DA-341 --- lib/config/localized_values.dart | 3 +- .../list_gt_my_patients_question_model.dart | 19 ++++++- lib/util/translations_delegate_base.dart | 2 + lib/widgets/doctor/doctor_reply_widget.dart | 56 +++++++++++++++++-- 4 files changed, 72 insertions(+), 8 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c25d8fae..c5fe1a9b 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -709,6 +709,7 @@ const Map> localizedValues = { 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, - // 'icd': {'en': "ICD", 'ar': " "}, 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, + 'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"}, + 'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"}, }; diff --git a/lib/models/doctor/list_gt_my_patients_question_model.dart b/lib/models/doctor/list_gt_my_patients_question_model.dart index b743ade6..0d2cff9a 100644 --- a/lib/models/doctor/list_gt_my_patients_question_model.dart +++ b/lib/models/doctor/list_gt_my_patients_question_model.dart @@ -1,5 +1,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; + + class ListGtMyPatientsQuestions { String setupID; int projectID; @@ -17,11 +19,14 @@ class ListGtMyPatientsQuestions { int editedBy; String editedOn; String patientName; - String patientNameN; + Null patientNameN; int gender; String dateofBirth; String mobileNumber; String emailAddress; + String doctorResponse; + String infoStatus; + Null clinicID; String age; String genderDescription; bool isVidaCall; @@ -48,6 +53,9 @@ class ListGtMyPatientsQuestions { this.dateofBirth, this.mobileNumber, this.emailAddress, + this.doctorResponse, + this.infoStatus, + this.clinicID, this.age, this.genderDescription, this.isVidaCall}); @@ -61,6 +69,7 @@ class ListGtMyPatientsQuestions { doctorID = json['DoctorID']; requestType = json['RequestType']; requestDate = Helpers.convertStringToDate(json['RequestDate']) ; + requestTime = json['RequestTime']; remarks = json['Remarks']; status = json['Status']; @@ -74,6 +83,9 @@ class ListGtMyPatientsQuestions { dateofBirth = json['DateofBirth']; mobileNumber = json['MobileNumber']; emailAddress = json['EmailAddress']; + doctorResponse = json['DoctorResponse']; + infoStatus = json['InfoStatus']; + clinicID = json['ClinicID']; age = json['Age']; genderDescription = json['GenderDescription']; isVidaCall = json['IsVidaCall']; @@ -102,9 +114,12 @@ class ListGtMyPatientsQuestions { data['DateofBirth'] = this.dateofBirth; data['MobileNumber'] = this.mobileNumber; data['EmailAddress'] = this.emailAddress; + data['DoctorResponse'] = this.doctorResponse; + data['InfoStatus'] = this.infoStatus; + data['ClinicID'] = this.clinicID; data['Age'] = this.age; data['GenderDescription'] = this.genderDescription; data['IsVidaCall'] = this.isVidaCall; return data; } -} \ No newline at end of file +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 813d7064..499cade9 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1104,6 +1104,8 @@ class TranslationBase { String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; + String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index e9126ba3..f3882e23 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -167,12 +167,58 @@ class _DoctorReplyWidgetState extends State { children: [ Divider(color: Colors.grey), SizedBox(height: 5,), - AppText( - widget.reply.remarks, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).remarks + " : ", + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ),Expanded( + child: AppText( + widget.reply.remarks, + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ), + ), + ], ), - SizedBox(height: 10,) + SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).doctorResponse + " : ", + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ),Expanded( + child: AppText( + widget.reply.doctorResponse, + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ), + ), + ], + ),SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).infoStatus + " : ", + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ),Expanded( + child: AppText( + widget.reply.infoStatus, + fontSize: 2.5 * SizeConfig.textMultiplier, + //fontWeight: FontWeight.bold, + ), + ), + ], + ) ], ), ), From 2563b102168fc519865701a251a6d3b4c777d356 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Feb 2021 13:31:58 +0200 Subject: [PATCH 291/421] DA-367 --- .../model/procedure/categories_procedure.dart | 6 +- lib/core/service/procedure_service.dart | 2 +- .../procedures/add-procedure-form.dart | 82 ++++++------- .../entity_list_checkbox_search_widget.dart | 113 +++++++++++++----- lib/screens/procedures/update-procedure.dart | 90 +++++++------- 5 files changed, 178 insertions(+), 115 deletions(-) diff --git a/lib/core/model/procedure/categories_procedure.dart b/lib/core/model/procedure/categories_procedure.dart index 074d8a1b..9e6f847f 100644 --- a/lib/core/model/procedure/categories_procedure.dart +++ b/lib/core/model/procedure/categories_procedure.dart @@ -41,6 +41,8 @@ class EntityList { String specialPermission; String subGroup; String template; + String remarks; + String type; EntityList( {this.allowedClinic, @@ -54,7 +56,9 @@ class EntityList { this.procedureName, this.specialPermission, this.subGroup, - this.template}); + this.template, + this.remarks, + this.type}); EntityList.fromJson(Map json) { allowedClinic = json['allowedClinic']; diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 1ec996fb..98b1f36d 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -75,7 +75,7 @@ class ProcedureService extends BaseService { Future getProcedureCategory({String categoryName, String categoryID}) async { _getProcedureCategoriseReqModel = GetProcedureReqModel( - search: [""], + search: [categoryName], patientMRN: 0, pageIndex: 0, clinicId: 0, diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 11eadbb0..2fa0c428 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -34,13 +34,12 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { controls.add( - Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), + Controls( + code: "remarks", + controlValue: element.remarks.isNotEmpty ? element.remarks : ""), ); controls.add( - Controls( - code: "ordertype", - controlValue: - orderType.toString().isNotEmpty ? orderType.toString() : '1'), + Controls(code: "ordertype", controlValue: element.type), ); }); @@ -218,43 +217,43 @@ class _AddSelectedProcedureState extends State { Column( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 1, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 0, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - ], - ), - ), - SizedBox( - height: 15.0, - ), - TextFields( - hintText: TranslationBase.of(context).remarks, - controller: remarksController, - minLines: 3, - maxLines: 5, - ), + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), SizedBox( - height: 50.0, + height: 100.0, ), Container( margin: EdgeInsets.all( @@ -266,6 +265,7 @@ class _AddSelectedProcedureState extends State { title: TranslationBase.of(context) .addSelectedProcedures, onPressed: () { + //print(entityList.toString()); Navigator.pop(context); postProcedure( orderType: selectedType.toString(), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index a29100f5..73cf0115 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -17,6 +17,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { final Function addSelectedHistories; final Function(EntityList) removeHistory; final Function(EntityList) addHistory; + final Function(EntityList) addRemarks; + final bool Function(EntityList) isEntityListSelected; final List masterList; @@ -27,7 +29,8 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { this.removeHistory, this.masterList, this.addHistory, - this.isEntityListSelected}) + this.isEntityListSelected, + this.addRemarks}) : super(key: key); @override @@ -37,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType; + int selectedType = 1; setSelectedType(int val) { setState(() { selectedType = val; @@ -45,6 +48,8 @@ class _EntityListCheckboxSearchWidgetState } List items = List(); + List remarksList = List(); + List typeList = List(); @override void initState() { @@ -52,6 +57,7 @@ class _EntityListCheckboxSearchWidgetState super.initState(); } + TextEditingController remarksController = TextEditingController(); @override Widget build(BuildContext context) { return Container( @@ -84,34 +90,87 @@ class _EntityListCheckboxSearchWidgetState children: items.map((historyInfo) { return Column( children: [ - Row( + ExpansionTile( + title: Row( + children: [ + Checkbox( + value: widget.isEntityListSelected( + historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget.isEntityListSelected( + historyInfo)) { + widget.removeHistory( + historyInfo); + } else { + widget + .addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts( + historyInfo.procedureName, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), children: [ - Checkbox( - value: widget.isEntityListSelected( - historyInfo), - activeColor: Colors.red[800], - onChanged: (bool newValue) { - setState(() { - if (widget.isEntityListSelected( - historyInfo)) { - widget - .removeHistory(historyInfo); - } else { - widget.addHistory(historyInfo); - } - }); - }), - Expanded( - child: Padding( - padding: const EdgeInsets.symmetric( - horizontal: 10, vertical: 0), - child: Texts( - historyInfo.procedureName, - variant: "bodyText", - bold: true, - color: Colors.black), + Container( + child: Row( + children: [ + AppText(TranslationBase.of(context) + .orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 1, + groupValue: selectedType, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); + // historyInfo.type = + // value.toString(); + }, + ), + Text('routine'), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 0, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); + // historyInfo.type = + // value.toString(); + }, + ), + Text(TranslationBase.of(context) + .urgent), + ], ), ), + SizedBox( + height: 15.0, + ), + TextFields( + hintText: + TranslationBase.of(context).remarks, + //controller: remarksController, + onChanged: (value) { + historyInfo.remarks = value; + }, + minLines: 3, + maxLines: 5, + ), ], ), DividerWithSpacesAround(), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 2c502334..038b5d59 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -200,51 +200,51 @@ class _UpdateProcedureWidgetState extends State { isEntityListSelected(master), ), ), - Container( - child: Row( - children: [ - AppText( - TranslationBase.of(context).orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text(TranslationBase.of(context).urgent), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - setSelectedType(value); - }, - ), - Text('routine'), - ], - ), - ), - SizedBox( - height: 12.0, - ), - Container( - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - child: TextFields( - hintText: widget.remarks, - fontSize: 15.0, - controller: widget.remarksController, - maxLines: 3, - minLines: 2, - onChanged: (value) {}, - ), - ), + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 0, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 1, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // ], + // ), + // ), + // SizedBox( + // height: 12.0, + // ), + // Container( + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // child: TextFields( + // hintText: widget.remarks, + // fontSize: 15.0, + // controller: widget.remarksController, + // maxLines: 3, + // minLines: 2, + // onChanged: (value) {}, + // ), + // ), SizedBox( height: 50.0, ), From a309acbf46bdcf754003bb1478c6c3f24970a97d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 15 Feb 2021 18:39:58 +0300 Subject: [PATCH 292/421] dashboard changes --- lib/client/base_app_client.dart | 11 +- lib/config/localized_values.dart | 49 +- lib/screens/dashboard_screen.dart | 1183 ++++++++++++++-------- lib/util/translations_delegate_base.dart | 47 +- lib/widgets/dashboard/guage_chart.dart | 54 + 5 files changed, 909 insertions(+), 435 deletions(-) create mode 100644 lib/widgets/dashboard/guage_chart.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 604e6f30..559f7132 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -70,7 +70,7 @@ class BaseAppClient { body['Channel'] = CHANNEL; body['SessionID'] = SESSION_ID; body['IsLoginForDoctorApp'] = IS_LOGIN_FOR_DOCTOR_APP; - body['PatientOutSA'] = body['PatientOutSA']??0; // PATIENT_OUT_SA; + body['PatientOutSA'] = body['PatientOutSA'] ?? 0; // PATIENT_OUT_SA; if (body['VidaAuthTokenID'] == null) { body['VidaAuthTokenID'] = await sharedPref.getString(VIDA_AUTH_TOKEN_ID); @@ -96,9 +96,12 @@ class BaseAppClient { } else { var parsed = json.decode(response.body.toString()); if (!parsed['IsAuthenticated']) { - // onFailure(getError(parsed), statusCode); - await helpers.logout(); - helpers.showErrorToast('Your session expired Please login agian'); + if (body['OTP_SendType'] != null) { + onFailure(getError(parsed), statusCode); + } else { + await helpers.logout(); + helpers.showErrorToast('Your session expired Please login agian'); + } } else if (parsed['MessageStatus'] == 1) { if (!parsed['IsAuthenticated']) onFailure(getError(parsed), statusCode); diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index c25d8fae..2f9f5d66 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -29,7 +29,7 @@ const Map> localizedValues = { 'en': 'Answer/Suggestions', 'ar': 'ملاحضات وتفاصيل العيادة' }, - 'outPatients': {'en': 'Out-Patients', 'ar': 'المريض الخارجي'}, + 'outPatients': {'en': 'Out Patient', 'ar': 'المريض الخارجي'}, 'searchPatient': {'en': 'Search Patient', 'ar': 'البحث عن مريض'}, 'searchAbout': {'en': 'Search', 'ar': 'البحث عن'}, 'patient': {'en': 'Patient', 'ar': ' مريض'}, @@ -44,7 +44,7 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'االإحالة'}, - 'inPatient': {'en': 'In-Patient', 'ar': 'المريض الداخلي'}, + 'inPatient': {'en': 'In Patient', 'ar': 'المريض الداخلي'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicine', 'ar': 'بحث عن الدواء'}, @@ -426,7 +426,10 @@ const Map> localizedValues = { 'ar': 'تاريخ القبول المتوقع' }, // 'emergencyAdmission': {'en': "EMERGENCY ADMISSION", 'ar': 'دخول الطوارئ'}, - 'isSickLeaveRequired': {'en': "Is Sick Leave Required", 'ar': 'هل الإجازة المرضية مطلوبة'}, + 'isSickLeaveRequired': { + 'en': "Is Sick Leave Required", + 'ar': 'هل الإجازة المرضية مطلوبة' + }, 'patientPregnant': {'en': "Patient Pregnant", 'ar': 'حمل المريض'}, 'treatmentLine': { 'en': "Main line of treatment", @@ -459,10 +462,7 @@ const Map> localizedValues = { 'en': "POST PLANS & ESTIMATED COST", 'ar': 'خطط البريد والتكلفة المقدرة' }, - 'postPlans': { - 'en': "POST PLANS", - 'ar': 'خطط البريد' - }, + 'postPlans': {'en': "POST PLANS", 'ar': 'خطط البريد'}, 'ucaf': {'en': "UCAF", 'ar': 'UCAF'}, 'emergencyCase': {'en': "Emergency Case", 'ar': 'حالة طارئة'}, 'durationOfIllness': {'en': "duration Of Illness", 'ar': 'مدة المرض'}, @@ -695,20 +695,41 @@ const Map> localizedValues = { 'clinicSearch': {'en': "Search Clinic", 'ar': "بحث عن عيادة"}, 'doctorSearch': {'en': "Search Doctor", 'ar': "بحث عن طبيب"}, - 'referralResponse': {'en': "Referral Response : ", 'ar': " : استجابة الإحالة"}, + 'referralResponse': { + 'en': "Referral Response : ", + 'ar': " : استجابة الإحالة" + }, 'estimatedCost': {'en': "Estimated Cost", 'ar': "التكلفة المتوقعة"}, 'diagnosisDetail': {'en': "Diagnosis Detail : ", 'ar': "تفاصيل التشخيص"}, - 'referralSuccessMsgAccept': {'en': "Referral Accepted Successfully", 'ar': "تم قبول الإحالة بنجاح"}, - 'referralSuccessMsgReject': {'en': "Referral Rejected Successfully", 'ar': "تم رفض الإحالة بنجاح"}, - 'sickLeaveComments': {'en': "Sick leave comments", 'ar': "تعليقات إجازة مرضية"}, + 'referralSuccessMsgAccept': { + 'en': "Referral Accepted Successfully", + 'ar': "تم قبول الإحالة بنجاح" + }, + 'referralSuccessMsgReject': { + 'en': "Referral Rejected Successfully", + 'ar': "تم رفض الإحالة بنجاح" + }, + 'sickLeaveComments': { + 'en': "Sick leave comments", + 'ar': "تعليقات إجازة مرضية" + }, 'pastMedicalHistory': {'en': "Past medical history", 'ar': "التاريخ الطبي"}, - 'pastSurgicalHistory': {'en': "Past surgical history", 'ar': "التاريخ الجراحي"}, + 'pastSurgicalHistory': { + 'en': "Past surgical history", + 'ar': "التاريخ الجراحي" + }, 'complications': {'en': "Complications", 'ar': "المضاعفات"}, 'floor': {'en': "Floor", 'ar': "الطابق"}, 'roomCategory': {'en': "Room category", 'ar': "فئة الغرفة"}, - 'otherDepartmentsInterventions': {'en': "Other departments interventions", 'ar': "تدخلات الأقسام الأخرى"}, + 'otherDepartmentsInterventions': { + 'en': "Other departments interventions", + 'ar': "تدخلات الأقسام الأخرى" + }, 'otherProcedure': {'en': "Other procedure", 'ar': "إجراء آخر"}, - 'admissionRequestSuccessMsg': {'en': "Admission Request Created Successfully", 'ar': "تم إنشاء طلب القبول بنجاح"}, + 'admissionRequestSuccessMsg': { + 'en': "Admission Request Created Successfully", + 'ar': "تم إنشاء طلب القبول بنجاح" + }, // 'icd': {'en': "ICD", 'ar': " "}, 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 30dc2700..dba5b965 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; +import 'package:charts_flutter/flutter.dart' as charts; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; @@ -18,6 +19,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; @@ -34,6 +36,7 @@ import 'doctor/my_referral_patient_screen.dart'; import 'doctor/my_referred_patient_screen.dart'; import 'medicine/medicine_search_screen.dart'; import 'patients/profile/referral/referred-patient-screen.dart'; +import '../widgets/shared/rounded_container_widget.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -223,439 +226,710 @@ class _DashboardScreenState extends State { ), Container( color: Colors.white, - height: this.isExpanded - ? MediaQuery.of(context).size.height * 0.19 - : MediaQuery.of(context).size.height * 0.12, + height: MediaQuery.of(context).size.height * 0.45, ), ], ), Positioned( right: 9.0, left: 9, - bottom: 15, - child: ExpandableCardContainer( - expandedChild: Container( - margin: EdgeInsets.only(left: 10, right: 10), - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.22 - : MediaQuery.of(context).size.height * 0.25, - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - onTap: () { - setState(() { - this.isExpanded = false; - }); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - children: [ - Row( + top: MediaQuery.of(context).size.height * .1, + child: Container( + height: MediaQuery.of(context).size.height * 0.52, + child: Column( + children: [ + RoundedContainer( + height: + MediaQuery.of(context).size.height * 0.24, + margin: 5, + child: Column(children: [ + Expanded( + flex: 3, + child: Row( children: [ Expanded( - child: Column( - children: [ - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[0] - .value - .toString() - : model - .dashboardItemsList[ - 1] - .summaryoptions[0] - .value - .toString() - : "", - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 24, - ), - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[0] - .kPIParameter - : model - .dashboardItemsList[ - 1] - .summaryoptions[0] - .kPIParameter - : "", - //'My Admitted Patient', - color: Colors.white, - textAlign: TextAlign.center, - fontSize: 12, - ) - ], - )), - Expanded( - child: Column( - children: [ - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[1] - .value - .toString() - : model - .dashboardItemsList[ - 1] - .summaryoptions[1] - .value - .toString() - : "", - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 28, - ), - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[1] - .kPIParameter - : model - .dashboardItemsList[ - 1] - .summaryoptions[1] - .kPIParameter - : "", - color: Colors.white, - textAlign: TextAlign.center, - fontSize: 12, - ) - ], - )), - Expanded( - child: Column( - children: [ - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model + flex: 5, + child: Padding( + padding: + const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + rowCount( + model .dashboardItemsList[ 0] - .summaryoptions[2] - .value - .toString() - : model + .summaryoptions[0] + .kPIParameter, + model .dashboardItemsList[ - 1] - .summaryoptions[2] - .value - .toString() - : "", - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 28), - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model + 0] + .summaryoptions[0] + .value, + Colors.red), + rowCount( + model + .dashboardItemsList[ + 0] + .summaryoptions[1] + .kPIParameter, + model + .dashboardItemsList[ + 0] + .summaryoptions[1] + .value, + Colors.black), + rowCount( + model .dashboardItemsList[ 0] .summaryoptions[2] - .kPIParameter - .toString() - : model + .kPIParameter, + model .dashboardItemsList[ - 1] + 0] .summaryoptions[2] - .kPIParameter - .toString() - : "", - color: Colors.white, - fontSize: 12, - textAlign: TextAlign.center) - ], - )) + .value, + Colors.grey[800]), + ], + ))), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createInpatientData( + model))), + Positioned( + child: Column( + children: [ + AppText( + TranslationBase.of( + context) + .inPatient, + fontSize: 11, + fontWeight: + FontWeight.bold, + ), + AppText( + getPatientCount(model + .dashboardItemsList[0]) + .toString(), + fontSize: 11, + fontWeight: + FontWeight.bold, + ) + ], + ), + top: MediaQuery.of(context) + .size + .height * + 0.08, + left: MediaQuery.of(context) + .size + .width * + 0.10) + ])), ], - ), - Row( + )), + Expanded( + flex: 1, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + rowCount( + model + .dashboardItemsList[0] + .summaryoptions[3] + .kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[3].value, + Colors.grey), + rowCount( + model + .dashboardItemsList[0] + .summaryoptions[4] + .kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[4].value, + Colors.grey[300]), + ], + )), + ) + ])), + RoundedContainer( + height: + MediaQuery.of(context).size.height * 0.24, + margin: 5, + child: Column(children: [ + Expanded( + flex: 3, + child: Row( children: [ Expanded( - child: Column( - children: [ - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model + flex: 5, + child: Padding( + padding: + const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + rowCount( + model .dashboardItemsList[ - 0] - .summaryoptions[3] - .value - .toString() - : model + 1] + .summaryoptions[0] + .kPIParameter, + model .dashboardItemsList[ 1] - .summaryoptions[3] - .value - .toString() - : "", - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 28), - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model + .summaryoptions[0] + .value, + Colors.red), + rowCount( + model .dashboardItemsList[ - 0] - .summaryoptions[3] - .kPIParameter - .toString() - : model + 1] + .summaryoptions[1] + .kPIParameter, + model .dashboardItemsList[ 1] - .summaryoptions[3] - .kPIParameter - .toString() - : "", - color: Colors.white, - fontSize: 12, - textAlign: TextAlign.center) - ], - )), + .summaryoptions[1] + .value, + Colors.black), + rowCount( + model + .dashboardItemsList[ + 1] + .summaryoptions[2] + .kPIParameter, + model + .dashboardItemsList[ + 1] + .summaryoptions[2] + .value, + Colors.grey[800]), + ], + ))), Expanded( - child: Column( - children: [ - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[ - 4] - .value - .toString() - : model - .dashboardItemsList[ - 1] - .summaryoptions[ - 4] - .value - .toString() - : "", - fontWeight: FontWeight.bold, - color: Colors.white, - fontSize: 28), - AppText( - model.dashboardItemsList - .length > - 0 - ? isInpatient == 'in' - ? model - .dashboardItemsList[ - 0] - .summaryoptions[ - 4] - .kPIParameter - .toString() - : model - .dashboardItemsList[ - 1] - .summaryoptions[ - 4] - .kPIParameter - .toString() - : "", - color: Colors.white, - fontSize: 12, - textAlign: TextAlign.center) - ], - ), + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createOutPatientData( + model))), + Positioned( + child: Column( + children: [ + AppText( + TranslationBase.of( + context) + .outPatient, + fontSize: 11, + fontWeight: + FontWeight.bold, + textOverflow: + TextOverflow + .ellipsis, + ), + AppText( + getPatientCount(model + .dashboardItemsList[1]) + .toString(), + fontSize: 11, + fontWeight: + FontWeight.bold, + ) + ], + ), + top: MediaQuery.of(context) + .size + .height * + 0.08, + left: MediaQuery.of(context) + .size + .width * + 0.09) + ]), ), - Expanded( - child: Container(), - ) ], - ) - ], - )), - imageName: '5.png', - color: HexColor('#B8382C'), - hasBorder: false, - width: MediaQuery.of(context).size.width * 0.9, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.22 - : MediaQuery.of(context).size.height * 0.25, - ), - ], - ), - ), - collapsedChild: Container( - margin: EdgeInsets.only(left: 10, right: 10), - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.15 - : MediaQuery.of(context).size.height * 0.25, - width: double.infinity, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - onTap: () { - setState(() { - this.isExpanded = true; - this.isInpatient = 'in'; - }); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[0]) - : "", - fontSize: - SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - Flexible( - child: AppText( - TranslationBase.of(context).inPatient, - color: Colors.white, - textOverflow: TextOverflow.ellipsis, - )), - ], - ), - Padding( - padding: EdgeInsets.all(5), - child: Column( + )), + Expanded( + flex: 1, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Row( mainAxisAlignment: - MainAxisAlignment.end, + MainAxisAlignment.start, children: [ - Icon( - DoctorApp.in_patient_white, - size: 35, - color: Colors.white, - ) + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[3] + .kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[3].value, + Colors.grey), + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[4] + .kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[4].value, + Colors.grey[300]), + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[5] + .kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[5].value, + Colors.grey[200]) ], - )) - ], - ), - ), - imageName: '4.png', - color: HexColor('#B8382C'), - hasBorder: false, - width: MediaQuery.of(context).size.width * 0.44, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.15 - : MediaQuery.of(context).size.height * 0.25, - ), - DashboardItem( - onTap: () { - setState(() { - isExpanded = true; - this.isInpatient = 'out'; - }); - }, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Column( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[1]) - : "", - fontSize: - SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - Flexible( - child: AppText( - TranslationBase.of(context) - .outPatients, - color: Colors.white, - textOverflow: TextOverflow.ellipsis, )), - ], - ), - Padding( - padding: EdgeInsets.all(5), - child: Column( - mainAxisAlignment: - MainAxisAlignment.end, - children: [ - Icon( - DoctorApp.out_patient, - size: 35, - color: Colors.white, - ) - ], - )) - ], - ), - ), - imageName: '5.png', - color: HexColor('#B8382C'), - hasBorder: false, - width: MediaQuery.of(context).size.width * 0.44, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.15 - : MediaQuery.of(context).size.height * 0.25, - ), + ) + ])) ], - ), - ), - isExpanded: isExpanded, - )) + )) + //ExpandableCardContainer( + // expandedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = false; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 24, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .kPIParameter + // : "", + // //'My Admitted Patient', + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .kPIParameter + // : "", + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )) + // ], + // ), + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // ), + // ), + // Expanded( + // child: Container(), + // ) + // ], + // ) + // ], + // )), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.9, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // collapsedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = true; + // this.isInpatient = 'in'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[0]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context).inPatient, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.in_patient_white, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '4.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // DashboardItem( + // onTap: () { + // setState(() { + // isExpanded = true; + // this.isInpatient = 'out'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[1]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context) + // .outPatients, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.out_patient, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // isExpanded: isExpanded, + // )) + ) ]), FractionallySizedBox( widthFactor: 0.90, @@ -1065,6 +1339,81 @@ class _DashboardScreenState extends State { ); } + static List> _createInpatientData(model) { + final data = [ + new GaugeSegment( + model.dashboardItemsList[0].summaryoptions[0].kPIParameter, + getValue(model.dashboardItemsList[0].summaryoptions[0].value), + charts.MaterialPalette.red.shadeDefault), + new GaugeSegment( + model.dashboardItemsList[0].summaryoptions[1].kPIParameter, + getValue(model.dashboardItemsList[0].summaryoptions[1].value), + charts.MaterialPalette.black.darker), + new GaugeSegment( + model.dashboardItemsList[0].summaryoptions[2].kPIParameter, + getValue(model.dashboardItemsList[0].summaryoptions[2].value), + charts.MaterialPalette.gray.shade800), + new GaugeSegment( + model.dashboardItemsList[0].summaryoptions[3].kPIParameter, + getValue(model.dashboardItemsList[0].summaryoptions[3].value), + charts.MaterialPalette.gray.shadeDefault.lighter), + new GaugeSegment( + model.dashboardItemsList[0].summaryoptions[4].kPIParameter, + getValue(model.dashboardItemsList[0].summaryoptions[4].value), + charts.MaterialPalette.gray.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static List> _createOutPatientData( + model) { + final data = [ + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[0].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[0].value), + charts.MaterialPalette.red.shadeDefault), + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[1].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[1].value), + charts.MaterialPalette.black.darker), + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[2].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[2].value), + charts.MaterialPalette.gray.shade800), + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[3].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[3].value), + charts.MaterialPalette.gray.shadeDefault), + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[4].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[4].value), + charts.MaterialPalette.gray.shadeDefault.lighter), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + colorFn: (GaugeSegment segment, _) => segment.color, + ) + ]; + } + + static int getValue(value) { + return value == 0 ? 1 : value; + } + showCupertinoPicker( {context, List actionList, decKey, onSelectFun}) { showModalBottomSheet( @@ -1165,6 +1514,40 @@ class _DashboardScreenState extends State { return value.toString(); } + + Widget dot(Color c) { + return Container( + padding: EdgeInsets.all(5.0), + margin: EdgeInsets.all(5.0), + decoration: BoxDecoration(color: c, shape: BoxShape.circle)); + } + + Widget rowCount(name, int count, Color c) { + return Row( + children: [ + dot(c), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + name, + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 10, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + '(' + count.toString() + ')', + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 14, + fontWeight: FontWeight.bold, + ) + ], + ), + ], + ); + } } // TODO Move to it file diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 813d7064..8da3a0e0 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -389,7 +389,7 @@ class TranslationBase { String get replay2 => localizedValues['replay2'][locale.languageCode]; - String get outPatient => localizedValues['outPatient'][locale.languageCode]; + String get outPatient => localizedValues['outPatients'][locale.languageCode]; String get logout => localizedValues['logout'][locale.languageCode]; @@ -765,8 +765,7 @@ class TranslationBase { String get postPlansEstimatedCost => localizedValues['postPlansEstimatedCost'][locale.languageCode]; - String get postPlans => - localizedValues['postPlans'][locale.languageCode]; + String get postPlans => localizedValues['postPlans'][locale.languageCode]; String get ucaf => localizedValues['ucaf'][locale.languageCode]; @@ -1085,25 +1084,39 @@ class TranslationBase { localizedValues['clinicSearch'][locale.languageCode]; String get doctorSearch => localizedValues['doctorSearch'][locale.languageCode]; - String get referralResponse => localizedValues['referralResponse'][locale.languageCode]; - String get estimatedCost => localizedValues['estimatedCost'][locale.languageCode]; - String get diagnosisDetail => localizedValues['diagnosisDetail'][locale.languageCode]; - String get referralSuccessMsgAccept => localizedValues['referralSuccessMsgAccept'][locale.languageCode]; - String get referralSuccessMsgReject => localizedValues['referralSuccessMsgReject'][locale.languageCode]; + String get referralResponse => + localizedValues['referralResponse'][locale.languageCode]; + String get estimatedCost => + localizedValues['estimatedCost'][locale.languageCode]; + String get diagnosisDetail => + localizedValues['diagnosisDetail'][locale.languageCode]; + String get referralSuccessMsgAccept => + localizedValues['referralSuccessMsgAccept'][locale.languageCode]; + String get referralSuccessMsgReject => + localizedValues['referralSuccessMsgReject'][locale.languageCode]; String get patientName => localizedValues['patient-name'][locale.languageCode]; - String get appointmentNumber => localizedValues['appointmentNumber'][locale.languageCode]; - String get sickLeaveComments => localizedValues['sickLeaveComments'][locale.languageCode]; - String get pastMedicalHistory => localizedValues['pastMedicalHistory'][locale.languageCode]; - String get pastSurgicalHistory => localizedValues['pastSurgicalHistory'][locale.languageCode]; - String get complications => localizedValues['complications'][locale.languageCode]; + String get appointmentNumber => + localizedValues['appointmentNumber'][locale.languageCode]; + String get sickLeaveComments => + localizedValues['sickLeaveComments'][locale.languageCode]; + String get pastMedicalHistory => + localizedValues['pastMedicalHistory'][locale.languageCode]; + String get pastSurgicalHistory => + localizedValues['pastSurgicalHistory'][locale.languageCode]; + String get complications => + localizedValues['complications'][locale.languageCode]; String get floor => localizedValues['floor'][locale.languageCode]; - String get roomCategory => localizedValues['roomCategory'][locale.languageCode]; - String get otherDepartmentsInterventions => localizedValues['otherDepartmentsInterventions'][locale.languageCode]; - String get otherProcedure => localizedValues['otherProcedure'][locale.languageCode]; - String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; + String get roomCategory => + localizedValues['roomCategory'][locale.languageCode]; + String get otherDepartmentsInterventions => + localizedValues['otherDepartmentsInterventions'][locale.languageCode]; + String get otherProcedure => + localizedValues['otherProcedure'][locale.languageCode]; + String get admissionRequestSuccessMsg => + localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/dashboard/guage_chart.dart b/lib/widgets/dashboard/guage_chart.dart new file mode 100644 index 00000000..ddd649d1 --- /dev/null +++ b/lib/widgets/dashboard/guage_chart.dart @@ -0,0 +1,54 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:flutter/material.dart'; +import 'dart:math'; + +class GaugeChart extends StatelessWidget { + final List seriesList; + final bool animate; + + GaugeChart(this.seriesList, {this.animate}); + + /// Creates a [PieChart] with sample data and no transition. + factory GaugeChart.withSampleData() { + return new GaugeChart( + _createSampleData(), + // Disable animations for image tests. + animate: false, + ); + } + @override + Widget build(BuildContext context) { + return new charts.PieChart(seriesList, + animate: animate, + defaultRenderer: new charts.ArcRendererConfig(arcWidth: 10)); + //); + } + + static List> _createSampleData() { + final data = [ + new GaugeSegment('Low', 75, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Acceptable', 100, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment('High', 50, charts.MaterialPalette.blue.shadeDefault), + new GaugeSegment( + 'Highly Unusual', 55, charts.MaterialPalette.blue.shadeDefault), + ]; + + return [ + new charts.Series( + id: 'Segments', + domainFn: (GaugeSegment segment, _) => segment.segment, + measureFn: (GaugeSegment segment, _) => segment.size, + data: data, + ) + ]; + } +} + +/// Sample data type. +class GaugeSegment { + final String segment; + final int size; + final charts.Color color; + GaugeSegment(this.segment, this.size, this.color); +} From 6bdd4e06a10cf913cce26eb78249284dc27ae6b2 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 15 Feb 2021 19:01:45 +0300 Subject: [PATCH 293/421] dashboard changes --- lib/screens/dashboard_screen.dart | 580 ++++++++++++++++-------------- 1 file changed, 311 insertions(+), 269 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index dba5b965..b4f76ece 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -236,276 +236,318 @@ class _DashboardScreenState extends State { top: MediaQuery.of(context).size.height * .1, child: Container( height: MediaQuery.of(context).size.height * 0.52, - child: Column( - children: [ - RoundedContainer( - height: - MediaQuery.of(context).size.height * 0.24, - margin: 5, - child: Column(children: [ - Expanded( - flex: 3, - child: Row( - children: [ - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[0] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[0] - .value, - Colors.red), - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[1] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[1] - .value, - Colors.black), - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[2] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[2] - .value, - Colors.grey[800]), - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createInpatientData( - model))), - Positioned( - child: Column( - children: [ - AppText( - TranslationBase.of( - context) - .inPatient, - fontSize: 11, - fontWeight: - FontWeight.bold, - ), - AppText( - getPatientCount(model - .dashboardItemsList[0]) - .toString(), - fontSize: 11, - fontWeight: - FontWeight.bold, - ) - ], - ), - top: MediaQuery.of(context) - .size - .height * - 0.08, - left: MediaQuery.of(context) - .size - .width * - 0.10) - ])), - ], - )), - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - rowCount( - model - .dashboardItemsList[0] - .summaryoptions[3] - .kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[3].value, - Colors.grey), - rowCount( - model - .dashboardItemsList[0] - .summaryoptions[4] - .kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[4].value, - Colors.grey[300]), - ], - )), - ) - ])), - RoundedContainer( - height: - MediaQuery.of(context).size.height * 0.24, - margin: 5, - child: Column(children: [ - Expanded( - flex: 3, - child: Row( - children: [ - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[0] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[0] - .value, - Colors.red), - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[1] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[1] - .value, - Colors.black), - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[2] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[2] - .value, - Colors.grey[800]), - ], - ))), - Expanded( + child: model.dashboardItemsList.length > 0 + ? Column( + children: [ + RoundedContainer( + height: + MediaQuery.of(context).size.height * + 0.24, + margin: 5, + child: Column(children: [ + Expanded( flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createOutPatientData( - model))), - Positioned( - child: Column( - children: [ - AppText( - TranslationBase.of( - context) - .outPatient, - fontSize: 11, - fontWeight: - FontWeight.bold, - textOverflow: - TextOverflow - .ellipsis, - ), - AppText( - getPatientCount(model - .dashboardItemsList[1]) - .toString(), - fontSize: 11, - fontWeight: - FontWeight.bold, - ) - ], - ), - top: MediaQuery.of(context) - .size - .height * - 0.08, - left: MediaQuery.of(context) - .size - .width * - 0.09) - ]), - ), - ], - )), - Expanded( - flex: 1, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[3] - .kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[3].value, - Colors.grey), - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[4] - .kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[4].value, - Colors.grey[300]), - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[5] - .kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[5].value, - Colors.grey[200]) - ], - )), - ) - ])) - ], - )) + child: Row( + children: [ + Expanded( + flex: 5, + child: Padding( + padding: + const EdgeInsets + .all(5.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + rowCount( + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 0] + .kPIParameter, + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 0] + .value, + Colors.red), + rowCount( + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 1] + .kPIParameter, + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 1] + .value, + Colors.black), + rowCount( + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 2] + .kPIParameter, + model + .dashboardItemsList[ + 0] + .summaryoptions[ + 2] + .value, + Colors + .grey[800]), + ], + ))), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createInpatientData( + model))), + Positioned( + child: Column( + children: [ + AppText( + TranslationBase.of( + context) + .inPatient, + fontSize: 11, + fontWeight: + FontWeight + .bold, + ), + AppText( + getPatientCount( + model.dashboardItemsList[ + 0]) + .toString(), + fontSize: 11, + fontWeight: + FontWeight + .bold, + ) + ], + ), + top: MediaQuery.of( + context) + .size + .height * + 0.08, + left: MediaQuery.of( + context) + .size + .width * + 0.10) + ])), + ], + )), + Expanded( + flex: 1, + child: Padding( + padding: + const EdgeInsets.all(5.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + rowCount( + model + .dashboardItemsList[0] + .summaryoptions[3] + .kPIParameter, + model + .dashboardItemsList[0] + .summaryoptions[3] + .value, + Colors.grey), + rowCount( + model + .dashboardItemsList[0] + .summaryoptions[4] + .kPIParameter, + model + .dashboardItemsList[0] + .summaryoptions[4] + .value, + Colors.grey[300]), + ], + )), + ) + ])), + RoundedContainer( + height: + MediaQuery.of(context).size.height * + 0.24, + margin: 5, + child: Column(children: [ + Expanded( + flex: 3, + child: Row( + children: [ + Expanded( + flex: 5, + child: Padding( + padding: + const EdgeInsets + .all(5.0), + child: Column( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + rowCount( + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 0] + .kPIParameter, + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 0] + .value, + Colors.red), + rowCount( + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 1] + .kPIParameter, + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 1] + .value, + Colors.black), + rowCount( + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 2] + .kPIParameter, + model + .dashboardItemsList[ + 1] + .summaryoptions[ + 2] + .value, + Colors + .grey[800]), + ], + ))), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart( + _createOutPatientData( + model))), + Positioned( + child: Column( + children: [ + AppText( + TranslationBase.of( + context) + .outPatient, + fontSize: 11, + fontWeight: + FontWeight + .bold, + textOverflow: + TextOverflow + .ellipsis, + ), + AppText( + getPatientCount( + model.dashboardItemsList[ + 1]) + .toString(), + fontSize: 11, + fontWeight: + FontWeight + .bold, + ) + ], + ), + top: MediaQuery.of( + context) + .size + .height * + 0.08, + left: MediaQuery.of( + context) + .size + .width * + 0.09) + ]), + ), + ], + )), + Expanded( + flex: 1, + child: Padding( + padding: + const EdgeInsets.all(5.0), + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[3] + .kPIParameter, + model + .dashboardItemsList[1] + .summaryoptions[3] + .value, + Colors.grey), + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[4] + .kPIParameter, + model + .dashboardItemsList[1] + .summaryoptions[4] + .value, + Colors.grey[300]), + rowCount( + model + .dashboardItemsList[1] + .summaryoptions[5] + .kPIParameter, + model + .dashboardItemsList[1] + .summaryoptions[5] + .value, + Colors.grey[200]) + ], + )), + ) + ])) + ], + ) + : SizedBox()) //ExpandableCardContainer( // expandedChild: Container( // margin: EdgeInsets.only(left: 10, right: 10), From d115564cc181609cb614bc40c6316fe3b3f2778d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 15 Feb 2021 21:40:44 +0200 Subject: [PATCH 294/421] DA-355 --- lib/config/config.dart | 14 +- lib/core/model/item_by_medicine_model.dart | 108 +++++++++++++++ .../model/item_by_medicine_request_model.dart | 18 +++ lib/core/service/prescription_service.dart | 25 ++++ lib/core/viewModel/medicine_view_model.dart | 16 +++ .../viewModel/prescription_view_model.dart | 14 ++ .../prescription/add_prescription_form.dart | 130 ++++++++++-------- 7 files changed, 266 insertions(+), 59 deletions(-) create mode 100644 lib/core/model/item_by_medicine_model.dart create mode 100644 lib/core/model/item_by_medicine_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 6afcb64f..6e7089c3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -27,7 +27,8 @@ const PATIENT_GET_CLINIC_BY_PROJECT_URL = const PROJECT_GET_INFO = "Services/DoctorApplication.svc/REST/GetProjectInfo"; const GET_CLINICS = "Services/DoctorApplication.svc/REST/GetClinics"; -const GET_REFERRAL_FACILITIES = 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; +const GET_REFERRAL_FACILITIES = + 'Services/DoctorApplication.svc/REST/GetReferralFacilities'; const GET_PROJECTS = 'Services/DoctorApplication.svc/REST/GetProjectInfo'; @@ -195,11 +196,16 @@ const DRUG_TO_DRUG = const GET_MEDICAL_FILE = 'Services/DoctorApplication.svc/REST/GetMedicalFile'; const GET_FLOORS = 'Services/DoctorApplication.svc/REST/GetFloors'; const GET_WARDS = 'Services/DoctorApplication.svc/REST/GetWards'; -const GET_ROOM_CATEGORIES = 'Services/DoctorApplication.svc/REST/GetRoomCategories'; -const GET_DIAGNOSIS_TYPES = 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; +const GET_ROOM_CATEGORIES = + 'Services/DoctorApplication.svc/REST/GetRoomCategories'; +const GET_DIAGNOSIS_TYPES = + 'Services/DoctorApplication.svc/REST/DiagnosisTypes'; const GET_DIET_TYPES = 'Services/DoctorApplication.svc/REST/DietTypes'; const GET_ICD_CODES = 'Services/DoctorApplication.svc/REST/GetICDCodes'; -const POST_ADMISSION_REQUEST = 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const POST_ADMISSION_REQUEST = + 'Services/DoctorApplication.svc/REST/PostAdmissionRequest'; +const GET_ITEM_BY_MEDICINE = + 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; var selectedPatientType = 1; diff --git a/lib/core/model/item_by_medicine_model.dart b/lib/core/model/item_by_medicine_model.dart new file mode 100644 index 00000000..0a93a4f1 --- /dev/null +++ b/lib/core/model/item_by_medicine_model.dart @@ -0,0 +1,108 @@ +class ItemByMedicineModel { + List frequencies; + List routes; + List strengths; + + ItemByMedicineModel({this.frequencies, this.routes, this.strengths}); + + ItemByMedicineModel.fromJson(Map json) { + if (json['frequencies'] != null) { + frequencies = new List(); + json['frequencies'].forEach((v) { + frequencies.add(new Frequencies.fromJson(v)); + }); + } + if (json['routes'] != null) { + routes = new List(); + json['routes'].forEach((v) { + routes.add(new Routes.fromJson(v)); + }); + } + if (json['strengths'] != null) { + strengths = new List(); + json['strengths'].forEach((v) { + strengths.add(new Strengths.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.frequencies != null) { + data['frequencies'] = this.frequencies.map((v) => v.toJson()).toList(); + } + if (this.routes != null) { + data['routes'] = this.routes.map((v) => v.toJson()).toList(); + } + if (this.strengths != null) { + data['strengths'] = this.strengths.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class Frequencies { + String description; + bool isDefault; + int parameterCode; + + Frequencies({this.description, this.isDefault, this.parameterCode}); + + Frequencies.fromJson(Map json) { + description = json['description']; + isDefault = json['isDefault']; + parameterCode = json['parameterCode']; + } + + Map toJson() { + final Map data = new Map(); + data['description'] = this.description; + data['isDefault'] = this.isDefault; + data['parameterCode'] = this.parameterCode; + return data; + } +} + +class Strengths { + String description; + bool isDefault; + int parameterCode; + + Strengths({this.description, this.isDefault, this.parameterCode}); + + Strengths.fromJson(Map json) { + description = json['description']; + isDefault = json['isDefault']; + parameterCode = json['parameterCode']; + } + + Map toJson() { + final Map data = new Map(); + data['description'] = this.description; + data['isDefault'] = this.isDefault; + data['parameterCode'] = this.parameterCode; + return data; + } +} + +class Routes { + String description; + bool isDefault; + int parameterCode; + + Routes({this.description, this.isDefault, this.parameterCode}); + + Routes.fromJson(Map json) { + description = json['description']; + isDefault = json['isDefault']; + parameterCode = json['parameterCode']; + } + + Map toJson() { + final Map data = new Map(); + data['description'] = this.description; + data['isDefault'] = this.isDefault; + data['parameterCode'] = this.parameterCode; + return data; + } +} diff --git a/lib/core/model/item_by_medicine_request_model.dart b/lib/core/model/item_by_medicine_request_model.dart new file mode 100644 index 00000000..7460044b --- /dev/null +++ b/lib/core/model/item_by_medicine_request_model.dart @@ -0,0 +1,18 @@ +class ItemByMedicineRequestModel { + String vidaAuthTokenID; + int medicineCode; + + ItemByMedicineRequestModel({this.vidaAuthTokenID, this.medicineCode}); + + ItemByMedicineRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + medicineCode = json['MedicineCode']; + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['MedicineCode'] = this.medicineCode; + return data; + } +} diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 4258ee81..54640fcc 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; @@ -23,8 +24,13 @@ class PrescriptionService extends LookupService { List allMedicationList = []; List specialityList = []; List drugToDrug = []; + List itemMedicineList = []; + List itemMedicineListRoute = []; + List itemMedicineListUnit = []; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); + ItemByMedicineRequestModel _itemByMedicineRequestModel = + ItemByMedicineRequestModel(); SearchDrugRequestModel _drugRequestModel = SearchDrugRequestModel( //search: ["Acetaminophen"], search: ["Amoxicillin"], @@ -32,6 +38,25 @@ class PrescriptionService extends LookupService { PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); + + Future getItem({int itemID}) async { + _itemByMedicineRequestModel = + ItemByMedicineRequestModel(medicineCode: itemID); + + hasError = false; + + await baseAppClient.post(GET_ITEM_BY_MEDICINE, + onSuccess: (dynamic response, int statusCode) { + itemMedicineList = []; + itemMedicineList = response['listItemByMedicineCode']['frequencies']; + itemMedicineListRoute = response['listItemByMedicineCode']['routes']; + itemMedicineListUnit = response['listItemByMedicineCode']['strengths']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _itemByMedicineRequestModel.toJson()); + } + Future getPatientAssessment( GetAssessmentReqModel getAssessmentReqModel) async { hasError = false; diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index f57de2b3..272c5228 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -35,6 +35,22 @@ class MedicineViewModel extends BaseViewModel { List get allMedicationList => _prescriptionService.allMedicationList; + List get itemMedicineList => _prescriptionService.itemMedicineList; + List get itemMedicineListRoute => + _prescriptionService.itemMedicineListRoute; + List get itemMedicineListUnit => + _prescriptionService.itemMedicineListUnit; + Future getItem({int itemID}) async { + //hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.BusyLocal); + await _prescriptionService.getItem(itemID: itemID); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } Future getMedicineItem(String itemName) async { setState(ViewState.Busy); diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 34f86ffd..63dc19c5 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -22,6 +22,20 @@ class PrescriptionViewModel extends BaseViewModel { List get drugsList => _prescriptionService.doctorsList; //List get allMedicationList => _prescriptionService.allMedicationList; + List get itemMedicineList => _prescriptionService.itemMedicineList; + + Future getItem({int itemID}) async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.BusyLocal); + await _prescriptionService.getItem(itemID: itemID); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } + Future getPrescription({int mrn}) async { hasError = false; //_insuranceCardService.clearInsuranceCard(); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index f00bfe72..881dc2de 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -201,6 +201,7 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationDoseTime(); //await model.getMedicationIndications(); await model.getPatientAssessment(getAssessmentReqModel); + await model.getItem(); }, builder: ( BuildContext context, @@ -251,12 +252,23 @@ class _PrescriptionFormWidgetState extends State { Helpers.hideKeyboard(context); setState(() { _selectedMedication = null; + model.getItem( + itemID: _selectedMedication + .itemId); }); } : null, child: _selectedMedication == null ? AutoCompleteTextField< GetMedicationResponseModel>( + onFocusChanged: (__) { + _selectedMedication != null + ? model.getItem( + itemID: + _selectedMedication + .itemId) + : null; + }, decoration: textFieldSelectorDecoration( TranslationBase.of(context) @@ -297,6 +309,11 @@ class _PrescriptionFormWidgetState extends State { input.toLowerCase()), ) : TextField( + onEditingComplete: () { + model.getItem( + itemID: _selectedMedication + .itemId); + }, decoration: textFieldSelectorDecoration( TranslationBase.of(context) @@ -353,7 +370,10 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of(context) .strength, controller: strengthController, - keyboardType: TextInputType.numberWithOptions(decimal: true,), + keyboardType: + TextInputType.numberWithOptions( + decimal: true, + ), onChanged: (String value) { setState(() { strengthChar = value.length; @@ -383,50 +403,46 @@ class _PrescriptionFormWidgetState extends State { .width * 0.350, child: InkWell( - onTap: - model.medicationStrengthList != - null - ? () { - Helpers.hideKeyboard( - context); - ListSelectDialog - dialog = - ListSelectDialog( - list: model - .medicationStrengthList, - attributeName: - 'nameEn', - attributeValueId: - 'id', - okText: - TranslationBase.of( - context) - .ok, - okFunction: - (selectedValue) { - setState(() { - units = - selectedValue; - }); - }, - ); - showDialog( - barrierDismissible: - false, - context: context, - builder: (BuildContext - context) { - return dialog; - }, - ); - } - : null, + onTap: model.itemMedicineListUnit != + null + ? () { + Helpers.hideKeyboard( + context); + ListSelectDialog dialog = + ListSelectDialog( + list: model + .itemMedicineListUnit, + attributeName: + 'description', + attributeValueId: + 'parameterCode', + okText: + TranslationBase.of( + context) + .ok, + okFunction: + (selectedValue) { + setState(() { + units = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext + context) { + return dialog; + }, + ); + } + : null, child: TextField( decoration: textFieldSelectorDecoration( 'UNIT Type', units != null - ? units['nameEn'] + ? units['description'] : null, true), enabled: false, @@ -440,14 +456,16 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.medicationRouteList != null + onTap: model.itemMedicineListRoute != null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', + list: + model.itemMedicineListRoute, + attributeName: 'description', + attributeValueId: + 'parameterCode', okText: TranslationBase.of(context) .ok, @@ -475,7 +493,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( TranslationBase.of(context).route, route != null - ? route['nameEn'] + ? route['description'] : null, true), enabled: false, @@ -486,16 +504,15 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.medicationFrequencyList != - null + onTap: model.itemMedicineList != null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: model - .medicationFrequencyList, - attributeName: 'nameEn', - attributeValueId: 'id', + list: model.itemMedicineList, + attributeName: 'description', + attributeValueId: + 'parameterCode', okText: TranslationBase.of(context) .ok, @@ -520,7 +537,7 @@ class _PrescriptionFormWidgetState extends State { TranslationBase.of(context) .frequency, frequency != null - ? frequency['nameEn'] + ? frequency['description'] : null, true), enabled: false, @@ -796,16 +813,19 @@ class _PrescriptionFormWidgetState extends State { // .join(' '), dose: strengthController.text, doseUnit: - units['id'].toString(), + units['parameterCode'] + .toString(), patient: widget.patient, doseTimeIn: doseTime['id'].toString(), model: widget.model, duration: duration['id'].toString(), - frequency: frequency['id'] + frequency: + frequency['parameterCode'] + .toString(), + route: route['parameterCode'] .toString(), - route: route['id'].toString(), drugId: _selectedMedication .itemId .toString(), From 958a341c3b52527c4e68a08c4d5ad0f539c3342e Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 16 Feb 2021 08:40:40 +0300 Subject: [PATCH 295/421] sick leave --- lib/core/service/sickleave_service.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index d188836c..3ef8229f 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; import 'package:doctor_app_flutter/models/sickleave/add_sickleave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/extend_sick_leave_request.dart'; import 'package:doctor_app_flutter/models/sickleave/get_all_sickleave_response.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; // import 'package:doctor_app_flutter/models/dashboard/dashboard_model.dart'; class SickLeaveService extends BaseService { @@ -54,8 +55,9 @@ class SickLeaveService extends BaseService { return Future.value(response); }, onFailure: (String error, int statusCode) { - hasError = true; - super.error = error; + DrAppToastMsg.showErrorToast(error); + // hasError = true; + // super.error = error; }, body: addSickLeaveRequest.toJson(), ); From 963fe42cd856509dbf54b553a04f70601c46d34b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Feb 2021 14:30:50 +0200 Subject: [PATCH 296/421] new changes --- lib/core/viewModel/medicine_view_model.dart | 4 ++-- lib/screens/prescription/add_prescription_form.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 272c5228..ecb0a48a 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -43,11 +43,11 @@ class MedicineViewModel extends BaseViewModel { Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); + setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 881dc2de..68d4e633 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -201,7 +201,7 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationDoseTime(); //await model.getMedicationIndications(); await model.getPatientAssessment(getAssessmentReqModel); - await model.getItem(); + //await model.getItem(); }, builder: ( BuildContext context, From 57aea2ba4fa4cc45604c97482b7b8d1aefe78b4b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Feb 2021 15:44:47 +0200 Subject: [PATCH 297/421] pharmacy remarks --- lib/core/viewModel/medicine_view_model.dart | 4 ++-- lib/screens/prescription/add_prescription_form.dart | 2 +- lib/screens/prescription/prescription_screen.dart | 9 +++------ 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index ecb0a48a..272c5228 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -43,11 +43,11 @@ class MedicineViewModel extends BaseViewModel { Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.Busy); + setState(ViewState.BusyLocal); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.Error); + setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 68d4e633..881dc2de 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -201,7 +201,7 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationDoseTime(); //await model.getMedicationIndications(); await model.getPatientAssessment(getAssessmentReqModel); - //await model.getItem(); + await model.getItem(); }, builder: ( BuildContext context, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index f7012f1d..3e62d6e0 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -383,12 +383,9 @@ class _NewPrescriptionScreenState extends State { ), Expanded( child: AppText( - "", // commening below code because there is an error coming in the model please fix it before pushing it - // model.prescriptionList[0].entityList[index].pharmacistRemarks == null - // ? "" - // : model.prescriptionList[0].entityList[index].pharmacistRemarks, - fontSize: - 15.0), + // commening below code because there is an error coming in the model please fix it before pushing it + model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, + fontSize: 15.0), ) ], ), From 2ee2429c70bf096feeae6bf5a5570d4240080f50 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 16 Feb 2021 16:09:32 +0200 Subject: [PATCH 298/421] Date Formate change --- .../prescription/add_prescription_form.dart | 2 +- .../prescription/prescription_screen.dart | 29 ++++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 881dc2de..68d4e633 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -201,7 +201,7 @@ class _PrescriptionFormWidgetState extends State { await model.getMedicationDoseTime(); //await model.getMedicationIndications(); await model.getPatientAssessment(getAssessmentReqModel); - await model.getItem(); + //await model.getItem(); }, builder: ( BuildContext context, diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 3e62d6e0..4800c361 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -209,16 +209,17 @@ class _NewPrescriptionScreenState extends State { child: Column( children: [ AppText( - DateTime.parse(model - .prescriptionList[ - 0] - .entityList[ - index] - .createdOn) - .day + (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + .toString() + : DateTime.now() + .year) .toString(), color: Colors .green, + fontSize: + 13.5, ), AppText( Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != @@ -230,7 +231,19 @@ class _NewPrescriptionScreenState extends State { .toUpperCase(), color: Colors .green, - ) + ), + AppText( + DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .createdOn) + .day + .toString(), + color: Colors + .green, + ), ], ), ), From 9ed5a294ab3d443f27910d10d925cea77dd07437 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 16 Feb 2021 18:50:15 +0300 Subject: [PATCH 299/421] dashboard changes --- lib/screens/dashboard_screen.dart | 208 +++++++++++------- .../profile/profile-welcome-widget.dart | 14 +- 2 files changed, 133 insertions(+), 89 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b4f76ece..d2369e9d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -62,6 +62,7 @@ class _DashboardScreenState extends State { bool isExpanded = false; String isInpatient = ""; var clinicName = []; + var clinicId = 1; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -140,90 +141,139 @@ class _DashboardScreenState extends State { Column( children: [ ProfileWelcomeWidget( - InkWell( - onTap: () async { - showCupertinoPicker( - decKey: '', - context: context, - actionList: projectsProvider.doctorClinicsList); - }, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, + Container( + width: MediaQuery.of(context).size.width * .6, + // height: 100, + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.white, + isExpanded: true, + value: clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, children: [ - SizedBox( - height: 4, - ), - InkWell( - onTap: () async { - showCupertinoPicker( - decKey: '', - context: context, - actionList: projectsProvider - .doctorClinicsList); - }, - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Container( - child: AppText( - authProvider.selectedClinicName != - null - ? authProvider - .selectedClinicName - : authProvider.doctorProfile - .clinicDescription, - fontSize: - SizeConfig.textMultiplier * - 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - alignment: projectsProvider.isArabic - ? Alignment.topRight - : Alignment.topLeft, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.start, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - InkWell( - child: Container( - margin: EdgeInsets.only( - left: 5, - top: projectsProvider - .isArabic - ? 0 - : 5, - right: 10, - bottom: projectsProvider - .isArabic - ? 15 - : 7), - child: Icon( - DoctorApp.sync_icon, - color: Colors.white, - size: SizeConfig - .textMultiplier * - 1.8, - )), - ), - ], - ), - ]), + AppText( + item.clinicName, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Colors.white, ), ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic(newValue, context); + }, + items: projectsProvider.doctorClinicsList.map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: TextAlign.end, ), - ]), + value: item.clinicID, + ); + }).toList(), + )), ), ), + // InkWell( + // onTap: () async { + // showCupertinoPicker( + // decKey: '', + // context: context, + // actionList: projectsProvider.doctorClinicsList); + // }, + // child: Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // SizedBox( + // height: 4, + // ), + // InkWell( + // onTap: () async { + // // showCupertinoPicker( + // // decKey: '', + // // context: context, + // // actionList: projectsProvider + // // .doctorClinicsList); + // }, + // child: + // Container( + // alignment: projectsProvider.isArabic + // ? Alignment.topRight + // : Alignment.topLeft, + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + + // Container( + // child: AppText( + // authProvider.selectedClinicName != + // null + // ? authProvider + // .selectedClinicName + // : authProvider.doctorProfile + // .clinicDescription, + // fontSize: + // SizeConfig.textMultiplier * + // 1.7, + // color: Colors.white, + // textAlign: TextAlign.center, + // ), + // alignment: projectsProvider.isArabic + // ? Alignment.topRight + // : Alignment.topLeft, + // ), + // Row( + // mainAxisAlignment: + // MainAxisAlignment.start, + // mainAxisSize: MainAxisSize.max, + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // InkWell( + // child: Container( + // margin: EdgeInsets.only( + // left: 5, + // top: projectsProvider + // .isArabic + // ? 0 + // : 5, + // right: 10, + // bottom: + // projectsProvider + // .isArabic + // ? 15 + // : 7), + // child: Icon( + // Icons.arrow_drop_down, + // color: Colors.white, + // size: SizeConfig + // .textMultiplier * + // 3, + // )), + // ), + // ], + //), + // ])), + // ), + // ], + // ), + //]), + // ), + // ), Container( color: Colors.white, height: MediaQuery.of(context).size.height * 0.45, @@ -1522,7 +1572,7 @@ class _DashboardScreenState extends State { } changeClinic(clinicId, BuildContext context) async { - Navigator.pop(context); + // Navigator.pop(context); changeIsLoading(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index ac61f838..fe5a9c9b 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -7,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; class ProfileWelcomeWidget extends StatelessWidget { - final Widget clinicWidget; -final double height; + final double height; ProfileWelcomeWidget(this.clinicWidget, {this.height = 140}); @@ -43,7 +42,7 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).dr + + TranslationBase.of(context).dr + ' ${authProvider.doctorProfile.doctorName}', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, @@ -62,16 +61,12 @@ final double height; mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.end, children: [ - CircleAvatar( - // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(10), - + borderRadius: BorderRadius.circular(10), child: Image.network( - authProvider - .doctorProfile.doctorImageURL, + authProvider.doctorProfile.doctorImageURL, fit: BoxFit.fill, width: 70, height: 60, @@ -79,7 +74,6 @@ final double height; ), backgroundColor: Colors.transparent, ) - ], ), ), From 54ad8bde0b658041db1db80cb9895d581b64e1de Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 17 Feb 2021 15:39:17 +0200 Subject: [PATCH 300/421] design inhancment --- .../update_prescription_form.dart | 156 ++++++++++-------- lib/screens/procedures/procedure_screen.dart | 116 +++++++------ 2 files changed, 152 insertions(+), 120 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 6086c278..c50059f2 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -558,78 +558,90 @@ class _UpdatePrescriptionFormState extends State { height: 12.0, ), Container( - height: screenSize.height * 0.070, - width: double.infinity, - child: Row( - children: [ - Container( - width: MediaQuery.of(context) - .size - .width * - 0.29, - child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - decoration: - textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString() - : '', - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - Container( - width: MediaQuery.of(context) - .size - .width * - 0.61, - child: InkWell( - onTap: indicationList != null - ? () { - Helpers.hideKeyboard( - context); - } - : null, - child: TextField( - maxLines: 3, - decoration: - textFieldSelectorDecoration( - model.patientAssessmentList - .isNotEmpty - ? model - .patientAssessmentList[ - 0] - .asciiDesc - .toString() - : '', - indication != null - ? indication['name'] - : null, - true), - enabled: true, - readOnly: true, - ), - ), - ), - ], - ), - ), + height: model.patientAssessmentList + .isNotEmpty + ? screenSize.height * 0.070 + : 0.0, + width: model.patientAssessmentList + .isNotEmpty + ? double.infinity + : 0.0, + child: model.patientAssessmentList + .isNotEmpty + ? Row( + children: [ + Container( + width: + MediaQuery.of(context) + .size + .width * + 0.29, + child: InkWell( + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() + : '', + indication != null + ? indication[ + 'name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + Container( + width: + MediaQuery.of(context) + .size + .width * + 0.61, + child: InkWell( + onTap: + indicationList != null + ? () { + Helpers.hideKeyboard( + context); + } + : null, + child: TextField( + maxLines: 3, + decoration: textFieldSelectorDecoration( + model.patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .asciiDesc + .toString() + : '', + indication != null + ? indication[ + 'name'] + : null, + true), + enabled: true, + readOnly: true, + ), + ), + ), + ], + ) + : null), SizedBox( height: 12.0, ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 1e225ce9..afe8a63e 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -221,49 +221,69 @@ class _ProcedureScreenState extends State { child: Column( children: [ AppText( - DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .day - .toString(), - color: - Colors.green, - ), + DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .year + .toString(), + color: model + .procedureList[ + 0] + .entityList[ + index] + .orderType == + 0 + ? Color( + 0xFFB9382C) + : Colors + .green), AppText( - Helpers.getMonth(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate != - null - ? (DateTime.parse(model - .procedureList[ - 0] - .entityList[ - index] - .orderDate) - .month) - : DateTime - .now() - .month) - .toUpperCase(), - color: - Colors.green, - ) + Helpers.getMonth(model.procedureList[0].entityList[index].orderDate != + null + ? (DateTime.parse(model.procedureList[0].entityList[index].orderDate) + .month) + : DateTime.now() + .month) + .toUpperCase(), + color: model + .procedureList[ + 0] + .entityList[ + index] + .orderType == + 0 + ? Color( + 0xFFB9382C) + : Colors + .green), + AppText( + DateTime.parse(model + .procedureList[ + 0] + .entityList[ + index] + .orderDate) + .day + .toString(), + color: model + .procedureList[ + 0] + .entityList[ + index] + .orderType == + 0 + ? Color( + 0xFFB9382C) + : Colors + .green), ], ), ), Expanded( child: Container( - // height: MediaQuery.of( - // context) - // .size - // .height * - // 0.21, width: MediaQuery.of( context) .size @@ -308,17 +328,17 @@ class _ProcedureScreenState extends State { 13.0, ), Expanded( - child: - AppText( - model.procedureList[0].entityList[index].orderType == - 1 - ? 'Routine' - : 'Urgent', - fontSize: - 11.5, - color: Color( - 0xFFB9382C), - ), + child: AppText( + model.procedureList[0].entityList[index].orderType == + 1 + ? 'Routine' + : 'Urgent', + fontSize: + 13.5, + color: model.procedureList[0].entityList[index].orderType == + 0 + ? Color(0xFFB9382C) + : Colors.green), ), ], ), From 0f15732728a27b62fbc16f8a0f753a49184e052f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 17 Feb 2021 15:44:15 +0200 Subject: [PATCH 301/421] design inhancment --- lib/core/viewModel/medicine_view_model.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 272c5228..ecb0a48a 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -43,11 +43,11 @@ class MedicineViewModel extends BaseViewModel { Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); - setState(ViewState.BusyLocal); + setState(ViewState.Busy); await _prescriptionService.getItem(itemID: itemID); if (_prescriptionService.hasError) { error = _prescriptionService.error; - setState(ViewState.ErrorLocal); + setState(ViewState.Error); } else setState(ViewState.Idle); } From ae17998e0ae4a87cef20078048274cba0bcddeb2 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 17 Feb 2021 20:56:00 +0200 Subject: [PATCH 302/421] Design inhancment --- .../prescription/add_prescription_form.dart | 12 +++---- .../update_prescription_form.dart | 34 ++++++++++++++++--- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 68d4e633..b25d3928 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -360,12 +360,12 @@ class _PrescriptionFormWidgetState extends State { .width * 0.550, child: TextFields( - // inputFormatters: [ - // LengthLimitingTextInputFormatter( - // 4), - // WhitelistingTextInputFormatter - // .digitsOnly - // ], + inputFormatters: [ + LengthLimitingTextInputFormatter( + 4), + // WhitelistingTextInputFormatter + // .digitsOnly + ], hintText: TranslationBase.of(context) .strength, diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index c50059f2..ace71350 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -115,7 +115,7 @@ class _UpdatePrescriptionFormState extends State { (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { - await model.getMedicationList(); + //await model.getMedicationList(); await model.getMedicationStrength(); await model.getMedicationDuration(); await model.getMedicationRoute(); @@ -257,14 +257,17 @@ class _UpdatePrescriptionFormState extends State { inputFormatters: [ LengthLimitingTextInputFormatter( 4), - WhitelistingTextInputFormatter - .digitsOnly + // WhitelistingTextInputFormatter + // .digitsOnly ], + hintText: widget.doseStreangth, fontSize: 15.0, controller: strengthController, - keyboardType: - TextInputType.number, + keyboardType: TextInputType + .numberWithOptions( + decimal: true, + ), onChanged: (String value) { setState(() { strengthChar = value.length; @@ -700,6 +703,27 @@ class _UpdatePrescriptionFormState extends State { title: 'update prescription' .toUpperCase(), onPressed: () { + if (int.parse( + strengthController.text) > + 1000) { + DrAppToastMsg.showErrorToast( + "1000 is the MAX for the strength"); + return; + } + if (int.parse(strengthController + .text) == + 0) { + DrAppToastMsg.showErrorToast( + "Streangth can't be zero"); + return; + } + if (strengthController + .text.length > + 4) { + DrAppToastMsg.showErrorToast( + "Streangth can't be zero"); + return; + } updatePrescription( newStartDate: selectedDate, newDoseStreangth: From 214dfecb3ce5a7cd2413be64bf73d90502fadcd6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 18 Feb 2021 14:07:21 +0300 Subject: [PATCH 303/421] DA-422 --- lib/config/localized_values.dart | 4 + lib/screens/sick-leave/add-sickleave.dart | 10 +- lib/screens/sick-leave/sick_leave.dart | 150 ++++++++++++---------- lib/util/translations_delegate_base.dart | 3 + 4 files changed, 101 insertions(+), 66 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6daeb5a2..f9f7d6b6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -734,4 +734,8 @@ const Map> localizedValues = { 'orderNo': {'en': "Order No : ", 'ar': "رقم الطلب"}, 'infoStatus': {'en': "Info Status", 'ar': "حالة المعلومات"}, 'doctorResponse': {'en': "Doctor Response", 'ar': "استجابة الطبيب"}, + 'sickleaveonhold': { + 'en': "A Sick leave is on Hold status for this patient", + 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" + }, }; diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 81d62513..ad74b760 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -6,6 +6,7 @@ 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'; @@ -122,7 +123,14 @@ class AddSickLeavScreen extends StatelessWidget { ), // color: Colors.green, //Colors.black, onPressed: () => { - if (item.status != 1) + if (item.status == 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + else { openSickLeave(context, true, extendedData: item) diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 103c133b..f8433fb0 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -84,10 +84,10 @@ class _SickLeaveScreenState extends State { onModelReady: (model2) => model2.preSickLeaveStatistics( widget.appointmentNo, widget.patientMRN), builder: (_, model2, w) => GestureDetector( - onTap: (){ - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( baseViewModel: model2, isShowAppBar: false, body: Center( @@ -113,10 +113,12 @@ class _SickLeaveScreenState extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppTextFormField( borderColor: Colors.white, @@ -144,14 +146,15 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ // AppText( // TranslationBase.of(context).sickLeaveDate, @@ -168,7 +171,8 @@ class _SickLeaveScreenState extends State { textInputType: TextInputType.number, controller: _toDateController, onTap: () { - _presentDatePicker('_selectedToDate'); + _presentDatePicker( + '_selectedToDate'); }, inputFormatter: ONLY_DATE, onChanged: (value) { @@ -184,8 +188,8 @@ class _SickLeaveScreenState extends State { margin: EdgeInsets.only( top: 10, left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -193,7 +197,8 @@ class _SickLeaveScreenState extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -209,55 +214,59 @@ class _SickLeaveScreenState extends State { children: [ Expanded( // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - isExpanded: true, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( + child: + DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + isExpanded: true, + value: getClinicName( + model) ?? + "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: < + Widget>[ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + color: Colors + .grey, + ), + ], + ); + }).toList(); + }, + onChanged: + (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item + .toString(), + child: Text( item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: - Colors.grey, + textAlign: + TextAlign + .end, ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), + ); + }).toList(), + ))), ), ], ) @@ -285,7 +294,8 @@ class _SickLeaveScreenState extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -317,7 +327,8 @@ class _SickLeaveScreenState extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -364,7 +375,8 @@ class _SickLeaveScreenState extends State { model2.sickleaveResponse[ 'ListSickLeavesToExtent'] ['success']); - Navigator.of(context).popUntil((route) { + Navigator.of(context) + .popUntil((route) { return route.settings.name == PATIENTS_PROFILE; }); @@ -396,7 +408,7 @@ class _SickLeaveScreenState extends State { ), ), ), - ))); + ))); } void _validateInputs(model2) async { @@ -413,7 +425,15 @@ class _SickLeaveScreenState extends State { } else { addSickLeave.patientMRN = widget.patient.patientMRN.toString(); addSickLeave.appointmentNo = widget.patient.appointmentNo.toString(); - model2.addSickLeave(addSickLeave).then((value) => print(value)); + await model2.addSickLeave(addSickLeave).then((value) => print(value)); + + DrAppToastMsg.showSuccesToast( + model2.sickleaveResponse['ListSickLeavesToExtent']['success']); + Navigator.of(context).popUntil((route) { + return route.settings.name == PATIENTS_PROFILE; + }); + Navigator.of(context) + .pushNamed(ADD_SICKLEAVE, arguments: {'patient': widget.patient}); } } catch (err) { print(err); diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 761edfbf..311e5f78 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1120,6 +1120,9 @@ class TranslationBase { String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; + + String get sickleaveonhold => + localizedValues['sickleaveonhold'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f32d25b007b0d3b9e9756d41bbf3f0ec2505ade3 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 21 Feb 2021 14:45:01 +0200 Subject: [PATCH 304/421] updating prescription after backend fix --- lib/core/model/post_prescrition_req_model.dart | 2 +- .../prescription/add_prescription_form.dart | 14 +++++++------- .../prescription/update_prescription_form.dart | 15 ++++++++------- lib/screens/procedures/add-procedure-form.dart | 8 +++----- .../entity_list_checkbox_search_widget.dart | 8 ++++---- lib/screens/procedures/update-procedure.dart | 18 +++++++++++------- 6 files changed, 34 insertions(+), 31 deletions(-) diff --git a/lib/core/model/post_prescrition_req_model.dart b/lib/core/model/post_prescrition_req_model.dart index 6fc71199..06a524ed 100644 --- a/lib/core/model/post_prescrition_req_model.dart +++ b/lib/core/model/post_prescrition_req_model.dart @@ -47,7 +47,7 @@ class PrescriptionRequestModel { int itemId; String doseStartDate; int duration; - int dose; + double dose; int doseUnitId; int route; int frequency; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b25d3928..5ec6e240 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -61,7 +61,7 @@ postProcedure( sss.add(PrescriptionRequestModel( covered: true, - dose: int.parse(dose), + dose: double.parse(dose), itemId: drugId.isEmpty ? 1 : int.parse(drugId), doseUnitId: int.parse(doseUnit), route: route.isEmpty ? 1 : int.parse(route), @@ -361,8 +361,8 @@ class _PrescriptionFormWidgetState extends State { 0.550, child: TextFields( inputFormatters: [ - LengthLimitingTextInputFormatter( - 4), + // LengthLimitingTextInputFormatter( + // 4), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -767,16 +767,16 @@ class _PrescriptionFormWidgetState extends State { "Please Fill All Fields"); return; } - if (int.parse( + if (double.parse( strengthController.text) > - 1000) { + 1000.0) { DrAppToastMsg.showErrorToast( "1000 is the MAX for the strength"); return; } - if (int.parse( + if (double.parse( strengthController.text) == - 0) { + 0.0) { DrAppToastMsg.showErrorToast( "Streangth can't be zero"); return; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index ace71350..8ed5c79b 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -703,16 +703,17 @@ class _UpdatePrescriptionFormState extends State { title: 'update prescription' .toUpperCase(), onPressed: () { - if (int.parse( + if (double.parse( strengthController.text) > - 1000) { + 1000.0) { DrAppToastMsg.showErrorToast( "1000 is the MAX for the strength"); return; } - if (int.parse(strengthController - .text) == - 0) { + if (double.parse( + strengthController + .text) == + 0.0) { DrAppToastMsg.showErrorToast( "Streangth can't be zero"); return; @@ -872,8 +873,8 @@ class _UpdatePrescriptionFormState extends State { sss.add(PrescriptionRequestModel( covered: true, dose: newDoseStreangth.isNotEmpty - ? int.parse(newDoseStreangth) - : int.parse(doseStreangth), + ? double.parse(newDoseStreangth) + : double.parse(doseStreangth), //frequency.isNotEmpty ? int.parse(dose) : 1, itemId: drugId, doseUnitId: diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 2fa0c428..346de2db 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -25,14 +25,15 @@ postProcedure( PatiantInformtion patient, List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); - List controls = List(); List controlsProcedure = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; postProcedureReqModel.episodeID = patient.episodeNo; postProcedureReqModel.patientMRN = patient.patientMRN; + entityList.forEach((element) { + List controls = List(); controls.add( Controls( code: "remarks", @@ -41,16 +42,13 @@ postProcedure( controls.add( Controls(code: "ordertype", controlValue: element.type), ); - }); - - entityList.forEach((element) { controlsProcedure.add(Procedures( category: element.categoryID, procedure: element.procedureId, controls: controls)); }); - postProcedureReqModel.procedures = controlsProcedure; + postProcedureReqModel.procedures = controlsProcedure; await model.postProcedure(postProcedureReqModel, patient.patientMRN); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 73cf0115..f68b88cd 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -136,8 +136,8 @@ class _EntityListCheckboxSearchWidgetState historyInfo.type = setSelectedType(value) .toString(); - // historyInfo.type = - // value.toString(); + historyInfo.type = + value.toString(); }, ), Text('routine'), @@ -149,8 +149,8 @@ class _EntityListCheckboxSearchWidgetState historyInfo.type = setSelectedType(value) .toString(); - // historyInfo.type = - // value.toString(); + historyInfo.type = + value.toString(); }, ), Text(TranslationBase.of(context) diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 038b5d59..c6af1358 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -91,7 +91,7 @@ class _UpdateProcedureWidgetState extends State { builder: (BuildContext context, ProcedureViewModel model, Widget child) => NetworkBaseView( - baseViewModel: widget.model, + baseViewModel: model, child: DraggableScrollableSheet( minChildSize: 0.90, initialChildSize: 0.95, @@ -310,12 +310,16 @@ class _UpdateProcedureWidgetState extends State { updateProcedureReqModel.lineItemNo = 1; updateProcedureReqModel.orderNo = orderNo; - controls.add( - Controls(code: "remarks", controlValue: remarks.isEmpty ? '' : remarks), - ); - controls.add( - Controls(code: "ordertype", controlValue: "1"), - ); + entityList.forEach((element) { + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks.isNotEmpty ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: '1'), + ); + }); entityList.isNotEmpty ? entityList.forEach((element) { From 63d73b60e1fa90a19d30eb36d13337adbe35d180 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Feb 2021 17:35:10 +0300 Subject: [PATCH 305/421] ios faceid issue --- ios/Runner/Info.plist | 4 ++- lib/widgets/auth/verification_methods.dart | 30 ++++++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 01dc72ef..171125d9 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -25,7 +25,9 @@ NSCameraUsageDescription Camera permission is required for barcode scanning. NSFaceIDUsageDescription - Why is my app authenticating using face id? + We are using it for authentication + + UILaunchStoryboardName LaunchScreen UIMainStoryboardFile diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index adb0aef0..8839c47c 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/models/auth/send_activation_code_model2.dart' import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.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/otp/sms-popup.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; @@ -17,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart' import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:intl/intl.dart'; +import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; import 'package:provider/provider.dart'; @@ -233,7 +235,8 @@ class _VerificationMethodsState extends State { Expanded( child: InkWell( onTap: () => { - authenticateUser(3, true, authProv) + authenticateUser(3, + true, authProv) }, child: getButton( user.logInTypeID, @@ -483,9 +486,7 @@ class _VerificationMethodsState extends State { return InkWell( onTap: () => { if (checkIfBiometricAvailable(BiometricType.fingerprint)) - { - authenticateUser(3, true, authProv) - } + {authenticateUser(3, true, authProv)} }, child: RoundedContainer( backgroundColor: @@ -703,10 +704,23 @@ class _VerificationMethodsState extends State { loginWithFingurePrintFace(type, isActive, authProv) async { if (isActive) { // this.startBiometricLoginIfAvailable(); - authenticated = await auth.authenticateWithBiometrics( - localizedReason: 'Scan your fingerprint to authenticate', - useErrorDialogs: true, - stickyAuth: true); + + const iosStrings = const IOSAuthMessages( + cancelButton: 'cancel', + goToSettingsButton: 'settings', + goToSettingsDescription: 'Please set up your Touch ID.', + lockOut: 'Please reenable your Touch ID'); + + try { + authenticated = await auth.authenticateWithBiometrics( + localizedReason: 'Scan your fingerprint to authenticate', + useErrorDialogs: true, + stickyAuth: true, + iOSAuthStrings: iosStrings); + } on PlatformException catch (e) { + DrAppToastMsg.showErrorToast(e); + } + if (!mounted) return; if (user != null && (user.logInTypeID == 3 || user.logInTypeID == 4)) { this.sendActivationCode(type, authProv); // this.checkActivationCode(authProv); From f819e6353e4a938409036011964f71442bcc593a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Feb 2021 11:39:44 +0200 Subject: [PATCH 306/421] fix DA-350 --- lib/client/base_app_client.dart | 2 + lib/core/service/base/lookup-service.dart | 10 + lib/core/viewModel/SOAP_view_model.dart | 19 + .../subjective/update_medication_widget.dart | 633 ++++++++++++++++-- .../subjective/update_subjective_page.dart | 2 + 5 files changed, 613 insertions(+), 53 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 604e6f30..4a6ee675 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -83,6 +83,8 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); + var ee ={json.encode(body)}; + if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), diff --git a/lib/core/service/base/lookup-service.dart b/lib/core/service/base/lookup-service.dart index 998949d7..dd6310e8 100644 --- a/lib/core/service/base/lookup-service.dart +++ b/lib/core/service/base/lookup-service.dart @@ -18,6 +18,12 @@ class LookupService extends BaseService { List medicationFrequencyList = []; List medicationDoseTimeList = []; List medicationIndicationsList = []; + // TODO make the person who create the list dynamic to change it. + List medicationStrengthListWithModel = []; + List medicationFrequencyListWithModel = []; + List medicationDoseTimeListWithModel = []; + List medicationRouteListWithModel = []; + List patientAssessmentList = []; List get historyFamilyList => _historyFamilyList; @@ -154,6 +160,7 @@ class LookupService extends BaseService { case MasterKeysService.MedicationStrength: medicationStrengthList.clear(); entryList.forEach((v) { + medicationStrengthListWithModel.add(MasterKeyModel.fromJson(v)); medicationStrengthList.add(v); }); break; @@ -166,18 +173,21 @@ class LookupService extends BaseService { case MasterKeysService.MedicationRoute: medicationRouteList.clear(); entryList.forEach((v) { + medicationRouteListWithModel.add(MasterKeyModel.fromJson(v)); medicationRouteList.add(v); }); break; case MasterKeysService.MedicationFrequency: medicationFrequencyList.clear(); entryList.forEach((v) { + medicationFrequencyListWithModel.add(MasterKeyModel.fromJson(v)); medicationFrequencyList.add(v); }); break; case MasterKeysService.MedicationDoseTime: medicationDoseTimeList.clear(); entryList.forEach((v) { + medicationDoseTimeListWithModel.add(MasterKeyModel.fromJson(v)); medicationDoseTimeList.add(v); }); break; diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 076f379c..600a83a5 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/service/SOAP_service.dart'; +import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/ChiefComplaint/GetChiefComplaintResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; @@ -30,6 +32,7 @@ import 'base_view_model.dart'; class SOAPViewModel extends BaseViewModel { SOAPService _SOAPService = locator(); + PrescriptionService _prescriptionService = locator(); List get allergiesList => _SOAPService.allergiesList; @@ -82,6 +85,13 @@ class SOAPViewModel extends BaseViewModel { int get episodeID => _SOAPService.episodeID; + get medicationStrengthList => _SOAPService.medicationStrengthListWithModel; + get medicationDoseTimeList => _SOAPService.medicationDoseTimeListWithModel; + get medicationRouteList => _SOAPService.medicationRouteListWithModel; + get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; + List get allMedicationList => + _prescriptionService.allMedicationList; + Future getAllergies(GetAllergiesRequestModel getAllergiesRequestModel) async { setState(ViewState.Busy); await _SOAPService.getAllergies(getAllergiesRequestModel); @@ -320,6 +330,15 @@ class SOAPViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getMedicationList() async { + setState(ViewState.Busy); + await _prescriptionService.getMedicationList(); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } // ignore: missing_return MasterKeyModel getOneMasterKey( {@required MasterKeysService masterKeys, dynamic id, int typeId}) { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart index 6584d415..81f49ffa 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart @@ -1,30 +1,49 @@ - +import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.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/TextFields.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; +import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import '../custom_validation_error.dart'; + +class UpdateMedicationWidget extends StatefulWidget { + final List myAllergiesList; + + UpdateMedicationWidget({Key key, this.myAllergiesList}); -class UpdateMedication extends StatefulWidget { @override - _UpdateMedicationState createState() => _UpdateMedicationState(); + _UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState(); } -class _UpdateMedicationState extends State { +class _UpdateMedicationWidgetState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Column( children: [ Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), + margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( - hintText: "Current Medications", + hintText: TranslationBase.of(context).addMedication, fontSize: 13.5, onTapTextFields: () { - openMedicationsList(context); + openAllergiesList(context); }, readOnly: true, // hintColor: Colors.black, @@ -34,7 +53,8 @@ class _UpdateMedicationState extends State { // controller: messageController, validator: (value) { if (value == null) - return TranslationBase.of(context) + return TranslationBase + .of(context) .emptyMessage; else return null; @@ -47,61 +67,568 @@ class _UpdateMedicationState extends State { margin: EdgeInsets.only(left: 15, right: 15, top: 15), child: Column( - children: [ - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Abdomen Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - SizedBox( - height: 20, - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Texts('Back Pain', - variant: "bodyText", - bold: true, - color: Colors.black), - Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ) - ], - ), - ], - ), + children: widget.myAllergiesList.map((selectedAllergy) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergy.nameAr + : selectedAllergy.selectedAllergy.nameEn + .toUpperCase(), + variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: Colors.black), + width: MediaQuery + .of(context) + .size + .width * 0.5, + ), + Texts( + projectViewModel.isArabic + ? selectedAllergy.selectedAllergySeverity + .nameAr + : selectedAllergy.selectedAllergySeverity + .nameEn + .toUpperCase(), + variant: "bodyText", + textDecoration: selectedAllergy.isChecked + ? null + : TextDecoration.lineThrough, + bold: true, + color: AppGlobal.appPrimaryColor), + if (selectedAllergy.isChecked) + InkWell( + child: Icon( + FontAwesomeIcons.trash, + color: Colors.grey, + size: 20, + ), + onTap: () => removeAllergy(selectedAllergy), + ) + ], + ), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Row( + children: [ + AppText( + selectedAllergy.remark != null && + selectedAllergy.remark != '' + ? TranslationBase + .of(context) + .remarks + " : " + : '', + fontWeight: FontWeight.bold, + fontSize: 13, + ), + Container( + width: MediaQuery + .of(context) + .size + .width * 0.55, + child: AppText( + selectedAllergy.remark ?? '', + fontSize: 10, + color: Colors.grey, + ), + ), + ], + ), + ), + DividerWithSpacesAround() + ], + ), + SizedBox( + height: 10, + ), + ], + ); + }).toList()), ) ], ); } - openMedicationsList(BuildContext context) { + + removeAllergy(MySelectedAllergy mySelectedAllergy) { + List allergy = + // ignore: missing_return + widget.myAllergiesList.where((element) => + mySelectedAllergy.selectedAllergySeverity.id == + element.selectedAllergySeverity.id && + mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id + ).toList(); + + if (allergy.length > 0) { + setState(() { + allergy[0].isChecked = false; + }); + } + + + print(allergy); + } + + openAllergiesList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return FractionallySizedBox( - heightFactor: 0.7, - child: Container( - child: Center( - child: Texts("dfdfd"), - )), - ); + return AddAllergies( + addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { + if (mySelectedAllergy.selectedAllergySeverity == null || + mySelectedAllergy.selectedAllergy == null) { + helpers.showErrorToast(TranslationBase + .of(context) + .requiredMsg); + } else { + setState(() { + List allergy = + // ignore: missing_return + widget.myAllergiesList + .where((element) => + mySelectedAllergy.selectedAllergy.id == + element.selectedAllergy.id) + .toList(); + + if (allergy.isEmpty) { + widget.myAllergiesList.add(mySelectedAllergy); + Navigator.of(context).pop(); + } else { + allergy.first.selectedAllergy = + mySelectedAllergy.selectedAllergy; + allergy.first.selectedAllergySeverity = + mySelectedAllergy.selectedAllergySeverity; + allergy.first.remark = mySelectedAllergy.remark; + allergy.first.isChecked = mySelectedAllergy.isChecked; + Navigator.of(context).pop(); + + // helpers.showErrorToast(TranslationBase + // .of(context) + // .itemExist); + } + }); + } + },); }); } } +class AddAllergies extends StatefulWidget { + final Function addAllergiesFun; + + const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + + @override + _AddAllergiesState createState() => _AddAllergiesState(); +} + +class _AddAllergiesState extends State { + List allergiesList; + List allergySeverityList; + MasterKeyModel _selectedMedicationStrengthSeverity; + MasterKeyModel _selectedAllergy; + TextEditingController remarkController = TextEditingController(); + TextEditingController severityController = TextEditingController(); + TextEditingController allergyController = TextEditingController(); + + GlobalKey key = new GlobalKey>(); + bool isFormSubmitted = false; + + InputDecoration textFieldSelectorDecoration(String hintText, + String selectedText, bool isDropDown, + {IconData icon}) { + return InputDecoration( + contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey, width: 1.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown ? Icon(icon ?? Icons.arrow_drop_down) : null, + hintStyle: TextStyle( + fontSize: 10, + color: Theme + .of(context) + .hintColor, + fontWeight: FontWeight.w700 + ), + ); + } + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + final screenSize = MediaQuery + .of(context) + .size; + return FractionallySizedBox( + heightFactor: 0.7, + child: BaseView( + onModelReady: (model) async { + if (model.medicationStrengthList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationStrength,); + } + if (model.medicationFrequencyList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationFrequency); + } + if (model.medicationDoseTimeList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationDoseTime); + } + if (model.medicationRouteList.length == 0) { + await model.getMasterLookup(MasterKeysService.MedicationRoute); + } + if (model.allMedicationList.length == 0) + await model.getMedicationList(); + }, + builder: (_, model, w) => + AppScaffold( + baseViewModel: model, + isShowAppBar: false, + body: SingleChildScrollView( + child: Center( + child: FractionallySizedBox( + widthFactor: 0.9, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + SizedBox( + height: 16, + ), + AppText( + TranslationBase + .of(context) + .addAllergies, + fontWeight: FontWeight.bold, + fontSize: 16, + ), + SizedBox( + height: 16, + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allergiesList != null + ? () { + setState(() { + _selectedAllergy = null; + allergyController.text = null; + }); + } + : null, + child: _selectedAllergy == null + ? AutoCompleteTextField( + decoration: textFieldSelectorDecoration( + TranslationBase + .of(context) + .selectAllergy, + _selectedAllergy != null + ? _selectedAllergy.nameEn + : null, true, + icon: EvaIcons.search), + itemSubmitted: (item) => + setState(() { + _selectedAllergy = item; + allergyController.text = + projectViewModel.isArabic + ? _selectedAllergy + .nameAr + : _selectedAllergy + .nameEn; + }), + key: key, + suggestions: model.allergiesList, + itemBuilder: (context, suggestion) => + new Padding( + child: Texts( + projectViewModel.isArabic + ? suggestion + .nameAr + : suggestion.nameEn), + padding: EdgeInsets.all(2.0)), + itemSorter: (a, b) => 1, + itemFilter: (suggestion, input) => + suggestion.nameAr.toLowerCase().startsWith( + input.toLowerCase()) || + suggestion.nameEn.toLowerCase() + .startsWith(input.toLowerCase()), + ) + : + TextFields( + onTapTextFields: model.allergiesList != + null + ? () { + setState(() { + _selectedAllergy = null; + allergyController.text = null; + }); + } + : null, + hasLabelText: allergyController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .selectAllergy, + fontSize: 13.5, + readOnly: true, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: allergyController, + suffixIcon: EvaIcons.search, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }) + ), + ), + if(isFormSubmitted && _selectedAllergy == null) + CustomValidationError(), + SizedBox( + height: 10, + ), + TextFields( + onTapTextFields: model + .medicationStrengthList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationStrengthList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrengthSeverity = + selectedValue; + + severityController.text = + projectViewModel.isArabic + ? _selectedMedicationStrengthSeverity + .nameAr + : _selectedMedicationStrengthSeverity + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hasLabelText: severityController.text != + '' ? true : false, + showLabelText: true, + hintText: "Strength", + //TODO add translation + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + if(isFormSubmitted && + _selectedMedicationStrengthSeverity == null) + CustomValidationError(), TextFields( + onTapTextFields: model.medicationDoseTimeList != + null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationDoseTimeList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrengthSeverity = + selectedValue; + + severityController.text = + projectViewModel.isArabic + ? _selectedMedicationStrengthSeverity + .nameAr + : _selectedMedicationStrengthSeverity + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hasLabelText: severityController.text != + '' ? true : false, + showLabelText: true, + hintText: "Dose Time", + //TODO add translation + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), SizedBox( + height: 5, + ), + if(isFormSubmitted && + _selectedMedicationStrengthSeverity == null) + CustomValidationError(), + + SizedBox( + height: 10, + ), + + SizedBox( + height: 10, + ), + TextFields( + onTapTextFields: model + .medicationStrengthList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationStrengthList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationStrengthSeverity = + selectedValue; + + severityController.text = + projectViewModel.isArabic + ? _selectedMedicationStrengthSeverity + .nameAr + : _selectedMedicationStrengthSeverity + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hasLabelText: severityController.text != + '' ? true : false, + showLabelText: true, + hintText: "Strength", + //TODO add translation + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: severityController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), + SizedBox( + height: 5, + ), + if(isFormSubmitted && + _selectedMedicationStrengthSeverity == null) + CustomValidationError(), + AppButton( + title: TranslationBase + .of(context) + .add + .toUpperCase(), + onPressed: () { + setState(() { + isFormSubmitted = true; + }); + if (_selectedAllergy != null && + _selectedMedicationStrengthSeverity != + null) { + MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( + remark: remarkController.text, + selectedAllergy: _selectedAllergy, + isChecked: true, + selectedAllergySeverity: _selectedMedicationStrengthSeverity,); + widget.addAllergiesFun(mySelectedAllergy); + } + }, + ), + ] + + ), + ), + ), + )), + ), + ); + } +} + + + + + + diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index 95c4063e..fb7b4dc6 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -19,6 +19,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_history_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; @@ -353,6 +354,7 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), + UpdateMedicationWidget(myAllergiesList: widget.myAllergiesList,), SizedBox( height: 10, ), From f3220be735e5953370a891636ed8775e684d8288 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Feb 2021 17:41:18 +0200 Subject: [PATCH 307/421] fix DA-350 --- ios/Podfile.lock | 2 +- lib/screens/dashboard_screen.dart | 1 + lib/util/translations_delegate_base.dart | 1 + .../subjective/update_medication_widget.dart | 519 ++++++++---------- .../subjective/update_subjective_page.dart | 13 +- 5 files changed, 234 insertions(+), 302 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 46d7599e..9c86879d 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -292,4 +292,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.1 +COCOAPODS: 1.10.0.rc.1 diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 30dc2700..9f28c010 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -136,6 +136,7 @@ class _DashboardScreenState extends State { Stack(children: [ Column( children: [ + if(false) ProfileWelcomeWidget( InkWell( onTap: () async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 499cade9..09a3c3be 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1106,6 +1106,7 @@ class TranslationBase { String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart index 81f49ffa..f32bfe6e 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_medication_widget.dart @@ -1,6 +1,7 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; @@ -13,18 +14,19 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_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/dialogs/master_key_dailog.dart'; -import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; -import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:provider/provider.dart'; import '../custom_validation_error.dart'; class UpdateMedicationWidget extends StatefulWidget { - final List myAllergiesList; + final TextEditingController medicationController; - UpdateMedicationWidget({Key key, this.myAllergiesList}); + UpdateMedicationWidget({ + Key key, + this.medicationController, + }); @override _UpdateMedicationWidgetState createState() => _UpdateMedicationWidgetState(); @@ -43,7 +45,7 @@ class _UpdateMedicationWidgetState extends State { hintText: TranslationBase.of(context).addMedication, fontSize: 13.5, onTapTextFields: () { - openAllergiesList(context); + openMedicationList(context); }, readOnly: true, // hintColor: Colors.black, @@ -62,195 +64,57 @@ class _UpdateMedicationWidgetState extends State { ), SizedBox( height: 20, - ), - Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 15), - child: Column( - children: widget.myAllergiesList.map((selectedAllergy) { - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - child: Texts( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergy.nameAr - : selectedAllergy.selectedAllergy.nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: Colors.black), - width: MediaQuery - .of(context) - .size - .width * 0.5, - ), - Texts( - projectViewModel.isArabic - ? selectedAllergy.selectedAllergySeverity - .nameAr - : selectedAllergy.selectedAllergySeverity - .nameEn - .toUpperCase(), - variant: "bodyText", - textDecoration: selectedAllergy.isChecked - ? null - : TextDecoration.lineThrough, - bold: true, - color: AppGlobal.appPrimaryColor), - if (selectedAllergy.isChecked) - InkWell( - child: Icon( - FontAwesomeIcons.trash, - color: Colors.grey, - size: 20, - ), - onTap: () => removeAllergy(selectedAllergy), - ) - ], - ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: Row( - children: [ - AppText( - selectedAllergy.remark != null && - selectedAllergy.remark != '' - ? TranslationBase - .of(context) - .remarks + " : " - : '', - fontWeight: FontWeight.bold, - fontSize: 13, - ), - Container( - width: MediaQuery - .of(context) - .size - .width * 0.55, - child: AppText( - selectedAllergy.remark ?? '', - fontSize: 10, - color: Colors.grey, - ), - ), - ], - ), - ), - DividerWithSpacesAround() - ], - ), - SizedBox( - height: 10, - ), - ], - ); - }).toList()), ) ], ); } - removeAllergy(MySelectedAllergy mySelectedAllergy) { - List allergy = - // ignore: missing_return - widget.myAllergiesList.where((element) => - mySelectedAllergy.selectedAllergySeverity.id == - element.selectedAllergySeverity.id && - mySelectedAllergy.selectedAllergy.id == element.selectedAllergy.id - ).toList(); - - if (allergy.length > 0) { - setState(() { - allergy[0].isChecked = false; - }); - } - - print(allergy); - } - - openAllergiesList(BuildContext context) { + openMedicationList(BuildContext context) { showModalBottomSheet( backgroundColor: Colors.white, isScrollControlled: true, context: context, builder: (context) { - return AddAllergies( - addAllergiesFun: (MySelectedAllergy mySelectedAllergy) { - if (mySelectedAllergy.selectedAllergySeverity == null || - mySelectedAllergy.selectedAllergy == null) { - helpers.showErrorToast(TranslationBase - .of(context) - .requiredMsg); - } else { - setState(() { - List allergy = - // ignore: missing_return - widget.myAllergiesList - .where((element) => - mySelectedAllergy.selectedAllergy.id == - element.selectedAllergy.id) - .toList(); - - if (allergy.isEmpty) { - widget.myAllergiesList.add(mySelectedAllergy); - Navigator.of(context).pop(); - } else { - allergy.first.selectedAllergy = - mySelectedAllergy.selectedAllergy; - allergy.first.selectedAllergySeverity = - mySelectedAllergy.selectedAllergySeverity; - allergy.first.remark = mySelectedAllergy.remark; - allergy.first.isChecked = mySelectedAllergy.isChecked; - Navigator.of(context).pop(); - - // helpers.showErrorToast(TranslationBase - // .of(context) - // .itemExist); - } - }); - } - },); + return AddMedication( + addMedicationFun: (MySelectedAllergy mySelectedAllergy) {}, + medicationController: widget.medicationController, + ); }); } - } -class AddAllergies extends StatefulWidget { - final Function addAllergiesFun; +// ignore: must_be_immutable +class AddMedication extends StatefulWidget { + final Function addMedicationFun; + TextEditingController medicationController; - const AddAllergies({Key key, this.addAllergiesFun}) : super(key: key); + AddMedication({Key key, this.addMedicationFun, this.medicationController}) + : super(key: key); @override - _AddAllergiesState createState() => _AddAllergiesState(); + _AddMedicationState createState() => _AddMedicationState(); } -class _AddAllergiesState extends State { - List allergiesList; - List allergySeverityList; - MasterKeyModel _selectedMedicationStrengthSeverity; - MasterKeyModel _selectedAllergy; - TextEditingController remarkController = TextEditingController(); - TextEditingController severityController = TextEditingController(); - TextEditingController allergyController = TextEditingController(); +class _AddMedicationState extends State { + MasterKeyModel _selectedMedicationDose; + MasterKeyModel _selectedMedicationStrength; + MasterKeyModel _selectedMedicationRoute; + MasterKeyModel _selectedMedicationFrequency; - GlobalKey key = new GlobalKey>(); + MasterKeyModel _selectedAllergy; + TextEditingController doseController = TextEditingController(); + TextEditingController strengthController = TextEditingController(); + TextEditingController routeController = TextEditingController(); + TextEditingController frequencyController = TextEditingController(); + GetMedicationResponseModel _selectedMedication; + + GlobalKey key = + new GlobalKey>(); bool isFormSubmitted = false; - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( contentPadding: EdgeInsets.symmetric(vertical: 10, horizontal: 10), @@ -321,7 +185,7 @@ class _AddAllergiesState extends State { AppText( TranslationBase .of(context) - .addAllergies, + .addMedication, fontWeight: FontWeight.bold, fontSize: 16, ), @@ -331,109 +195,90 @@ class _AddAllergiesState extends State { Container( height: screenSize.height * 0.070, child: InkWell( - onTap: model.allergiesList != null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } - : null, - child: _selectedAllergy == null - ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration( - TranslationBase - .of(context) - .selectAllergy, - _selectedAllergy != null - ? _selectedAllergy.nameEn - : null, true, - icon: EvaIcons.search), - itemSubmitted: (item) => - setState(() { - _selectedAllergy = item; - allergyController.text = - projectViewModel.isArabic - ? _selectedAllergy - .nameAr - : _selectedAllergy - .nameEn; - }), - key: key, - suggestions: model.allergiesList, - itemBuilder: (context, suggestion) => - new Padding( - child: Texts( - projectViewModel.isArabic - ? suggestion - .nameAr - : suggestion.nameEn), - padding: EdgeInsets.all(2.0)), - itemSorter: (a, b) => 1, - itemFilter: (suggestion, input) => - suggestion.nameAr.toLowerCase().startsWith( - input.toLowerCase()) || - suggestion.nameEn.toLowerCase() - .startsWith(input.toLowerCase()), - ) - : - TextFields( - onTapTextFields: model.allergiesList != - null - ? () { - setState(() { - _selectedAllergy = null; - allergyController.text = null; - }); - } + onTap: model.allMedicationList != null + ? () { + setState(() { + _selectedMedication = null; + }); + } + : null, + child: _selectedMedication == null + ? AutoCompleteTextField< + GetMedicationResponseModel>( + decoration: textFieldSelectorDecoration( + TranslationBase + .of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.genericName : null, - hasLabelText: allergyController.text != - '' ? true : false, - showLabelText: true, - hintText: TranslationBase + 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) - .selectAllergy, - fontSize: 13.5, - readOnly: true, - fontWeight: FontWeight.w600, - maxLines: 2, - minLines: 1, - controller: allergyController, - suffixIcon: EvaIcons.search, - validator: (value) { - if (value == null) - return TranslationBase - .of(context) - .emptyMessage; - else - return null; - }) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication.description + + (' (${_selectedMedication + .genericName} )') + : null, + true, + icon: EvaIcons.search), + enabled: false, + ), ), ), - if(isFormSubmitted && _selectedAllergy == null) + if(isFormSubmitted && _selectedMedication == null) CustomValidationError(), SizedBox( - height: 10, + height: 5, ), TextFields( - onTapTextFields: model - .medicationStrengthList != null + onTapTextFields: model.medicationDoseTimeList != + null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, + list: model.medicationDoseTimeList, okText: TranslationBase .of(context) .ok, okFunction: (selectedValue) { setState(() { - _selectedMedicationStrengthSeverity = + _selectedMedicationDose = selectedValue; - severityController.text = + doseController.text = projectViewModel.isArabic - ? _selectedMedicationStrengthSeverity + ? _selectedMedicationDose .nameAr - : _selectedMedicationStrengthSeverity + : _selectedMedicationDose .nameEn; }); }, @@ -447,10 +292,12 @@ class _AddAllergiesState extends State { ); } : null, - hasLabelText: severityController.text != + hasLabelText: doseController.text != '' ? true : false, showLabelText: true, - hintText: "Strength", + hintText: TranslationBase + .of(context) + .doseTime, //TODO add translation fontSize: 13.5, readOnly: true, @@ -458,7 +305,7 @@ class _AddAllergiesState extends State { fontWeight: FontWeight.w600, maxLines: 2, minLines: 1, - controller: severityController, + controller: doseController, validator: (value) { if (value == null) return TranslationBase @@ -471,26 +318,29 @@ class _AddAllergiesState extends State { height: 5, ), if(isFormSubmitted && - _selectedMedicationStrengthSeverity == null) - CustomValidationError(), TextFields( - onTapTextFields: model.medicationDoseTimeList != - null + _selectedMedicationDose == null) + CustomValidationError(), SizedBox( + height: 5, + ), + TextFields( + onTapTextFields: model + .medicationStrengthList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationDoseTimeList, + list: model.medicationStrengthList, okText: TranslationBase .of(context) .ok, okFunction: (selectedValue) { setState(() { - _selectedMedicationStrengthSeverity = + _selectedMedicationStrength = selectedValue; - severityController.text = + strengthController.text = projectViewModel.isArabic - ? _selectedMedicationStrengthSeverity + ? _selectedMedicationStrength .nameAr - : _selectedMedicationStrengthSeverity + : _selectedMedicationStrength .nameEn; }); }, @@ -504,18 +354,19 @@ class _AddAllergiesState extends State { ); } : null, - hasLabelText: severityController.text != + hasLabelText: strengthController.text != '' ? true : false, showLabelText: true, - hintText: "Dose Time", - //TODO add translation + hintText: TranslationBase + .of(context) + .strength, fontSize: 13.5, readOnly: true, // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 2, minLines: 1, - controller: severityController, + controller: strengthController, validator: (value) { if (value == null) return TranslationBase @@ -527,35 +378,94 @@ class _AddAllergiesState extends State { height: 5, ), if(isFormSubmitted && - _selectedMedicationStrengthSeverity == null) + _selectedMedicationStrength == null) CustomValidationError(), SizedBox( - height: 10, + height: 5, ), + TextFields( + onTapTextFields: model + .medicationRouteList != null + ? () { + MasterKeyDailog dialog = MasterKeyDailog( + list: model.medicationRouteList, + okText: TranslationBase + .of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + _selectedMedicationRoute = + selectedValue; + + routeController.text = + projectViewModel.isArabic + ? _selectedMedicationRoute + .nameAr + : _selectedMedicationRoute + .nameEn; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) { + return dialog; + }, + ); + } + : null, + hasLabelText: routeController.text != + '' ? true : false, + showLabelText: true, + hintText: TranslationBase + .of(context) + .route, + fontSize: 13.5, + readOnly: true, + // hintColor: Colors.black, + fontWeight: FontWeight.w600, + maxLines: 2, + minLines: 1, + controller: routeController, + validator: (value) { + if (value == null) + return TranslationBase + .of(context) + .emptyMessage; + else + return null; + }), SizedBox( - height: 10, + height: 5, + ), + if(isFormSubmitted && + _selectedMedicationRoute == null) + CustomValidationError(), + SizedBox( + height: 5, ), TextFields( onTapTextFields: model - .medicationStrengthList != null + .medicationFrequencyList != null ? () { MasterKeyDailog dialog = MasterKeyDailog( - list: model.medicationStrengthList, + list: model.medicationFrequencyList, okText: TranslationBase .of(context) .ok, okFunction: (selectedValue) { setState(() { - _selectedMedicationStrengthSeverity = + _selectedMedicationFrequency = selectedValue; - severityController.text = + frequencyController.text = projectViewModel.isArabic - ? _selectedMedicationStrengthSeverity + ? _selectedMedicationFrequency .nameAr - : _selectedMedicationStrengthSeverity + : _selectedMedicationFrequency .nameEn; }); }, @@ -569,10 +479,12 @@ class _AddAllergiesState extends State { ); } : null, - hasLabelText: severityController.text != + hasLabelText: frequencyController.text != '' ? true : false, showLabelText: true, - hintText: "Strength", + hintText: TranslationBase + .of(context) + .frequency, //TODO add translation fontSize: 13.5, readOnly: true, @@ -580,7 +492,7 @@ class _AddAllergiesState extends State { fontWeight: FontWeight.w600, maxLines: 2, minLines: 1, - controller: severityController, + controller: frequencyController, validator: (value) { if (value == null) return TranslationBase @@ -593,8 +505,11 @@ class _AddAllergiesState extends State { height: 5, ), if(isFormSubmitted && - _selectedMedicationStrengthSeverity == null) + _selectedMedicationFrequency == null) CustomValidationError(), + SizedBox( + height: 30, + ), AppButton( title: TranslationBase .of(context) @@ -604,15 +519,29 @@ class _AddAllergiesState extends State { setState(() { isFormSubmitted = true; }); - if (_selectedAllergy != null && - _selectedMedicationStrengthSeverity != - null) { - MySelectedAllergy mySelectedAllergy = new MySelectedAllergy( - remark: remarkController.text, - selectedAllergy: _selectedAllergy, - isChecked: true, - selectedAllergySeverity: _selectedMedicationStrengthSeverity,); - widget.addAllergiesFun(mySelectedAllergy); + if (_selectedMedication != null && + _selectedMedicationDose != + null && + _selectedMedicationStrength != null && + _selectedMedicationRoute != null && + _selectedMedicationFrequency != null) { + widget.medicationController.text = + widget.medicationController.text + + '${_selectedMedication + .description } (${TranslationBase + .of(context) + .doseTime} ) ${doseController + .text} (${TranslationBase + .of(context) + .strength}) ${strengthController + .text} (${TranslationBase + .of(context) + .route }) ${routeController + .text} (${TranslationBase + .of(context) + .frequency }) ${frequencyController + .text} \n \n'; + Navigator.of(context).pop(); } }, ), @@ -621,7 +550,7 @@ class _AddAllergiesState extends State { ), ), ), - )), + ),), ), ); } diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index fb7b4dc6..3bc89a7f 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -209,7 +209,7 @@ class _UpdateSubjectivePageState extends State { complaintsController.text = helpers.parseHtmlString( model.patientChiefComplaintList[0].chiefComplaint); illnessController.text = model.patientChiefComplaintList[0].hopi; - medicationController.text = model.patientChiefComplaintList[0].currentMedication; + medicationController.text = model.patientChiefComplaintList[0].currentMedication + '\n \n'; } await getHistory(model); @@ -326,6 +326,10 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), + UpdateMedicationWidget(medicationController: medicationController,), + SizedBox( + height: 10, + ), Container( margin: EdgeInsets.only(left: 10, right: 10, top: 15), child: TextFields( @@ -340,7 +344,7 @@ class _UpdateSubjectivePageState extends State { // hintColor: Colors.black, fontWeight: FontWeight.w600, maxLines: 23, - minLines: 1, + minLines: 10, controller: medicationController, validator: (value) { if (value == null || value == "") @@ -354,10 +358,7 @@ class _UpdateSubjectivePageState extends State { SizedBox( height: 10, ), - UpdateMedicationWidget(myAllergiesList: widget.myAllergiesList,), - SizedBox( - height: 10, - ), + ]), ), isExpand: isChiefExpand, From 219ab8d4acca8a4acee0ce0cb4f3a9a7df8ac7cb Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 23 Feb 2021 09:57:36 +0200 Subject: [PATCH 308/421] fix DA-391 --- lib/screens/patients/patient_search_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 994048a7..34e68779 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -340,6 +340,7 @@ class _PatientSearchScreenState extends State { SizedBox( height: 10, ), + if(_selectedType!='7') Container( decoration: BoxDecoration( borderRadius: From 8238e9569acebc813e8e303bbc440f8804bca284 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 23 Feb 2021 09:59:09 +0200 Subject: [PATCH 309/421] fix DA-391: return back my comment code in dashboard --- lib/screens/dashboard_screen.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 98422059..d2369e9d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -140,7 +140,6 @@ class _DashboardScreenState extends State { Stack(children: [ Column( children: [ - if(false) ProfileWelcomeWidget( Container( width: MediaQuery.of(context).size.width * .6, From 12b78d0a3b0c04903496c3fd906387a35bdbc455 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 23 Feb 2021 10:31:14 +0200 Subject: [PATCH 310/421] fix DA-391: return back my comment code in base app client --- lib/client/base_app_client.dart | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 92c0735b..cd6b7137 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -83,7 +83,6 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - var ee ={json.encode(body)}; if (await Helpers.checkConnection()) { final response = await http.post(url, From 63db56a66b3f46ae5e0d64d3f868e6e847b75478 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 23 Feb 2021 13:33:34 +0200 Subject: [PATCH 311/421] fix issue --- lib/screens/dashboard_screen.dart | 87 ++++++++++++++++--------------- 1 file changed, 44 insertions(+), 43 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index d2369e9d..7769f947 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -140,49 +140,50 @@ class _DashboardScreenState extends State { Stack(children: [ Column( children: [ - ProfileWelcomeWidget( - Container( - width: MediaQuery.of(context).size.width * .6, - // height: 100, - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.white, - isExpanded: true, - value: clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return projectsProvider.doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig.textMultiplier * 2.1, - color: Colors.white, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context); - }, - items: projectsProvider.doctorClinicsList.map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), + + // ProfileWelcomeWidget( + // Container( + // width: MediaQuery.of(context).size.width * .6, + // // height: 100, + // child: DropdownButtonHideUnderline( + // child: DropdownButton( + // dropdownColor: Colors.white, + // iconEnabledColor: Colors.white, + // isExpanded: true, + // value: clinicId, + // iconSize: 25, + // elevation: 16, + // selectedItemBuilder: (BuildContext context) { + // return projectsProvider.doctorClinicsList + // .map((item) { + // return Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // AppText( + // item.clinicName, + // fontSize: SizeConfig.textMultiplier * 2.1, + // color: Colors.white, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) { + // clinicId = newValue; + // changeClinic(newValue, context); + // }, + // items: projectsProvider.doctorClinicsList.map((item) { + // return DropdownMenuItem( + // child: Text( + // item.clinicName, + // textAlign: TextAlign.end, + // ), + // value: item.clinicID, + // ); + // }).toList(), + // )), + // ), + // ), // InkWell( // onTap: () async { // showCupertinoPicker( From 9ffe1eabd209733bd578a46682c0071a4693bff7 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 23 Feb 2021 13:47:51 +0200 Subject: [PATCH 312/421] revert the code --- lib/screens/dashboard_screen.dart | 87 +++++++++++++++---------------- 1 file changed, 43 insertions(+), 44 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 7769f947..d2369e9d 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -140,50 +140,49 @@ class _DashboardScreenState extends State { Stack(children: [ Column( children: [ - - // ProfileWelcomeWidget( - // Container( - // width: MediaQuery.of(context).size.width * .6, - // // height: 100, - // child: DropdownButtonHideUnderline( - // child: DropdownButton( - // dropdownColor: Colors.white, - // iconEnabledColor: Colors.white, - // isExpanded: true, - // value: clinicId, - // iconSize: 25, - // elevation: 16, - // selectedItemBuilder: (BuildContext context) { - // return projectsProvider.doctorClinicsList - // .map((item) { - // return Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // AppText( - // item.clinicName, - // fontSize: SizeConfig.textMultiplier * 2.1, - // color: Colors.white, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) { - // clinicId = newValue; - // changeClinic(newValue, context); - // }, - // items: projectsProvider.doctorClinicsList.map((item) { - // return DropdownMenuItem( - // child: Text( - // item.clinicName, - // textAlign: TextAlign.end, - // ), - // value: item.clinicID, - // ); - // }).toList(), - // )), - // ), - // ), + ProfileWelcomeWidget( + Container( + width: MediaQuery.of(context).size.width * .6, + // height: 100, + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.white, + isExpanded: true, + value: clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig.textMultiplier * 2.1, + color: Colors.white, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic(newValue, context); + }, + items: projectsProvider.doctorClinicsList.map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), // InkWell( // onTap: () async { // showCupertinoPicker( From 332caaae2f8b3653bb1045ea51c8616b138ec872 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Feb 2021 15:32:54 +0300 Subject: [PATCH 313/421] dashboard issue --- lib/config/localized_values.dart | 1 + lib/screens/dashboard_screen.dart | 83 +++++++++++++----------- lib/util/translations_delegate_base.dart | 6 +- 3 files changed, 50 insertions(+), 40 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f9f7d6b6..882de2e4 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -738,4 +738,5 @@ const Map> localizedValues = { 'en': "A Sick leave is on Hold status for this patient", 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" }, + 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"} }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index d2369e9d..fbbe6d53 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -62,7 +62,7 @@ class _DashboardScreenState extends State { bool isExpanded = false; String isInpatient = ""; var clinicName = []; - var clinicId = 1; + var clinicId; void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -144,43 +144,50 @@ class _DashboardScreenState extends State { Container( width: MediaQuery.of(context).size.width * .6, // height: 100, - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.white, - isExpanded: true, - value: clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return projectsProvider.doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig.textMultiplier * 2.1, - color: Colors.white, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context); - }, - items: projectsProvider.doctorClinicsList.map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), + child: projectsProvider.doctorClinicsList.length > 0 + ? DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.white, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: (BuildContext context) { + return projectsProvider.doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item.clinicName, + fontSize: + SizeConfig.textMultiplier * 2.1, + color: Colors.white, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic(newValue, context); + }, + items: projectsProvider.doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )) + : AppText(TranslationBase.of(context).noClinic), ), ), // InkWell( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 99ae043a..3f672218 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1118,9 +1118,11 @@ class TranslationBase { String get admissionRequestSuccessMsg => localizedValues['admissionRequestSuccessMsg'][locale.languageCode]; String get infoStatus => localizedValues['infoStatus'][locale.languageCode]; - String get doctorResponse => localizedValues['doctorResponse'][locale.languageCode]; -String get sickleaveonhold => + String get doctorResponse => + localizedValues['doctorResponse'][locale.languageCode]; + String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; + String get noClinic => localizedValues['no-clinic'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 3250f33b434aa81cd7175a26beb9025b5a37ce33 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 24 Feb 2021 16:32:50 +0200 Subject: [PATCH 314/421] jira bugs fix --- lib/config/config.dart | 3 + lib/core/model/prescription_model.dart | 7 +- .../procedure/procedure_valadate_model.dart | 51 ++++++ .../procedure_valadate_request_model.dart | 32 ++++ lib/core/service/procedure_service.dart | 18 ++ lib/core/viewModel/procedure_View_model.dart | 18 ++ .../prescription/prescription_screen.dart | 155 ++++++++++++++---- .../procedures/add-procedure-form.dart | 45 ++++- lib/screens/procedures/update-procedure.dart | 2 +- 9 files changed, 290 insertions(+), 41 deletions(-) create mode 100644 lib/core/model/procedure/procedure_valadate_model.dart create mode 100644 lib/core/model/procedure/procedure_valadate_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 6e7089c3..704dc7da 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -207,6 +207,9 @@ const POST_ADMISSION_REQUEST = const GET_ITEM_BY_MEDICINE = 'Services/DoctorApplication.svc/REST/GetItemByMedicineCode'; +const GET_PROCEDURE_VALIDATION = + 'Services/DoctorApplication.svc/REST/ValidateProcedures'; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/core/model/prescription_model.dart b/lib/core/model/prescription_model.dart index 49001673..2806f861 100644 --- a/lib/core/model/prescription_model.dart +++ b/lib/core/model/prescription_model.dart @@ -58,6 +58,7 @@ class EntityList { dynamic stopDate; dynamic uom; dynamic pharmacistRemarks; + dynamic pharmacyInervention; dynamic refill; EntityList( @@ -91,7 +92,8 @@ class EntityList { this.stopDate, this.uom, this.pharmacistRemarks, - this.refill}); + this.refill, + this.pharmacyInervention}); EntityList.fromJson(Map json) { appointmentNo = json['appointmentNo']; @@ -125,6 +127,7 @@ class EntityList { uom = json['uom']; pharmacistRemarks = json['pharmacistRemarks']; refill = json['refill']; + pharmacyInervention = json['interventionID']; } Map toJson() { @@ -160,6 +163,8 @@ class EntityList { data['uom'] = this.uom; data['pharmacistRemarks'] = this.pharmacistRemarks; data['refill'] = this.refill; + data['interventionID'] = this.pharmacyInervention; + return data; } } diff --git a/lib/core/model/procedure/procedure_valadate_model.dart b/lib/core/model/procedure/procedure_valadate_model.dart new file mode 100644 index 00000000..3a3e23cf --- /dev/null +++ b/lib/core/model/procedure/procedure_valadate_model.dart @@ -0,0 +1,51 @@ +class ProcedureValadteModel { + List entityList; + int rowcount; + dynamic statusMessage; + dynamic success; + + ProcedureValadteModel( + {this.entityList, this.rowcount, this.statusMessage, this.success}); + + ProcedureValadteModel.fromJson(Map json) { + if (json['entityList'] != null) { + entityList = new List(); + json['entityList'].forEach((v) { + entityList.add(new EntityList.fromJson(v)); + }); + } + rowcount = json['rowcount']; + statusMessage = json['statusMessage']; + success = json['success']; + } + + Map toJson() { + final Map data = new Map(); + if (this.entityList != null) { + data['entityList'] = this.entityList.map((v) => v.toJson()).toList(); + } + data['rowcount'] = this.rowcount; + data['statusMessage'] = this.statusMessage; + data['success'] = this.success; + return data; + } +} + +class EntityList { + String procedureId; + List warringMessages; + + EntityList({this.procedureId, this.warringMessages}); + + EntityList.fromJson(Map json) { + procedureId = json['procedureId']; + warringMessages = json['warringMessages'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['procedureId'] = this.procedureId; + data['warringMessages'] = this.warringMessages; + return data; + } +} diff --git a/lib/core/model/procedure/procedure_valadate_request_model.dart b/lib/core/model/procedure/procedure_valadate_request_model.dart new file mode 100644 index 00000000..0b872b93 --- /dev/null +++ b/lib/core/model/procedure/procedure_valadate_request_model.dart @@ -0,0 +1,32 @@ +class ProcedureValadteRequestModel { + String vidaAuthTokenID; + int patientMRN; + int appointmentNo; + int episodeID; + List procedure; + + ProcedureValadteRequestModel( + {this.vidaAuthTokenID, + this.patientMRN, + this.appointmentNo, + this.episodeID, + this.procedure}); + + ProcedureValadteRequestModel.fromJson(Map json) { + vidaAuthTokenID = json['VidaAuthTokenID']; + patientMRN = json['PatientMRN']; + appointmentNo = json['AppointmentNo']; + episodeID = json['EpisodeID']; + procedure = json['Procedure'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appointmentNo; + data['EpisodeID'] = this.episodeID; + data['Procedure'] = this.procedure; + return data; + } +} diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 98b1f36d..10b66d94 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -5,6 +5,8 @@ import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_re import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; @@ -13,6 +15,8 @@ import 'package:flutter/foundation.dart'; class ProcedureService extends BaseService { List _procedureList = List(); List get procedureList => _procedureList; + List _valadteProcedureList = List(); + List get valadteProcedureList => _valadteProcedureList; List _categoriesList = List(); List get categoriesList => _categoriesList; List procedureslist = List(); @@ -118,4 +122,18 @@ class ProcedureService extends BaseService { super.error = error; }, body: updateProcedureRequestModel.toJson()); } + + Future valadteProcedure( + ProcedureValadteRequestModel procedureValadteRequestModel) async { + hasError = false; + _valadteProcedureList.clear(); + await baseAppClient.post(GET_PROCEDURE_VALIDATION, + onSuccess: (dynamic response, int statusCode) { + _valadteProcedureList.add( + ProcedureValadteModel.fromJson(response['ValidateProcedureList'])); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: procedureValadteRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index a753052c..199fa308 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -3,6 +3,8 @@ import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dar import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/service/procedure_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; @@ -13,6 +15,8 @@ class ProcedureViewModel extends BaseViewModel { ProcedureService _procedureService = locator(); List get procedureList => _procedureService.procedureList; + List get valadteProcedureList => + _procedureService.valadteProcedureList; List get categoriesList => _procedureService.categoriesList; List get categoryList => _procedureService.categoryList; @@ -69,6 +73,20 @@ class ProcedureViewModel extends BaseViewModel { } } + Future valadteProcedure( + ProcedureValadteRequestModel procedureValadteRequestModel) async { + hasError = false; + //_insuranceCardService.clearInsuranceCard(); + setState(ViewState.Busy); + await _procedureService.valadteProcedure(procedureValadteRequestModel); + if (_procedureService.hasError) { + error = _procedureService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + Future updateProcedure( {UpdateProcedureRequestModel updateProcedureRequestModel, int mrn}) async { diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 4800c361..9f2f9aa1 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -10,6 +10,7 @@ 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/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; class NewPrescriptionScreen extends StatefulWidget { @override @@ -208,30 +209,42 @@ class _NewPrescriptionScreenState extends State { 0.09, child: Column( children: [ - AppText( - (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - .toString() - : DateTime.now() - .year) - .toString(), - color: Colors - .green, - fontSize: - 13.5, - ), - AppText( - Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != - null - ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - .month) - : DateTime.now() - .month) - .toUpperCase(), - color: Colors - .green, - ), + // AppText( + // (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + // null + // ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + // .toString() + // : DateTime.now() + // .year) + // .toString(), + // color: Colors + // .green, + // fontSize: + // 13.5, + // ), + // AppText( + // Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + // null + // ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) + // .month) + // : DateTime.now() + // .month) + // .toUpperCase(), + // color: Colors + // .green, + // ), + // AppText( + // DateTime.parse(model + // .prescriptionList[ + // 0] + // .entityList[ + // index] + // .createdOn) + // .day + // .toString(), + // color: Colors + // .green, + // ), AppText( DateTime.parse(model .prescriptionList[ @@ -239,7 +252,6 @@ class _NewPrescriptionScreenState extends State { .entityList[ index] .createdOn) - .day .toString(), color: Colors .green, @@ -273,14 +285,10 @@ class _NewPrescriptionScreenState extends State { Expanded( child: AppText( - model - .prescriptionList[ - 0] - .entityList[ - index] - .startDate - .replaceAll("-", - "/"), + Helpers.getDateFormatted(DateTime.parse(model + .prescriptionList[0] + .entityList[index] + .startDate)), fontSize: 12.0, ), @@ -381,6 +389,87 @@ class _NewPrescriptionScreenState extends State { ), ], ), + Row( + children: [ + AppText( + 'UOM: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].uom), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].pharmacyInervention.toString() == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), + ), + ), + ], + ), SizedBox( height: 5.0), diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 346de2db..071b4000 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -18,6 +19,16 @@ import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, + List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + + procedureValadteRequestModel.patientMRN = patient.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; +} + postProcedure( {ProcedureViewModel model, String remarks, @@ -25,6 +36,12 @@ postProcedure( PatiantInformtion patient, List entityList}) async { PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + List controlsProcedure = List(); postProcedureReqModel.appointmentNo = patient.appointmentNo; @@ -33,11 +50,12 @@ postProcedure( postProcedureReqModel.patientMRN = patient.patientMRN; entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; List controls = List(); controls.add( Controls( code: "remarks", - controlValue: element.remarks.isNotEmpty ? element.remarks : ""), + controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( Controls(code: "ordertype", controlValue: element.type), @@ -49,13 +67,28 @@ postProcedure( }); postProcedureReqModel.procedures = controlsProcedure; - await model.postProcedure(postProcedureReqModel, patient.patientMRN); + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); - if (model.state == ViewState.ErrorLocal) { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { helpers.showErrorToast(model.error); - model.getProcedure(mrn: patient.patientMRN); - } else if (model.state == ViewState.Idle) { - DrAppToastMsg.showSuccesToast('procedure has been added'); } } diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index c6af1358..756696fe 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -324,7 +324,7 @@ class _UpdateProcedureWidgetState extends State { entityList.isNotEmpty ? entityList.forEach((element) { controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = element.categoryID; + controlsProcedure.category = "0" + element.categoryID; controlsProcedure.controls = controls; }) : controlsProcedure.procedure = procedureId; From 066ac94d4a9bc38f135e92a0f72642f0d91ec339 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 24 Feb 2021 16:54:34 +0200 Subject: [PATCH 315/421] jira bugs --- .../prescription/prescription_screen.dart | 74 +++++++++---------- lib/util/helpers.dart | 8 ++ 2 files changed, 45 insertions(+), 37 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 9f2f9aa1..9e3a5f04 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -209,42 +209,30 @@ class _NewPrescriptionScreenState extends State { 0.09, child: Column( children: [ - // AppText( - // (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != - // null - // ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) - // .toString() - // : DateTime.now() - // .year) - // .toString(), - // color: Colors - // .green, - // fontSize: - // 13.5, - // ), - // AppText( - // Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != - // null - // ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) - // .month) - // : DateTime.now() - // .month) - // .toUpperCase(), - // color: Colors - // .green, - // ), - // AppText( - // DateTime.parse(model - // .prescriptionList[ - // 0] - // .entityList[ - // index] - // .createdOn) - // .day - // .toString(), - // color: Colors - // .green, - // ), + AppText( + (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + .toString() + : DateTime.now() + .year) + .toString(), + color: Colors + .green, + fontSize: + 13.5, + ), + AppText( + Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) + .month) + : DateTime.now() + .month) + .toUpperCase(), + color: Colors + .green, + ), AppText( DateTime.parse(model .prescriptionList[ @@ -252,6 +240,18 @@ class _NewPrescriptionScreenState extends State { .entityList[ index] .createdOn) + .day + .toString(), + color: Colors + .green, + ), + AppText( + Helpers.getTimeFormated(DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .createdOn)) .toString(), color: Colors .green, @@ -446,7 +446,7 @@ class _NewPrescriptionScreenState extends State { Row( children: [ AppText( - 'BOX Quantity: ', + 'pharmacy Intervention ', fontWeight: FontWeight .w700, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 09bc8f50..4f9543c1 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -303,6 +303,14 @@ class Helpers { return ""; } + static String getTimeFormated(DateTime dateTime) { + print(dateTime); + if (dateTime != null) + return dateTime.hour.toString() + ":" + dateTime.minute.toString(); + else + return ""; + } + /* *@author: Mohammad Aljammal *@Date:26/5/2020 From bedf6e7bbefa966e3c24af8c83a485fab34ee54d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 25 Feb 2021 10:31:47 +0200 Subject: [PATCH 316/421] fix DA-346 --- lib/config/localized_values.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 882de2e4..6bdca5c5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -174,8 +174,8 @@ const Map> localizedValues = { 'ar': 'الرجاء ادخال الرمز' }, 'youDon\'tHaveAnyPatient': { - 'en': 'You don\'t have any patient', - 'ar': 'ليس لديك اي مرضى' + 'en': 'No data found for the selected search criteria', + 'ar': 'لا توجد بيانات لمعايير البحث المختارة' }, 'age': {'en': 'Age', 'ar': 'العمر'}, 'nationality': {'en': 'Nationality', 'ar': 'الجنسية'}, From eb88bea880fb13e562d8a099e925fe13cc247a69 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Feb 2021 16:49:53 +0200 Subject: [PATCH 317/421] jira bug --- lib/screens/procedures/update-procedure.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 756696fe..aebf2797 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -259,6 +259,11 @@ class _UpdateProcedureWidgetState extends State { .updateProcedure .toUpperCase(), onPressed: () { + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } Navigator.pop(context); updateProcedure( orderNo: widget.orderNo, From dc941b709ff573a7f73cbc29d098a929e3cc8ffe Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 25 Feb 2021 22:02:05 +0200 Subject: [PATCH 318/421] DA-396 --- .../model/get_medication_response_model.dart | 14 +++--- .../prescription/add_prescription_form.dart | 44 ++++++++++++------- .../update_prescription_form.dart | 10 ++--- 3 files changed, 42 insertions(+), 26 deletions(-) diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/get_medication_response_model.dart index f9df77a3..1f9597f5 100644 --- a/lib/core/model/get_medication_response_model.dart +++ b/lib/core/model/get_medication_response_model.dart @@ -5,14 +5,16 @@ class GetMedicationResponseModel { String keywords; dynamic price; dynamic quantity; + bool isNarcotic; GetMedicationResponseModel( {this.description, - this.genericName, - this.itemId, - this.keywords, - this.price, - this.quantity}); + this.genericName, + this.itemId, + this.keywords, + this.price, + this.quantity, + this.isNarcotic}); GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; @@ -21,6 +23,7 @@ class GetMedicationResponseModel { keywords = json['Keywords']; price = json['Price']; quantity = json['Quantity']; + isNarcotic = json['isNarcotic']; } Map toJson() { @@ -31,6 +34,7 @@ class GetMedicationResponseModel { data['Keywords'] = this.keywords; data['Price'] = this.price; data['Quantity'] = this.quantity; + data['isNarcotic'] = this.isNarcotic; return data; } } diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5ec6e240..b3398cb3 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -361,8 +361,8 @@ class _PrescriptionFormWidgetState extends State { 0.550, child: TextFields( inputFormatters: [ - // LengthLimitingTextInputFormatter( - // 4), + LengthLimitingTextInputFormatter( + 5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -378,9 +378,9 @@ class _PrescriptionFormWidgetState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar >= 4) { + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); + "Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -757,6 +757,14 @@ class _PrescriptionFormWidgetState extends State { // formKey.currentState.save(); // Navigator.pop(context); // openDrugToDrug(); + if (_selectedMedication + .isNarcotic == + true) { + DrAppToastMsg.showErrorToast( + "Narcotic medicine can only be prescribed from VIDA"); + Navigator.pop(context); + return; + } if (route == null || frequency == null || doseTime == null || @@ -775,10 +783,10 @@ class _PrescriptionFormWidgetState extends State { return; } if (double.parse( - strengthController.text) == + strengthController.text) < 0.0) { DrAppToastMsg.showErrorToast( - "Streangth can't be zero"); + "strength can't be zero"); return; } @@ -794,16 +802,20 @@ class _PrescriptionFormWidgetState extends State { // .join(','); postProcedure( icdCode: model - .patientAssessmentList[ - 0] - .icdCode10ID - .isEmpty - ? "test" - : model - .patientAssessmentList[ - 0] - .icdCode10ID - .toString(), + .patientAssessmentList + .isNotEmpty + ? model + .patientAssessmentList[ + 0] + .icdCode10ID + .isEmpty + ? "test" + : model + .patientAssessmentList[ + 0] + .icdCode10ID + .toString() + : "TEST", // icdCode: model // .patientAssessmentList // .map((value) => value diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 8ed5c79b..3420783e 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -256,7 +256,7 @@ class _UpdatePrescriptionFormState extends State { child: TextFields( inputFormatters: [ LengthLimitingTextInputFormatter( - 4), + 5), // WhitelistingTextInputFormatter // .digitsOnly ], @@ -272,9 +272,9 @@ class _UpdatePrescriptionFormState extends State { setState(() { strengthChar = value.length; }); - if (strengthChar >= 4) { + if (strengthChar >= 5) { DrAppToastMsg.showErrorToast( - "Only 4 Digits allowed for strength"); + "Only 5 Digits allowed for strength"); } }, // validator: (value) { @@ -715,14 +715,14 @@ class _UpdatePrescriptionFormState extends State { .text) == 0.0) { DrAppToastMsg.showErrorToast( - "Streangth can't be zero"); + "strength can't be zero"); return; } if (strengthController .text.length > 4) { DrAppToastMsg.showErrorToast( - "Streangth can't be zero"); + "strength can't be more then 4 digits "); return; } updatePrescription( From bfe73ebe1df6af781dcacb1f382e4790fa9efa8a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Fri, 26 Feb 2021 01:09:33 +0200 Subject: [PATCH 319/421] DA-185 --- lib/core/viewModel/medicine_view_model.dart | 9 ++ lib/core/viewModel/procedure_View_model.dart | 2 +- .../update_prescription_form.dart | 83 ++++++++++--------- .../entity_list_checkbox_search_widget.dart | 5 ++ lib/screens/procedures/update-procedure.dart | 14 +--- lib/util/dr_app_toast_msg.dart | 2 +- 6 files changed, 66 insertions(+), 49 deletions(-) diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index ecb0a48a..9f446f46 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -167,4 +167,13 @@ class MedicineViewModel extends BaseViewModel { } return null; } + + dynamic getLookupByIdFilter(List list, String id) { + for (int i = 0; i < list.length; i++) { + if (list[i]['parameterCode'].toString() == id) { + return list[i]; + } + } + return null; + } } diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 199fa308..6af34f4d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -99,6 +99,6 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); - await getProcedure(mrn: mrn); + //await getProcedure(mrn: mrn); } } diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 3420783e..50406338 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -79,6 +79,7 @@ class _UpdatePrescriptionFormState extends State { @override void initState() { super.initState(); + strengthController.text = widget.doseStreangth; remarksController.text = widget.remarks; indicationList = List(); @@ -121,14 +122,16 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationRoute(); await model.getMedicationFrequency(); await model.getMedicationDoseTime(); + await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupById(model.medicationRouteList, widget.route); + route = model.getLookupByIdFilter( + model.itemMedicineListRoute, widget.route); doseTime = - model.getLookupById(model.medicationDoseTimeList, widget.dose); + model.getLookupByIdFilter(model.itemMedicineList, widget.dose); updatedDuration = model.getLookupById( model.medicationDurationList, widget.duration); - units = model.getLookupById( - model.medicationStrengthList, widget.doseUnit); + units = model.getLookupByIdFilter( + model.itemMedicineListUnit, widget.doseUnit); frequencyUpdate = model.getLookupById( model.medicationFrequencyList, widget.frequency); }, @@ -298,7 +301,7 @@ class _UpdatePrescriptionFormState extends State { 0.3700, child: InkWell( onTap: - model.medicationStrengthList != + model.itemMedicineListUnit != null ? () { Helpers.hideKeyboard( @@ -307,11 +310,11 @@ class _UpdatePrescriptionFormState extends State { dialog = ListSelectDialog( list: model - .medicationStrengthList, + .itemMedicineListUnit, attributeName: - 'nameEn', + 'description', attributeValueId: - 'id', + 'parameterCode', okText: TranslationBase.of( context) @@ -341,7 +344,8 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'UNIT Type', units != null - ? units['nameEn'] + ? units[ + 'description'] : null, true), enabled: false, @@ -359,15 +363,17 @@ class _UpdatePrescriptionFormState extends State { MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationRouteList != null + onTap: model.itemMedicineListRoute != + null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', + list: model + .itemMedicineListRoute, + attributeName: 'description', + attributeValueId: + 'parameterCode', okText: TranslationBase.of( context) .ok, @@ -395,7 +401,7 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'Route', route != null - ? route['nameEn'] + ? route['description'] : null, true), enabled: false, @@ -410,16 +416,15 @@ class _UpdatePrescriptionFormState extends State { MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationDoseTimeList != - null + onTap: model.itemMedicineList != null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: model - .medicationDoseTimeList, - attributeName: 'nameEn', - attributeValueId: 'id', + list: model.itemMedicineList, + attributeName: 'description', + attributeValueId: + 'parameterCode', okText: TranslationBase.of( context) .ok, @@ -445,7 +450,7 @@ class _UpdatePrescriptionFormState extends State { TranslationBase.of(context) .doseTime, doseTime != null - ? doseTime['nameEn'] + ? doseTime['description'] : null, true), enabled: false, @@ -735,7 +740,8 @@ class _UpdatePrescriptionFormState extends State { : widget .doseStreangth, newUnit: units != null - ? units['id'].toString() + ? units['parameterCode'] + .toString() : widget.doseUnit, doseUnit: widget.doseUnit, doseStreangth: @@ -747,24 +753,27 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: updatedDuration != - null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: + updatedDuration != null + ? updatedDuration['id'] + .toString() + : widget.duration, drugId: widget.drugId, - remarks: - remarksController.text, + remarks: remarksController + .text, route: route != null - ? route['id'].toString() - : widget.route, - frequency: frequencyUpdate != - null - ? frequencyUpdate['id'] + ? route[ + 'parameterCode'] .toString() - : widget.frequency, + : widget.route, + frequency: + frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, dose: doseTime != null - ? doseTime['id'] + ? doseTime['parameterCode'] .toString() : widget.dose, enteredRemarks: diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index f68b88cd..1c05af7e 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -41,6 +41,9 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { int selectedType = 1; + int typeUrgent; + int typeRegular; + setSelectedType(int val) { setState(() { selectedType = val; @@ -136,6 +139,7 @@ class _EntityListCheckboxSearchWidgetState historyInfo.type = setSelectedType(value) .toString(); + historyInfo.type = value.toString(); }, @@ -149,6 +153,7 @@ class _EntityListCheckboxSearchWidgetState historyInfo.type = setSelectedType(value) .toString(); + historyInfo.type = value.toString(); }, diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index aebf2797..445203a4 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -324,17 +324,11 @@ class _UpdateProcedureWidgetState extends State { controls.add( Controls(code: "ordertype", controlValue: '1'), ); - }); - entityList.isNotEmpty - ? entityList.forEach((element) { - controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = "0" + element.categoryID; - controlsProcedure.controls = controls; - }) - : controlsProcedure.procedure = procedureId; - controlsProcedure.category = categorieId; - controlsProcedure.controls = controls; + controlsProcedure.procedure = element.procedureId; + controlsProcedure.category = element.categoryID; + controlsProcedure.controls = controls; + }); // controlsProcedure.add(ProcedureDetail( // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; diff --git a/lib/util/dr_app_toast_msg.dart b/lib/util/dr_app_toast_msg.dart index e4cfa65b..bf91a11f 100644 --- a/lib/util/dr_app_toast_msg.dart +++ b/lib/util/dr_app_toast_msg.dart @@ -29,7 +29,7 @@ class DrAppToastMsg { icon: ICON.CLOSE, fontSize: 16, imageSize: 35, - timeInSeconds: 9000, + timeInSeconds: 912, textColor: Colors.white); } From 7063e924decdf1463c0b100fa8576a18bc8e8c58 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 27 Feb 2021 20:56:55 +0200 Subject: [PATCH 320/421] update prescription --- .../update_prescription_form.dart | 83 +++++++++---------- 1 file changed, 38 insertions(+), 45 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 50406338..3c94aecb 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -122,16 +122,15 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationRoute(); await model.getMedicationFrequency(); await model.getMedicationDoseTime(); - await model.getItem(itemID: widget.drugId); + //await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupByIdFilter( - model.itemMedicineListRoute, widget.route); + route = model.getLookupById(model.medicationRouteList, widget.route); doseTime = - model.getLookupByIdFilter(model.itemMedicineList, widget.dose); + model.getLookupById(model.medicationDoseTimeList, widget.dose); updatedDuration = model.getLookupById( model.medicationDurationList, widget.duration); - units = model.getLookupByIdFilter( - model.itemMedicineListUnit, widget.doseUnit); + units = model.getLookupById( + model.medicationStrengthList, widget.doseUnit); frequencyUpdate = model.getLookupById( model.medicationFrequencyList, widget.frequency); }, @@ -301,7 +300,7 @@ class _UpdatePrescriptionFormState extends State { 0.3700, child: InkWell( onTap: - model.itemMedicineListUnit != + model.medicationStrengthList != null ? () { Helpers.hideKeyboard( @@ -310,11 +309,11 @@ class _UpdatePrescriptionFormState extends State { dialog = ListSelectDialog( list: model - .itemMedicineListUnit, + .medicationStrengthList, attributeName: - 'description', + 'nameEn', attributeValueId: - 'parameterCode', + 'id', okText: TranslationBase.of( context) @@ -344,8 +343,7 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'UNIT Type', units != null - ? units[ - 'description'] + ? units['nameEn'] : null, true), enabled: false, @@ -363,17 +361,15 @@ class _UpdatePrescriptionFormState extends State { MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.itemMedicineListRoute != - null + onTap: model.medicationRouteList != null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: model - .itemMedicineListRoute, - attributeName: 'description', - attributeValueId: - 'parameterCode', + list: + model.medicationRouteList, + attributeName: 'nameEn', + attributeValueId: 'id', okText: TranslationBase.of( context) .ok, @@ -401,7 +397,7 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'Route', route != null - ? route['description'] + ? route['nameEn'] : null, true), enabled: false, @@ -416,15 +412,16 @@ class _UpdatePrescriptionFormState extends State { MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.itemMedicineList != null + onTap: model.medicationDoseTimeList != + null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: model.itemMedicineList, - attributeName: 'description', - attributeValueId: - 'parameterCode', + list: model + .medicationDoseTimeList, + attributeName: 'nameEn', + attributeValueId: 'id', okText: TranslationBase.of( context) .ok, @@ -450,7 +447,7 @@ class _UpdatePrescriptionFormState extends State { TranslationBase.of(context) .doseTime, doseTime != null - ? doseTime['description'] + ? doseTime['nameEn'] : null, true), enabled: false, @@ -740,8 +737,7 @@ class _UpdatePrescriptionFormState extends State { : widget .doseStreangth, newUnit: units != null - ? units['parameterCode'] - .toString() + ? units['id'].toString() : widget.doseUnit, doseUnit: widget.doseUnit, doseStreangth: @@ -753,27 +749,24 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: - updatedDuration != null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: updatedDuration != + null + ? updatedDuration['id'] + .toString() + : widget.duration, drugId: widget.drugId, - remarks: remarksController - .text, + remarks: + remarksController.text, route: route != null - ? route[ - 'parameterCode'] - .toString() + ? route['id'].toString() : widget.route, - frequency: - frequencyUpdate != - null - ? frequencyUpdate['id'] - .toString() - : widget.frequency, + frequency: frequencyUpdate != + null + ? frequencyUpdate['id'] + .toString() + : widget.frequency, dose: doseTime != null - ? doseTime['parameterCode'] + ? doseTime['id'] .toString() : widget.dose, enteredRemarks: From 8aeb7495966913afd9c95a409f2153ab54f53c16 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sat, 27 Feb 2021 22:06:56 +0200 Subject: [PATCH 321/421] prescription update --- lib/screens/prescription/prescription_screen.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 9e3a5f04..ab152bf1 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -206,7 +206,7 @@ class _NewPrescriptionScreenState extends State { context) .size .width * - 0.09, + 0.1, child: Column( children: [ AppText( @@ -290,7 +290,7 @@ class _NewPrescriptionScreenState extends State { .entityList[index] .startDate)), fontSize: - 12.0, + 13.5, ), ), SizedBox( @@ -465,7 +465,7 @@ class _NewPrescriptionScreenState extends State { text: TextSpan( style: TextStyle(color: Colors.black), - text: model.prescriptionList[0].entityList[index].pharmacyInervention.toString() == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), + text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), ), ), ], From 4e01bcb75892a26579a77042f06daab9e4d86d24 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 28 Feb 2021 13:28:25 +0200 Subject: [PATCH 322/421] Prescription update filters --- .../prescription/add_prescription_form.dart | 5 ++ .../update_prescription_form.dart | 65 ++++++++++--------- 2 files changed, 41 insertions(+), 29 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index b3398cb3..81e85dfa 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -424,6 +424,8 @@ class _PrescriptionFormWidgetState extends State { (selectedValue) { setState(() { units = selectedValue; + units['isDefault'] = + true; }); }, ); @@ -472,6 +474,7 @@ class _PrescriptionFormWidgetState extends State { okFunction: (selectedValue) { setState(() { route = selectedValue; + route['isDefault'] = true; }); if (route == null) { helpers.showErrorToast( @@ -519,6 +522,8 @@ class _PrescriptionFormWidgetState extends State { okFunction: (selectedValue) { setState(() { frequency = selectedValue; + frequency['isDefault'] = + true; }); }, ); diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 3c94aecb..67723cde 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -122,15 +122,16 @@ class _UpdatePrescriptionFormState extends State { await model.getMedicationRoute(); await model.getMedicationFrequency(); await model.getMedicationDoseTime(); - //await model.getItem(itemID: widget.drugId); + await model.getItem(itemID: widget.drugId); //await model.getMedicationIndications(); - route = model.getLookupById(model.medicationRouteList, widget.route); + route = model.getLookupByIdFilter( + model.itemMedicineListRoute, widget.route); doseTime = model.getLookupById(model.medicationDoseTimeList, widget.dose); updatedDuration = model.getLookupById( model.medicationDurationList, widget.duration); - units = model.getLookupById( - model.medicationStrengthList, widget.doseUnit); + units = model.getLookupByIdFilter( + model.itemMedicineListUnit, widget.doseUnit); frequencyUpdate = model.getLookupById( model.medicationFrequencyList, widget.frequency); }, @@ -300,7 +301,7 @@ class _UpdatePrescriptionFormState extends State { 0.3700, child: InkWell( onTap: - model.medicationStrengthList != + model.itemMedicineListUnit != null ? () { Helpers.hideKeyboard( @@ -309,11 +310,11 @@ class _UpdatePrescriptionFormState extends State { dialog = ListSelectDialog( list: model - .medicationStrengthList, + .itemMedicineListUnit, attributeName: - 'nameEn', + 'description', attributeValueId: - 'id', + 'parameterCode', okText: TranslationBase.of( context) @@ -343,7 +344,8 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'UNIT Type', units != null - ? units['nameEn'] + ? units[ + 'description'] : null, true), enabled: false, @@ -361,15 +363,17 @@ class _UpdatePrescriptionFormState extends State { MediaQuery.of(context).size.height * 0.070, child: InkWell( - onTap: model.medicationRouteList != null + onTap: model.itemMedicineListRoute != + null ? () { Helpers.hideKeyboard(context); ListSelectDialog dialog = ListSelectDialog( - list: - model.medicationRouteList, - attributeName: 'nameEn', - attributeValueId: 'id', + list: model + .itemMedicineListRoute, + attributeName: 'description', + attributeValueId: + 'parameterCode', okText: TranslationBase.of( context) .ok, @@ -397,7 +401,7 @@ class _UpdatePrescriptionFormState extends State { textFieldSelectorDecoration( 'Route', route != null - ? route['nameEn'] + ? route['description'] : null, true), enabled: false, @@ -737,7 +741,8 @@ class _UpdatePrescriptionFormState extends State { : widget .doseStreangth, newUnit: units != null - ? units['id'].toString() + ? units['parameterCode'] + .toString() : widget.doseUnit, doseUnit: widget.doseUnit, doseStreangth: @@ -749,22 +754,24 @@ class _UpdatePrescriptionFormState extends State { routeId: widget.route, patient: widget.patient, model: widget.model, - newDuration: updatedDuration != - null - ? updatedDuration['id'] - .toString() - : widget.duration, + newDuration: + updatedDuration != null + ? updatedDuration['id'] + .toString() + : widget.duration, drugId: widget.drugId, - remarks: - remarksController.text, + remarks: remarksController + .text, route: route != null - ? route['id'].toString() - : widget.route, - frequency: frequencyUpdate != - null - ? frequencyUpdate['id'] + ? route['parameterCode'] .toString() - : widget.frequency, + : widget.route, + frequency: + frequencyUpdate != null + ? frequencyUpdate[ + 'id'] + .toString() + : widget.frequency, dose: doseTime != null ? doseTime['id'] .toString() From 6ae8cf80481730ab33d245ad94d6f295adf1378c Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 1 Mar 2021 16:38:44 +0200 Subject: [PATCH 323/421] procedure updates --- lib/core/service/procedure_service.dart | 2 +- .../procedures/add-procedure-form.dart | 81 ++++--- .../entity_list_checkbox_search_widget.dart | 6 +- .../entity_list_procedure_widget.dart | 171 ++++++++++++++ lib/screens/procedures/procedure_screen.dart | 101 +++++---- lib/screens/procedures/update-procedure.dart | 212 +++++++++++------- 6 files changed, 420 insertions(+), 153 deletions(-) create mode 100644 lib/screens/procedures/entity_list_procedure_widget.dart diff --git a/lib/core/service/procedure_service.dart b/lib/core/service/procedure_service.dart index 10b66d94..f61166b9 100644 --- a/lib/core/service/procedure_service.dart +++ b/lib/core/service/procedure_service.dart @@ -84,7 +84,7 @@ class ProcedureService extends BaseService { pageIndex: 0, clinicId: 0, pageSize: 0, - category: categoryID, + category: categoryID ?? "01", ); hasError = false; _categoriesList.clear(); diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 071b4000..d6c1b419 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -18,6 +18,7 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'entity_list_checkbox_search_widget.dart'; +import 'entity_list_procedure_widget.dart'; valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, List entityList) async { @@ -58,7 +59,7 @@ postProcedure( controlValue: element.remarks != null ? element.remarks : ""), ); controls.add( - Controls(code: "ordertype", controlValue: element.type), + Controls(code: "ordertype", controlValue: "0"), ); controlsProcedure.add(Procedures( category: element.categoryID, @@ -124,7 +125,10 @@ class _AddSelectedProcedureState extends State { TextEditingController procedureController = TextEditingController(); TextEditingController remarksController = TextEditingController(); List entityList = List(); + List entityListProcedure = List(); + dynamic selectedCategory; + setSelectedType(int val) { setState(() { selectedType = val; @@ -153,10 +157,9 @@ class _AddSelectedProcedureState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context) - .selectProcedures - .toUpperCase(), + 'Please Select Category', fontWeight: FontWeight.w900, + fontSize: 15.0, ), SizedBox( height: 10.0, @@ -219,29 +222,53 @@ class _AddSelectedProcedureState extends State { ), if (widget.model.categoriesList.length != 0) NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: - widget.model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ), - ), + baseViewModel: model, + child: selectedCategory != null + ? selectedCategory['categoryId'] == 02 || + selectedCategory['categoryId'] == 03 + ? EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget.model + .categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ) + : ProcedureListWidget( + model: widget.model, + masterList: widget.model + .categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + ) + : null), SizedBox( height: 15.0, ), diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 1c05af7e..b36f11c4 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -40,7 +40,7 @@ class EntityListCheckboxSearchWidget extends StatefulWidget { class _EntityListCheckboxSearchWidgetState extends State { - int selectedType = 1; + int selectedType = 0; int typeUrgent; int typeRegular; @@ -133,7 +133,7 @@ class _EntityListCheckboxSearchWidgetState .orderType), Radio( activeColor: Color(0xFFB9382C), - value: 1, + value: 0, groupValue: selectedType, onChanged: (value) { historyInfo.type = @@ -148,7 +148,7 @@ class _EntityListCheckboxSearchWidgetState Radio( activeColor: Color(0xFFB9382C), groupValue: selectedType, - value: 0, + value: 1, onChanged: (value) { historyInfo.type = setSelectedType(value) diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart new file mode 100644 index 00000000..2f5c6ea2 --- /dev/null +++ b/lib/screens/procedures/entity_list_procedure_widget.dart @@ -0,0 +1,171 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/TextFields.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/divider_with_spaces_around.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class ProcedureListWidget extends StatefulWidget { + final ProcedureViewModel model; + final Function addSelectedHistories; + final Function(EntityList) removeHistory; + final Function(EntityList) addHistory; + final Function(EntityList) addRemarks; + + final bool Function(EntityList) isEntityListSelected; + final List masterList; + + ProcedureListWidget( + {Key key, + this.model, + this.addSelectedHistories, + this.removeHistory, + this.masterList, + this.addHistory, + this.isEntityListSelected, + this.addRemarks}) + : super(key: key); + + @override + _ProcedureListWidgetState createState() => _ProcedureListWidgetState(); +} + +class _ProcedureListWidgetState extends State { + int selectedType = 0; + int typeUrgent; + int typeRegular; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + List items = List(); + List remarksList = List(); + List typeList = List(); + + @override + void initState() { + items.addAll(widget.masterList); + super.initState(); + } + + TextEditingController remarksController = TextEditingController(); + @override + Widget build(BuildContext context) { + return Container( + child: Column( + children: [ + NetworkBaseView( + baseViewModel: widget.model, + child: Container( + height: MediaQuery.of(context).size.height * 0.55, + child: Center( + child: Container( + margin: EdgeInsets.only(top: 15), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white), + child: ListView( + children: [ + TextFields( + hintText: TranslationBase.of(context).searchProcedures, + suffixIcon: EvaIcons.search, + onChanged: (value) { + filterSearchResults(value); + }, + ), + SizedBox( + height: 15, + ), + items.length != 0 + ? Column( + children: items.map((historyInfo) { + return Column( + children: [ + Row( + children: [ + Checkbox( + value: widget.isEntityListSelected( + historyInfo), + activeColor: Colors.red[800], + onChanged: (bool newValue) { + setState(() { + if (widget.isEntityListSelected( + historyInfo)) { + widget + .removeHistory(historyInfo); + } else { + widget.addHistory(historyInfo); + } + }); + }), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + horizontal: 10, vertical: 0), + child: Texts( + historyInfo.procedureName, + variant: "bodyText", + bold: true, + color: Colors.black), + ), + ), + ], + ), + DividerWithSpacesAround(), + ], + ); + }).toList(), + ) + : Center( + child: Container( + child: AppText( + "There's no procedures for this category", + color: Color(0xFFB9382C)), + ), + ) + ], + ), + )), + ), + ), + SizedBox( + height: 10, + ), + ], + ), + ); + } + + void filterSearchResults(String query) { + List dummySearchList = List(); + dummySearchList.addAll(widget.masterList); + if (query.isNotEmpty) { + List dummyListData = List(); + dummySearchList.forEach((item) { + if (item.procedureName.toLowerCase().contains(query.toLowerCase())) { + dummyListData.add(item); + } + }); + setState(() { + items.clear(); + items.addAll(dummyListData); + }); + return; + } else { + setState(() { + items.clear(); + items.addAll(widget.masterList); + }); + } + } +} diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index afe8a63e..f15e825d 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -235,7 +236,7 @@ class _ProcedureScreenState extends State { .entityList[ index] .orderType == - 0 + 1 ? Color( 0xFFB9382C) : Colors @@ -254,7 +255,7 @@ class _ProcedureScreenState extends State { .entityList[ index] .orderType == - 0 + 1 ? Color( 0xFFB9382C) : Colors @@ -274,7 +275,7 @@ class _ProcedureScreenState extends State { .entityList[ index] .orderType == - 0 + 1 ? Color( 0xFFB9382C) : Colors @@ -330,13 +331,13 @@ class _ProcedureScreenState extends State { Expanded( child: AppText( model.procedureList[0].entityList[index].orderType == - 1 + 0 ? 'Routine' : 'Urgent', fontSize: 13.5, color: model.procedureList[0].entityList[index].orderType == - 0 + 1 ? Color(0xFFB9382C) : Colors.green), ), @@ -459,43 +460,59 @@ class _ProcedureScreenState extends State { onTap: () { // model // .updateProcedure(); - updateProcedureForm( - context, - model: - model, - orderNo: model - .procedureList[ - 0] - .entityList[ - index] - .orderNo, - remarks: model - .procedureList[ - 0] - .entityList[ - index] - .remarks, - procedureName: model - .procedureList[ - 0] - .entityList[ - index] - .procedureName, - patient: - patient, - procedureId: model - .procedureList[ - 0] - .entityList[ - index] - .procedureId, - categoreId: model - .procedureList[ - 0] - .entityList[ - index] - .categoryID - .toString()); + if (model + .procedureList[ + 0] + .entityList[ + index] + .categoryID == + 02 || + model + .procedureList[0] + .entityList[index] + .categoryID == + 03) { + updateProcedureForm( + context, + model: + model, + orderNo: model + .procedureList[ + 0] + .entityList[ + index] + .orderNo, + remarks: model + .procedureList[ + 0] + .entityList[ + index] + .remarks, + procedureName: model + .procedureList[ + 0] + .entityList[ + index] + .procedureName, + patient: + patient, + procedureId: model + .procedureList[ + 0] + .entityList[ + index] + .procedureId, + categoreId: model + .procedureList[ + 0] + .entityList[ + index] + .categoryID + .toString()); + } else { + helpers.showErrorToast( + 'You cant Update this Procedure'); + } }, ) ], diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 445203a4..9f5d7f45 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/screens/procedures/entity_list_checkbox_search_widget.dart'; +import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widget.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/shared/TextFields.dart'; @@ -79,6 +80,11 @@ class _UpdateProcedureWidgetState extends State { }); } + void initState() { + super.initState(); + widget.remarksController.text = widget.remarks; + } + List entityList = List(); dynamic selectedCategory; @override @@ -177,74 +183,108 @@ class _UpdateProcedureWidgetState extends State { ), if (widget.model.categoriesList.length != 0) NetworkBaseView( - baseViewModel: model, - child: EntityListCheckboxSearchWidget( - model: widget.model, - masterList: widget - .model.categoriesList[0].entityList, - removeHistory: (item) { - setState(() { - entityList.remove(item); - }); - }, - addHistory: (history) { - setState(() { - entityList.add(history); - }); - }, - addSelectedHistories: () { - //TODO build your fun herr - // widget.addSelectedHistories(); - }, - isEntityListSelected: (master) => - isEntityListSelected(master), - ), + baseViewModel: model, + child: selectedCategory != null + ? selectedCategory['categoryId'] == + 02 || + selectedCategory[ + 'categoryId'] == + 03 + ? EntityListCheckboxSearchWidget( + model: widget.model, + masterList: widget + .model + .categoriesList[0] + .entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: + (master) => + isEntityListSelected( + master), + ) + : ProcedureListWidget( + model: widget.model, + masterList: widget + .model + .categoriesList[0] + .entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: + (master) => + isEntityListSelected( + master), + ) + : null), + Container( + child: Row( + children: [ + AppText( + TranslationBase.of(context).orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text(TranslationBase.of(context).urgent), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + setSelectedType(value); + }, + ), + Text('routine'), + ], + ), + ), + SizedBox( + height: 12.0, + ), + Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, + color: HexColor("#CCCCCC"))), + child: TextFields( + fontSize: 15.0, + controller: widget.remarksController, + maxLines: 3, + minLines: 2, + onChanged: (value) {}, ), - // Container( - // child: Row( - // children: [ - // AppText( - // TranslationBase.of(context).orderType), - // Radio( - // activeColor: Color(0xFFB9382C), - // value: 0, - // groupValue: selectedType, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text(TranslationBase.of(context).urgent), - // Radio( - // activeColor: Color(0xFFB9382C), - // groupValue: selectedType, - // value: 1, - // onChanged: (value) { - // setSelectedType(value); - // }, - // ), - // Text('routine'), - // ], - // ), - // ), - // SizedBox( - // height: 12.0, - // ), - // Container( - // decoration: BoxDecoration( - // borderRadius: - // BorderRadius.all(Radius.circular(6.0)), - // border: Border.all( - // width: 1.0, - // color: HexColor("#CCCCCC"))), - // child: TextFields( - // hintText: widget.remarks, - // fontSize: 15.0, - // controller: widget.remarksController, - // maxLines: 3, - // minLines: 2, - // onChanged: (value) {}, - // ), - // ), + ), SizedBox( height: 50.0, ), @@ -259,11 +299,11 @@ class _UpdateProcedureWidgetState extends State { .updateProcedure .toUpperCase(), onPressed: () { - if (entityList.isEmpty == true) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + // if (entityList.isEmpty == true) { + // DrAppToastMsg.showErrorToast( + // "Fill the mandatory procedure details"); + // return; + // } Navigator.pop(context); updateProcedure( orderNo: widget.orderNo, @@ -315,20 +355,32 @@ class _UpdateProcedureWidgetState extends State { updateProcedureReqModel.lineItemNo = 1; updateProcedureReqModel.orderNo = orderNo; - entityList.forEach((element) { + if (entityList.isNotEmpty) { + entityList.forEach((element) { + controls.add( + Controls(code: "remarks", controlValue: element.remarks ?? remarks), + ); + controls.add( + Controls(code: "ordertype", controlValue: '1'), + ); + + controlsProcedure.procedure = element.procedureId; + controlsProcedure.category = element.categoryID; + controlsProcedure.controls = controls; + }); + } else { controls.add( Controls( - code: "remarks", - controlValue: element.remarks.isNotEmpty ? element.remarks : ""), + code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( - Controls(code: "ordertype", controlValue: '1'), + Controls(code: "ordertype", controlValue: '0'), ); + } - controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = element.categoryID; - controlsProcedure.controls = controls; - }); + controlsProcedure.procedure = procedureId; + controlsProcedure.category = categorieId; + controlsProcedure.controls = controls; // controlsProcedure.add(ProcedureDetail( // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; From 24d13b06c50bf143129fe1737f18475e116a7bbe Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Mar 2021 02:47:20 +0200 Subject: [PATCH 324/421] Procedure update valdation --- .../prescription/update_prescription_form.dart | 1 + lib/screens/procedures/add-procedure-form.dart | 7 +++++++ lib/screens/procedures/update-procedure.dart | 12 +++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 67723cde..7892a1cd 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -731,6 +731,7 @@ class _UpdatePrescriptionFormState extends State { "strength can't be more then 4 digits "); return; } + // if(units==null&& updatedDuration==null&&frequencyUpdate==null&&) updatePrescription( newStartDate: selectedDate, newDoseStreangth: diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index d6c1b419..605bb61c 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -324,6 +324,13 @@ class _AddSelectedProcedureState extends State { .addSelectedProcedures, onPressed: () { //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + Navigator.pop(context); postProcedure( orderType: selectedType.toString(), diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 9f5d7f45..6918d9a2 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -299,11 +299,13 @@ class _UpdateProcedureWidgetState extends State { .updateProcedure .toUpperCase(), onPressed: () { - // if (entityList.isEmpty == true) { - // DrAppToastMsg.showErrorToast( - // "Fill the mandatory procedure details"); - // return; - // } + if (entityList.isEmpty == true && + widget.remarksController.text == + widget.remarks) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } Navigator.pop(context); updateProcedure( orderNo: widget.orderNo, From b00b739e7928eb9b9d4b4a8b7c7713a657f53694 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Mar 2021 13:55:15 +0200 Subject: [PATCH 325/421] categories that can update --- lib/screens/procedures/procedure_screen.dart | 7 ++++--- lib/screens/procedures/update-procedure.dart | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index f15e825d..92b286d8 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -460,18 +460,19 @@ class _ProcedureScreenState extends State { onTap: () { // model // .updateProcedure(); - if (model + if (model.procedureList[0].entityList[index].categoryID == 02 || + model .procedureList[ 0] .entityList[ index] .categoryID == - 02 || + 03 || model .procedureList[0] .entityList[index] .categoryID == - 03) { + 55) { updateProcedureForm( context, model: diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 6918d9a2..752bda5d 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -189,7 +189,10 @@ class _UpdateProcedureWidgetState extends State { 02 || selectedCategory[ 'categoryId'] == - 03 + 03 || + selectedCategory[ + 'categoryId'] == + 55 ? EntityListCheckboxSearchWidget( model: widget.model, masterList: widget From 46b5f2a5f3fa88a6182c01a59c716b6b2ee13035 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Mar 2021 14:57:35 +0200 Subject: [PATCH 326/421] update procedure for agreed categories --- lib/core/viewModel/procedure_View_model.dart | 2 +- lib/screens/procedures/procedure_screen.dart | 6 ++++++ lib/screens/procedures/update-procedure.dart | 20 +++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 6af34f4d..199fa308 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -99,6 +99,6 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); - //await getProcedure(mrn: mrn); + await getProcedure(mrn: mrn); } } diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 92b286d8..c66b66a9 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -475,6 +475,12 @@ class _ProcedureScreenState extends State { 55) { updateProcedureForm( context, + limetNo: model + .procedureList[ + 0] + .entityList[ + index] + .lineItemNo, model: model, orderNo: model diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 752bda5d..f09157a2 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -23,6 +23,7 @@ import 'package:hexcolor/hexcolor.dart'; void updateProcedureForm(context, {String procedureName, int orderNo, + int limetNo, PatiantInformtion patient, String orderType, String procedureId, @@ -45,6 +46,7 @@ void updateProcedureForm(context, procedureId: procedureId, categoryId: categoreId, orderNo: orderNo, + limetNo: limetNo, ); }); } @@ -58,6 +60,7 @@ class UpdateProcedureWidget extends StatefulWidget { final String procedureId; final String categoryId; final int orderNo; + final int limetNo; UpdateProcedureWidget( {this.model, @@ -67,7 +70,8 @@ class UpdateProcedureWidget extends StatefulWidget { this.patient, this.procedureId, this.categoryId, - this.orderNo}); + this.orderNo, + this.limetNo}); @override _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); } @@ -257,7 +261,7 @@ class _UpdateProcedureWidgetState extends State { setSelectedType(value); }, ), - Text(TranslationBase.of(context).urgent), + Text('routine'), Radio( activeColor: Color(0xFFB9382C), groupValue: selectedType, @@ -266,7 +270,7 @@ class _UpdateProcedureWidgetState extends State { setSelectedType(value); }, ), - Text('routine'), + Text(TranslationBase.of(context).urgent), ], ), ), @@ -311,6 +315,7 @@ class _UpdateProcedureWidgetState extends State { } Navigator.pop(context); updateProcedure( + limetNO: widget.limetNo, orderNo: widget.orderNo, orderType: selectedType.toString(), categorieId: widget.categoryId, @@ -340,6 +345,7 @@ class _UpdateProcedureWidgetState extends State { updateProcedure( {ProcedureViewModel model, String remarks, + int limetNO, int orderNo, String newProcedureId, String newCategorieId, @@ -357,7 +363,7 @@ class _UpdateProcedureWidgetState extends State { updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.patientMRN = patient.patientMRN; - updateProcedureReqModel.lineItemNo = 1; + updateProcedureReqModel.lineItemNo = limetNO; updateProcedureReqModel.orderNo = orderNo; if (entityList.isNotEmpty) { @@ -370,7 +376,7 @@ class _UpdateProcedureWidgetState extends State { ); controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = element.categoryID; + controlsProcedure.category = '0' + element.categoryID; controlsProcedure.controls = controls; }); } else { @@ -379,12 +385,12 @@ class _UpdateProcedureWidgetState extends State { code: "remarks", controlValue: remarks.isNotEmpty ? remarks : ""), ); controls.add( - Controls(code: "ordertype", controlValue: '0'), + Controls(code: "ordertype", controlValue: orderType), ); } controlsProcedure.procedure = procedureId; - controlsProcedure.category = categorieId; + controlsProcedure.category = '0' + categorieId; controlsProcedure.controls = controls; // controlsProcedure.add(ProcedureDetail( // category: categorieId, procedure: procedureId, controls: controls)); From 04114623600a99b8dbd8ce8fdccc96660a2f011b Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 2 Mar 2021 15:42:13 +0200 Subject: [PATCH 327/421] update procedure for agreed categorise --- lib/core/viewModel/procedure_View_model.dart | 2 +- lib/screens/procedures/update-procedure.dart | 16 ++++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/core/viewModel/procedure_View_model.dart b/lib/core/viewModel/procedure_View_model.dart index 199fa308..6af34f4d 100644 --- a/lib/core/viewModel/procedure_View_model.dart +++ b/lib/core/viewModel/procedure_View_model.dart @@ -99,6 +99,6 @@ class ProcedureViewModel extends BaseViewModel { setState(ViewState.ErrorLocal); } else setState(ViewState.Idle); - await getProcedure(mrn: mrn); + //await getProcedure(mrn: mrn); } } diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index f09157a2..312bdfe1 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -369,14 +369,16 @@ class _UpdateProcedureWidgetState extends State { if (entityList.isNotEmpty) { entityList.forEach((element) { controls.add( - Controls(code: "remarks", controlValue: element.remarks ?? remarks), + Controls(code: "remarks", controlValue: element.remarks ?? ''), ); controls.add( Controls(code: "ordertype", controlValue: '1'), ); controlsProcedure.procedure = element.procedureId; - controlsProcedure.category = '0' + element.categoryID; + controlsProcedure.category = int.parse(element.categoryID) > 9 + ? element.categoryID + : "0" + element.categoryID; controlsProcedure.controls = controls; }); } else { @@ -387,11 +389,12 @@ class _UpdateProcedureWidgetState extends State { controls.add( Controls(code: "ordertype", controlValue: orderType), ); - } - controlsProcedure.procedure = procedureId; - controlsProcedure.category = '0' + categorieId; - controlsProcedure.controls = controls; + controlsProcedure.procedure = procedureId; + controlsProcedure.category = '0' + categorieId; + + controlsProcedure.controls = controls; + } // controlsProcedure.add(ProcedureDetail( // category: categorieId, procedure: procedureId, controls: controls)); updateProcedureReqModel.procedureDetail = controlsProcedure; @@ -405,6 +408,7 @@ class _UpdateProcedureWidgetState extends State { model.getProcedure(mrn: patient.patientMRN); } else if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast('procedure has been updated'); + model.getProcedure(mrn: patient.patientMRN); } } From 531e7f497b3427377576372d7df03a378961d0be Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 4 Mar 2021 16:24:18 +0300 Subject: [PATCH 328/421] drug to drug intraction --- lib/client/base_app_client.dart | 2 +- .../model/get_medication_response_model.dart | 15 +- lib/core/model/prescription_model.dart | 5 +- lib/core/service/prescription_service.dart | 144 +++++++++++------- .../viewModel/prescription_view_model.dart | 9 +- .../prescription/add_prescription_form.dart | 82 ++++++++-- lib/screens/prescription/drugtodrug.dart | 53 +++++-- 7 files changed, 209 insertions(+), 101 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 92c0735b..11021ff4 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -83,7 +83,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - var ee ={json.encode(body)}; + var ee = {json.encode(body)}; if (await Helpers.checkConnection()) { final response = await http.post(url, diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/get_medication_response_model.dart index f9df77a3..f9b687f6 100644 --- a/lib/core/model/get_medication_response_model.dart +++ b/lib/core/model/get_medication_response_model.dart @@ -5,14 +5,15 @@ class GetMedicationResponseModel { String keywords; dynamic price; dynamic quantity; - + dynamic mediSpanGPICode; GetMedicationResponseModel( {this.description, - this.genericName, - this.itemId, - this.keywords, - this.price, - this.quantity}); + this.genericName, + this.itemId, + this.keywords, + this.price, + this.quantity, + this.mediSpanGPICode}); GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; @@ -21,6 +22,7 @@ class GetMedicationResponseModel { keywords = json['Keywords']; price = json['Price']; quantity = json['Quantity']; + mediSpanGPICode = json['mediSpanGPICode']; } Map toJson() { @@ -31,6 +33,7 @@ class GetMedicationResponseModel { data['Keywords'] = this.keywords; data['Price'] = this.price; data['Quantity'] = this.quantity; + data['mediSpanGPICode'] = this.mediSpanGPICode; return data; } } diff --git a/lib/core/model/prescription_model.dart b/lib/core/model/prescription_model.dart index 49001673..4bdc4105 100644 --- a/lib/core/model/prescription_model.dart +++ b/lib/core/model/prescription_model.dart @@ -59,7 +59,7 @@ class EntityList { dynamic uom; dynamic pharmacistRemarks; dynamic refill; - + dynamic mediSpanGPICode; EntityList( {this.appointmentNo, this.clinicName, @@ -91,6 +91,7 @@ class EntityList { this.stopDate, this.uom, this.pharmacistRemarks, + this.mediSpanGPICode, this.refill}); EntityList.fromJson(Map json) { @@ -124,6 +125,7 @@ class EntityList { stopDate = json['stopDate']; uom = json['uom']; pharmacistRemarks = json['pharmacistRemarks']; + mediSpanGPICode = json['mediSpanGPICode']; refill = json['refill']; } @@ -159,6 +161,7 @@ class EntityList { data['stopDate'] = this.stopDate; data['uom'] = this.uom; data['pharmacistRemarks'] = this.pharmacistRemarks; + data['mediSpanGPICode'] = this.mediSpanGPICode; data['refill'] = this.refill; return data; } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 54640fcc..cc366d96 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; @@ -14,6 +15,7 @@ import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class PrescriptionService extends LookupService { List _prescriptionList = List(); @@ -24,6 +26,7 @@ class PrescriptionService extends LookupService { List allMedicationList = []; List specialityList = []; List drugToDrug = []; + List get drugToDrugList => drugToDrug; List itemMedicineList = []; List itemMedicineListRoute = []; List itemMedicineListUnit = []; @@ -153,70 +156,71 @@ class PrescriptionService extends LookupService { Future getDrugToDrug( VitalSignData vital, - List diagnosis, + List lstAssessments, List allergy, PatiantInformtion patient, - List prescription) async { + List prescription) async { + // Map request = { + // "Prescription": { + // "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, + // "objVitalSign": {"Height": "180", "Weight": "37"}, + // "objPrescriptionItems": [ + // { + // "DrugId": "83-20-00-30-20-03-03", + // "DrugName": "WARFARIN 1 MG TAB 28'S (N)", + // "Dose": "1", + // "DoseType": "04", + // "Unit": "actuation(s)", + // "FrequencyType": "1/3/Day", + // "Duration": "3/Day", + // "IsScreen": "true" + // }, + // { + // "DrugId": "64-20-00-10-00-03-15", + // "DrugName": "PANADOL 500 MG TAB 24'S(DIS)", + // "Dose": "1", + // "DoseType": "04", + // "Unit": "MG", + // "FrequencyType": "3/1/Day", + // "Duration": "4/Day", + // "RouteID": "24", + // "IsScreen": "true" + // } + // ], + // "objAllergies": { + // "Allergy": { + // "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"} + // } + // }, + // "objDiagnosis": { + // "Diagnosis": { + // "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"} + // } + // }, + // "IsDoctor": "false", + // "IsPharmacist": "false" + // }, + // "IPAdress": "10.10.10.10", + // "Channel": 9, + // "LanguageID": 2, + // "VersionID": 5.3, + // "SessionID": "BlUSkYymTt", + // "IsLoginForDoctorApp": true, + // "PatientOutSA": 0, + // "TokenID": "@dm!n", + // "OutSA": true + // }; Map request = { - "Prescription": { - "objPatientInfo": {"Gender": "Male", "Age": "21/06/1967"}, - "objVitalSign": {"Height": "180", "Weight": "37"}, - "objPrescriptionItems": [ - { - "DrugId": "83-20-00-30-20-03-03", - "DrugName": "WARFARIN 1 MG TAB 28'S (N)", - "Dose": "1", - "DoseType": "04", - "Unit": "actuation(s)", - "FrequencyType": "1/3/Day", - "Duration": "3/Day", - "IsScreen": "true" - }, - { - "DrugId": "64-20-00-10-00-03-15", - "DrugName": "PANADOL 500 MG TAB 24'S(DIS)", - "Dose": "1", - "DoseType": "04", - "Unit": "MG", - "FrequencyType": "3/1/Day", - "Duration": "4/Day", - "RouteID": "24", - "IsScreen": "true" - } - ], - "objAllergies": { - "Allergy": { - "objProperties": {"Id": "26", "Name": "phenoxymethylpenicillin"} - } - }, - "objDiagnosis": { - "Diagnosis": { - "objProperties": {"Id": "A01.1", "Name": "Paratyphoid fever A"} - } - }, - "IsDoctor": "false", - "IsPharmacist": "false" - }, - "IPAdress": "10.10.10.10", - "Channel": 9, - "LanguageID": 2, - "VersionID": 5.3, - "SessionID": "BlUSkYymTt", - "IsLoginForDoctorApp": true, - "PatientOutSA": 0, - "TokenID": "@dm!n", - "OutSA": true - }; - Map requestN = { "Prescription": { "objPatientInfo": { "Gender": patient.gender == 1 ? 'Male' : 'Female', - "Age": patient.age + "Age": DateUtils.convertDateFromServerFormat( + patient.dateofBirth, 'dd/MM/yyyy') }, - "objVitalSign": {"Height": vital.heightCm, "Weight": vital.weightKg}, - "objPrescriptionItems": prescription[0].entityList, - "objAllergies": allergy, - "objDiagnosis": diagnosis, + "objVitalSign": {"Height": vital?.heightCm, "Weight": vital?.weightKg}, + "objPrescriptionItems": prescription, + "objAllergies": getAllergiesObj(allergy), + "objDiagnosis": getDiagnosisObj(lstAssessments), "IsDoctor": "false", "IsPharmacist": "false" } @@ -226,10 +230,34 @@ class PrescriptionService extends LookupService { await baseAppClient.post(DRUG_TO_DRUG, onSuccess: (dynamic response, int statusCode) { drugToDrug = []; - //drugToDrug = //response['MedicationList']['entityList']; + drugToDrug = + response['DrugToDrugResponse']['objPrescriptionCheckerResult']; }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, body: request); } + + getAllergiesObj(List allergies) { + var allergiesObj = []; + allergies.forEach((element) { + allergiesObj.add({ + "objProperties": { + 'Id': element.allergyDiseaseId, + 'Name': element.allergyDiseaseName + } + }); + }); + return allergiesObj; + } + + getDiagnosisObj(List lstAssessments) { + var lstAssessmentsObj = []; + lstAssessments.forEach((element) { + lstAssessmentsObj.add({ + "objProperties": {'Id': element.icdCode10ID, 'Name': element.asciiDesc} + }); + }); + return lstAssessmentsObj; + } } diff --git a/lib/core/viewModel/prescription_view_model.dart b/lib/core/viewModel/prescription_view_model.dart index 63dc19c5..a07ae715 100644 --- a/lib/core/viewModel/prescription_view_model.dart +++ b/lib/core/viewModel/prescription_view_model.dart @@ -1,12 +1,14 @@ import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/post_prescrition_req_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug_model.dart'; import 'package:doctor_app_flutter/core/service/prescription_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAllergiesResModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/patient-vital-sign-data.dart'; @@ -21,6 +23,7 @@ class PrescriptionViewModel extends BaseViewModel { _prescriptionService.prescriptionList; List get drugsList => _prescriptionService.doctorsList; //List get allMedicationList => _prescriptionService.allMedicationList; + List get drugToDrug => _prescriptionService.drugToDrugList; List get itemMedicineList => _prescriptionService.itemMedicineList; @@ -102,14 +105,14 @@ class PrescriptionViewModel extends BaseViewModel { Future getDrugToDrug( VitalSignData vital, - List listOfDiagnosisType, + List lstAssessments, List allergy, PatiantInformtion patient, - List prescription) async { + List prescription) async { hasError = false; setState(ViewState.Busy); await _prescriptionService.getDrugToDrug( - vital, listOfDiagnosisType, allergy, patient, prescription); + vital, lstAssessments, allergy, patient, prescription); if (_prescriptionService.hasError) { error = _prescriptionService.error; setState(ViewState.ErrorLocal); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 5ec6e240..5fa14285 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -785,13 +785,15 @@ class _PrescriptionFormWidgetState extends State { if (formKey.currentState .validate()) { Navigator.pop(context); + openDrugToDrug(model); { - // var x = model + /*// var x = model // .patientAssessmentList // .map((value) => // value.icdCode10ID) // .toList() // .join(','); + postProcedure( icdCode: model .patientAssessmentList[ @@ -838,8 +840,10 @@ class _PrescriptionFormWidgetState extends State { .text, doseTime: selectedDate, ); + */ } } + { // Navigator.push( // context, @@ -918,7 +922,7 @@ class _PrescriptionFormWidgetState extends State { ); } - openDrugToDrug() { + openDrugToDrug(model) { showModalBottomSheet( context: context, builder: (context) { @@ -929,26 +933,43 @@ class _PrescriptionFormWidgetState extends State { child: Column( // mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - DrugToDrug(widget.patient, widget.prescriptionList), + DrugToDrug( + widget.patient, + getPriscriptionforDrug(widget.prescriptionList), + model.patientAssessmentList), Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 3), child: AppButton( title: TranslationBase.of(context).addMedication, onPressed: () { + Navigator.pop(context); postProcedure( - dose: strengthController.text, - doseUnit: units['id'].toString(), - patient: widget.patient, - doseTimeIn: doseTime['id'].toString(), - model: widget.model, - duration: duration['id'].toString(), - frequency: frequency['id'].toString(), - route: route['id'].toString(), - drugId: selectedDrug['ItemId'].toString(), - strength: strengthController.text, - indication: indicationController.text, - instruction: instructionController.text, - doseTime: selectedDate); + icdCode: + model.patientAssessmentList[0].icdCode10ID.isEmpty + ? "test" + : model.patientAssessmentList[0].icdCode10ID + .toString(), + // icdCode: model + // .patientAssessmentList + // .map((value) => value + // .icdCode10ID + // .trim()) + // .toList() + // .join(' '), + dose: strengthController.text, + doseUnit: units['parameterCode'].toString(), + patient: widget.patient, + doseTimeIn: doseTime['id'].toString(), + model: widget.model, + duration: duration['id'].toString(), + frequency: frequency['parameterCode'].toString(), + route: route['parameterCode'].toString(), + drugId: _selectedMedication.itemId.toString(), + strength: strengthController.text, + indication: indicationController.text, + instruction: instructionController.text, + doseTime: selectedDate, + ); }, )) ], @@ -959,4 +980,33 @@ class _PrescriptionFormWidgetState extends State { ); }); } + + getPriscriptionforDrug(List prescriptionList) { + var prescriptionDetails = []; + prescriptionList[0].entityList.forEach((element) { + prescriptionDetails.add({ + 'DrugId': element.mediSpanGPICode, + 'DrugName': element.medicationName, + 'Dose': element.doseDailyQuantity, + 'DoseType': element.doseDailyUnitID, + 'Unit': element.uom, + 'FrequencyType': element.frequencyID, + 'Duration': element.doseDurationDays, + 'RouteID': element.routeID, + 'IsScreen': element.isSIG + }); + }); + prescriptionDetails.add({ + 'DrugId': _selectedMedication.mediSpanGPICode, + 'DrugName': _selectedMedication.description, + 'Dose': strengthController.text, + 'DoseType': units['parameterCode'].toString(), + 'Unit': units['description'], + 'FrequencyType': frequency['parameterCode'].toString(), + 'Duration': duration['id'].toString(), + 'RouteID': route['parameterCode'].toString(), + 'IsScreen': true + }); + return prescriptionDetails; + } } diff --git a/lib/screens/prescription/drugtodrug.dart b/lib/screens/prescription/drugtodrug.dart index b97dbb2d..ec2bda43 100644 --- a/lib/screens/prescription/drugtodrug.dart +++ b/lib/screens/prescription/drugtodrug.dart @@ -2,25 +2,29 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/medical_file_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_model.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-vital-sign-viewmodel.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetAssessmentResModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/network_base_view.dart'; import 'package:flutter/material.dart'; class DrugToDrug extends StatefulWidget { final PatiantInformtion patient; final prescription; - DrugToDrug(this.patient, this.prescription); + final List listAssessment; + DrugToDrug(this.patient, this.prescription, this.listAssessment); @override _DrugToDrug createState() => _DrugToDrug(); } @@ -29,11 +33,11 @@ class _DrugToDrug extends State { int typeID = 1; bool isLoaded = false; List> expandableList = [ - {'name': 'CRITICAL'}, - {'name': 'HIGH'}, - {'name': 'MODERATE'}, - {'name': 'LOW'}, - {'name': 'INFO'}, + {'name': 'CRITICAL', 'level': 'LEVEL_4'}, + {'name': 'HIGH', 'level': 'LEVEL_3'}, + {'name': 'MODERATE', 'level': 'LEVEL_2'}, + {'name': 'LOW', 'level': 'LEVEL_1'}, + {'name': 'INFO', 'level': 'INFO'}, ]; GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( patientMRN: 2954208, //widget.patient.patientMRN, @@ -58,7 +62,7 @@ class _DrugToDrug extends State { ? BaseView( onModelReady: (model3) => model3.getDrugToDrug( model.patientVitalSigns, - model2.listOfDiagnosisType, + widget.listAssessment, model2.patientAllergiesList, widget.patient, widget.prescription), @@ -72,15 +76,28 @@ class _DrugToDrug extends State { itemCount: expandableList.length, itemBuilder: (context, i) { return new ExpansionTile( - title: new Text( - expandableList[i]['name'], - style: new TextStyle( - fontSize: 20.0, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.italic), - ), - children: [Text('Hi')], - ); + title: new AppText( + expandableList[i]['name'] + + ' ' + + '(' + + getDrugInfo(expandableList[i]['level'], + model3) + .length + .toString() + + ')', + fontSize: 20, + fontWeight: FontWeight.bold, + ), + children: getDrugInfo( + expandableList[i]['level'], model3) + .map((item) { + return Container( + padding: EdgeInsets.all(10), + child: AppText( + item['comment'], + color: Colors.red[900], + )); + }).toList()); })))) : Container( height: SizeConfig.realScreenHeight * .45, @@ -107,4 +124,8 @@ class _DrugToDrug extends State { }); } } + + List getDrugInfo(level, model3) { + return model3.drugToDrug.where((i) => i['Severity'] == level).toList(); + } } From 817718f897a5071655fa7d42478c1cbf3a3938c1 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 4 Mar 2021 17:03:01 +0300 Subject: [PATCH 329/421] drug to drug intraction --- .../prescription/add_prescription_form.dart | 46 ++++++++++--------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 8cf3b414..e22a28e0 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -1001,29 +1001,33 @@ class _PrescriptionFormWidgetState extends State { getPriscriptionforDrug(List prescriptionList) { var prescriptionDetails = []; prescriptionList[0].entityList.forEach((element) { + if (element.mediSpanGPICode != null) { + prescriptionDetails.add({ + 'DrugId': element.mediSpanGPICode, + 'DrugName': element.medicationName, + 'Dose': element.doseDailyQuantity, + 'DoseType': element.doseDailyUnitID, + 'Unit': element.uom, + 'FrequencyType': element.frequencyID, + 'Duration': element.doseDurationDays, + 'RouteID': element.routeID, + 'IsScreen': element.isSIG + }); + } + }); + if (_selectedMedication.mediSpanGPICode != null) { prescriptionDetails.add({ - 'DrugId': element.mediSpanGPICode, - 'DrugName': element.medicationName, - 'Dose': element.doseDailyQuantity, - 'DoseType': element.doseDailyUnitID, - 'Unit': element.uom, - 'FrequencyType': element.frequencyID, - 'Duration': element.doseDurationDays, - 'RouteID': element.routeID, - 'IsScreen': element.isSIG + 'DrugId': _selectedMedication.mediSpanGPICode, + 'DrugName': _selectedMedication.description, + 'Dose': strengthController.text, + 'DoseType': units['parameterCode'].toString(), + 'Unit': units['description'], + 'FrequencyType': frequency['parameterCode'].toString(), + 'Duration': duration['id'].toString(), + 'RouteID': route['parameterCode'].toString(), + 'IsScreen': true }); - }); - prescriptionDetails.add({ - 'DrugId': _selectedMedication.mediSpanGPICode, - 'DrugName': _selectedMedication.description, - 'Dose': strengthController.text, - 'DoseType': units['parameterCode'].toString(), - 'Unit': units['description'], - 'FrequencyType': frequency['parameterCode'].toString(), - 'Duration': duration['id'].toString(), - 'RouteID': route['parameterCode'].toString(), - 'IsScreen': true - }); + } return prescriptionDetails; } } From c239dbc620ef710ec3bba2d29a3080ded7163cfa Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 4 Mar 2021 19:28:20 +0200 Subject: [PATCH 330/421] Claculate Box Quantity while adding prescrption --- lib/config/config.dart | 2 + .../model/calculate_box_request_model.dart | 32 +++ .../model/get_medication_response_model.dart | 7 +- lib/core/service/prescription_service.dart | 24 +++ lib/core/viewModel/medicine_view_model.dart | 13 ++ .../prescription/add_prescription_form.dart | 187 +++++++++++++++++- .../prescription/prescription_screen.dart | 31 +-- .../update_prescription_form.dart | 104 +++++++++- lib/screens/procedures/procedure_screen.dart | 16 +- 9 files changed, 384 insertions(+), 32 deletions(-) create mode 100644 lib/core/model/calculate_box_request_model.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 704dc7da..35c35ef3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -209,6 +209,8 @@ const GET_ITEM_BY_MEDICINE = const GET_PROCEDURE_VALIDATION = 'Services/DoctorApplication.svc/REST/ValidateProcedures'; +const GET_BOX_QUANTITY = + 'Services/DoctorApplication.svc/REST/CalculateBoxQuantity'; var selectedPatientType = 1; diff --git a/lib/core/model/calculate_box_request_model.dart b/lib/core/model/calculate_box_request_model.dart new file mode 100644 index 00000000..80281854 --- /dev/null +++ b/lib/core/model/calculate_box_request_model.dart @@ -0,0 +1,32 @@ +class CalculateBoxQuantityRequestModel { + int itemCode; + double strength; + int frequency; + int duration; + String vidaAuthTokenID; + + CalculateBoxQuantityRequestModel( + {this.itemCode, + this.strength, + this.frequency, + this.duration, + this.vidaAuthTokenID}); + + CalculateBoxQuantityRequestModel.fromJson(Map json) { + itemCode = json['ItemCode']; + strength = json['Strength']; + frequency = json['Frequency']; + duration = json['Duration']; + vidaAuthTokenID = json['VidaAuthTokenID']; + } + + Map toJson() { + final Map data = new Map(); + data['ItemCode'] = this.itemCode; + data['Strength'] = this.strength; + data['Frequency'] = this.frequency; + data['Duration'] = this.duration; + data['VidaAuthTokenID'] = this.vidaAuthTokenID; + return data; + } +} diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/get_medication_response_model.dart index 1f9597f5..d0173ed9 100644 --- a/lib/core/model/get_medication_response_model.dart +++ b/lib/core/model/get_medication_response_model.dart @@ -6,7 +6,7 @@ class GetMedicationResponseModel { dynamic price; dynamic quantity; bool isNarcotic; - + String uom; GetMedicationResponseModel( {this.description, this.genericName, @@ -14,7 +14,8 @@ class GetMedicationResponseModel { this.keywords, this.price, this.quantity, - this.isNarcotic}); + this.isNarcotic, + this.uom}); GetMedicationResponseModel.fromJson(Map json) { description = json['Description']; @@ -24,6 +25,7 @@ class GetMedicationResponseModel { price = json['Price']; quantity = json['Quantity']; isNarcotic = json['isNarcotic']; + uom = json['uom']; } Map toJson() { @@ -35,6 +37,7 @@ class GetMedicationResponseModel { data['Price'] = this.price; data['Quantity'] = this.quantity; data['isNarcotic'] = this.isNarcotic; + data['uom'] = this.uom; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 54640fcc..12ae96f2 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/model/Prescription_model.dart'; +import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/model/item_by_medicine_request_model.dart'; import 'package:doctor_app_flutter/core/model/prescription_req_model.dart'; @@ -27,6 +28,7 @@ class PrescriptionService extends LookupService { List itemMedicineList = []; List itemMedicineListRoute = []; List itemMedicineListUnit = []; + dynamic boxQuantity; PrescriptionReqModel _prescriptionReqModel = PrescriptionReqModel(); ItemByMedicineRequestModel _itemByMedicineRequestModel = @@ -36,6 +38,9 @@ class PrescriptionService extends LookupService { search: ["Amoxicillin"], ); + CalculateBoxQuantityRequestModel _boxQuantityRequestModel = + CalculateBoxQuantityRequestModel(); + PostPrescriptionReqModel _postPrescriptionReqModel = PostPrescriptionReqModel(); @@ -232,4 +237,23 @@ class PrescriptionService extends LookupService { super.error = error; }, body: request); } + + Future calculateBoxQuantity( + {int freq, int duration, int itemCode, double strength}) async { + _boxQuantityRequestModel = CalculateBoxQuantityRequestModel( + frequency: freq, + duration: duration, + itemCode: itemCode, + strength: strength); + + hasError = false; + + await baseAppClient.post(GET_BOX_QUANTITY, + onSuccess: (dynamic response, int statusCode) { + boxQuantity = response['BoxQuantity']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _boxQuantityRequestModel.toJson()); + } } diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index 9f446f46..a029b519 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -25,6 +25,7 @@ class MedicineViewModel extends BaseViewModel { get medicationRouteList => _prescriptionService.medicationRouteList; get medicationFrequencyList => _prescriptionService.medicationFrequencyList; + get boxQuintity => _prescriptionService.boxQuantity; get medicationIndicationsList => _prescriptionService.medicationIndicationsList; @@ -149,6 +150,18 @@ class MedicineViewModel extends BaseViewModel { setState(ViewState.Idle); } + Future getBoxQuantity( + {int itemCode, int duration, double strength, int freq}) async { + setState(ViewState.Busy); + await _prescriptionService.calculateBoxQuantity( + strength: strength, itemCode: itemCode, duration: duration, freq: freq); + if (_prescriptionService.hasError) { + error = _prescriptionService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + Future getPharmaciesList(int itemId) async { setState(ViewState.Busy); await _medicineService.getPharmaciesList(itemId); diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 81e85dfa..0153ebd5 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -128,6 +128,8 @@ class _PrescriptionFormWidgetState extends State { dynamic doseTime; dynamic indication; dynamic units; + dynamic uom; + dynamic box; dynamic x; List indicationList; @@ -222,7 +224,7 @@ class _PrescriptionFormWidgetState extends State { (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( - height: 1010, + height: MediaQuery.of(context).size.height * 1.45, child: Padding( padding: EdgeInsets.symmetric( horizontal: 12.0, vertical: 10.0), @@ -262,12 +264,35 @@ class _PrescriptionFormWidgetState extends State { ? AutoCompleteTextField< GetMedicationResponseModel>( onFocusChanged: (__) { - _selectedMedication != null - ? model.getItem( - itemID: - _selectedMedication - .itemId) - : null; + if (_selectedMedication != + null) { + model.getItem( + itemID: + _selectedMedication + .itemId); + uom = _selectedMedication.uom; + } else { + null; + } + if (_selectedMedication != + null && + duration != null && + frequency != null && + strengthController.text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); + + return; + } }, decoration: textFieldSelectorDecoration( @@ -383,6 +408,26 @@ class _PrescriptionFormWidgetState extends State { "Only 5 Digits allowed for strength"); } }, + onSubmit: (_) { + if (_selectedMedication != null && + duration != null && + frequency != null && + strengthController.text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); + + return; + } + }, // validator: (value) { // if (value.isEmpty && // strengthController.text.length > @@ -524,6 +569,27 @@ class _PrescriptionFormWidgetState extends State { frequency = selectedValue; frequency['isDefault'] = true; + if (_selectedMedication != + null && + duration != null && + frequency != null && + strengthController + .text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: + duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text)); + + return; + } }); }, ); @@ -706,6 +772,29 @@ class _PrescriptionFormWidgetState extends State { okFunction: (selectedValue) { setState(() { duration = selectedValue; + if (_selectedMedication != + null && + duration != null && + frequency != null && + strengthController + .text != + null) { + model.getBoxQuantity( + freq: frequency[ + 'parameterCode'], + duration: + duration['id'], + itemCode: + _selectedMedication + .itemId, + strength: double.parse( + strengthController + .text), + ); + box = model.boxQuintity; + + return; + } }); }, ); @@ -732,6 +821,90 @@ class _PrescriptionFormWidgetState extends State { ), ), SizedBox(height: spaceBetweenTextFileds), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "UOM", + uom != null ? uom : null, + true), + //enabled: false, + readOnly: true, + ), + ), + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: + TranslationBase.of(context) + .ok, + okFunction: (selectedValue) { + setState(() { + duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: textFieldSelectorDecoration( + "Box Quantity", + box != null + ? "Box Quantity: " + + model.boxQuintity.toString() + : null, + true), + //enabled: false, + readOnly: true, + ), + ), + ), + SizedBox(height: spaceBetweenTextFileds), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index ab152bf1..6e9f0676 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -585,6 +585,18 @@ class _NewPrescriptionScreenState extends State { .edit), onTap: () { updatePrescriptionForm( + box: model + .prescriptionList[ + 0] + .entityList[ + index] + .quantity, + uom: model + .prescriptionList[ + 0] + .entityList[ + index] + .uom, drugNameGeneric: model .prescriptionList[ 0] @@ -595,8 +607,9 @@ class _NewPrescriptionScreenState extends State { .toString(), doseStreangth: model.prescriptionList[0].entityList[index].doseDailyQuantity .toString(), - duration: model.prescriptionList[0].entityList[index].doseDurationDays - .toString(), + duration: + model.prescriptionList[0].entityList[index].doseDurationDays + .toString(), startDate: model.prescriptionList[0].entityList[index].startDate .toString(), @@ -611,18 +624,12 @@ class _NewPrescriptionScreenState extends State { model.prescriptionList[0].entityList[index].frequencyID .toString(), rouat: model - .prescriptionList[ - 0] - .entityList[ - index] - .routeID - .toString(), - patient: - patient, - drugId: model .prescriptionList[0] .entityList[index] - .medicineCode, + .routeID + .toString(), + patient: patient, + drugId: model.prescriptionList[0].entityList[index].medicineCode, drugName: model.prescriptionList[0].entityList[index].doseDetail, remarks: model.prescriptionList[0].entityList[index].remarks, model: model, diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 7892a1cd..998b28f2 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -37,6 +37,8 @@ class UpdatePrescriptionForm extends StatefulWidget { final String startDate; final String frequency; final String drugNameGeneric; + final String uom; + final int box; final PrescriptionViewModel model; @@ -54,7 +56,9 @@ class UpdatePrescriptionForm extends StatefulWidget { this.enteredRemarks, this.frequency, this.model, - this.drugNameGeneric}); + this.drugNameGeneric, + this.uom, + this.box}); @override _UpdatePrescriptionFormState createState() => _UpdatePrescriptionFormState(); } @@ -116,7 +120,7 @@ class _UpdatePrescriptionFormState extends State { (BuildContext context, StateSetter setState /*You can rename this!*/) { return BaseView( onModelReady: (model) async { - //await model.getMedicationList(); + await model.getMedicationList(); await model.getMedicationStrength(); await model.getMedicationDuration(); await model.getMedicationRoute(); @@ -151,7 +155,7 @@ class _UpdatePrescriptionFormState extends State { (BuildContext context, ScrollController scrollController) { return SingleChildScrollView( child: Container( - height: MediaQuery.of(context).size.height * 2.0, + height: MediaQuery.of(context).size.height * 1.5, child: Form( child: Padding( padding: EdgeInsets.symmetric( @@ -678,6 +682,96 @@ class _UpdatePrescriptionFormState extends State { SizedBox( height: 12.0, ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + // duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + "UOM", + widget.uom != null + ? widget.uom + : null, + true), + // enabled: false, + readOnly: true, + ), + ), + ), + Container( + height: screenSize.height * 0.070, + child: InkWell( + onTap: model.allMedicationList != null + ? () { + Helpers.hideKeyboard(context); + ListSelectDialog dialog = + ListSelectDialog( + list: model.allMedicationList, + attributeName: 'nameEn', + attributeValueId: 'id', + okText: TranslationBase.of( + context) + .ok, + okFunction: (selectedValue) { + setState(() { + // duration = selectedValue; + }); + }, + ); + showDialog( + barrierDismissible: false, + context: context, + builder: + (BuildContext context) { + return dialog; + }, + ); + } + : null, + child: TextField( + decoration: + textFieldSelectorDecoration( + 'Box Quantity', + widget.box != null + ? "Box Quantity: " + + widget.box.toString() + : null, + true), + // enabled: false, + readOnly: true, + ), + ), + ), + SizedBox( + height: 12.0, + ), Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( @@ -931,6 +1025,8 @@ void updatePrescriptionForm( String doseStreangth, String doseUnit, String enteredRemarks, + String uom, + int box, String startDate}) { TextEditingController remarksController = TextEditingController(); TextEditingController doseController = TextEditingController(); @@ -941,6 +1037,8 @@ void updatePrescriptionForm( isScrollControlled: true, builder: (BuildContext context) { return UpdatePrescriptionForm( + box: box, + uom: uom, drugName: drugName, patient: patient, doseStreangth: doseStreangth, diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index c66b66a9..c7da891e 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -388,14 +388,14 @@ class _ProcedureScreenState extends State { Row( children: [ - AppText( - TranslationBase.of(context) - .price + - " : ", - fontWeight: - FontWeight - .w700, - ), + // AppText( + // TranslationBase.of(context) + // .price + + // " : ", + // fontWeight: + // FontWeight + // .w700, + // ), // Expanded( // child: AppText( // model From aa7b18dbb033e30da5d6383b72a4a6a6f26f3141 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 4 Mar 2021 23:20:56 +0200 Subject: [PATCH 331/421] Claculate Box Quantity while adding prescrption --- lib/screens/prescription/add_prescription_form.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0153ebd5..cb9978d4 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -290,6 +290,7 @@ class _PrescriptionFormWidgetState extends State { strength: double.parse( strengthController .text)); + box = model.boxQuintity; return; } @@ -424,6 +425,7 @@ class _PrescriptionFormWidgetState extends State { strength: double.parse( strengthController .text)); + box = model.boxQuintity; return; } From 8d8aa78ccb2186a654991bf623d8b2595e74b01d Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 4 Mar 2021 23:26:32 +0200 Subject: [PATCH 332/421] Claculate Box Quantity while adding prescrption --- lib/screens/prescription/update_prescription_form.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 998b28f2..7c1bc88e 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -666,7 +666,9 @@ class _UpdatePrescriptionFormState extends State { child: TextField( decoration: Helpers .textFieldSelectorDecoration( - widget.startDate, + Helpers.getDateFormatted( + DateTime.parse( + widget.startDate)), selectedDate != null ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" : null, From be832bfd4bb1e912e10d140cd56491f3253dcd35 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 7 Mar 2021 12:29:53 +0300 Subject: [PATCH 333/421] dashboard design --- lib/screens/dashboard_screen.dart | 517 +++++++++++------------------- pubspec.yaml | 1 + 2 files changed, 195 insertions(+), 323 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index fbbe6d53..c16bf7ea 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -25,6 +25,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter_swiper/flutter_swiper.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:percent_indicator/circular_percent_indicator.dart'; import 'package:provider/provider.dart'; @@ -283,7 +284,7 @@ class _DashboardScreenState extends State { // ), Container( color: Colors.white, - height: MediaQuery.of(context).size.height * 0.45, + height: MediaQuery.of(context).size.height * 0.22, ), ], ), @@ -292,317 +293,17 @@ class _DashboardScreenState extends State { left: 9, top: MediaQuery.of(context).size.height * .1, child: Container( - height: MediaQuery.of(context).size.height * 0.52, + height: MediaQuery.of(context).size.height * 0.30, child: model.dashboardItemsList.length > 0 - ? Column( - children: [ - RoundedContainer( - height: - MediaQuery.of(context).size.height * - 0.24, - margin: 5, - child: Column(children: [ - Expanded( - flex: 3, - child: Row( - children: [ - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets - .all(5.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 0] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 0] - .value, - Colors.red), - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 1] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 1] - .value, - Colors.black), - rowCount( - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 2] - .kPIParameter, - model - .dashboardItemsList[ - 0] - .summaryoptions[ - 2] - .value, - Colors - .grey[800]), - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createInpatientData( - model))), - Positioned( - child: Column( - children: [ - AppText( - TranslationBase.of( - context) - .inPatient, - fontSize: 11, - fontWeight: - FontWeight - .bold, - ), - AppText( - getPatientCount( - model.dashboardItemsList[ - 0]) - .toString(), - fontSize: 11, - fontWeight: - FontWeight - .bold, - ) - ], - ), - top: MediaQuery.of( - context) - .size - .height * - 0.08, - left: MediaQuery.of( - context) - .size - .width * - 0.10) - ])), - ], - )), - Expanded( - flex: 1, - child: Padding( - padding: - const EdgeInsets.all(5.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - rowCount( - model - .dashboardItemsList[0] - .summaryoptions[3] - .kPIParameter, - model - .dashboardItemsList[0] - .summaryoptions[3] - .value, - Colors.grey), - rowCount( - model - .dashboardItemsList[0] - .summaryoptions[4] - .kPIParameter, - model - .dashboardItemsList[0] - .summaryoptions[4] - .value, - Colors.grey[300]), - ], - )), - ) - ])), - RoundedContainer( - height: - MediaQuery.of(context).size.height * - 0.24, - margin: 5, - child: Column(children: [ - Expanded( - flex: 3, - child: Row( - children: [ - Expanded( - flex: 5, - child: Padding( - padding: - const EdgeInsets - .all(5.0), - child: Column( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 0] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 0] - .value, - Colors.red), - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 1] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 1] - .value, - Colors.black), - rowCount( - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 2] - .kPIParameter, - model - .dashboardItemsList[ - 1] - .summaryoptions[ - 2] - .value, - Colors - .grey[800]), - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart( - _createOutPatientData( - model))), - Positioned( - child: Column( - children: [ - AppText( - TranslationBase.of( - context) - .outPatient, - fontSize: 11, - fontWeight: - FontWeight - .bold, - textOverflow: - TextOverflow - .ellipsis, - ), - AppText( - getPatientCount( - model.dashboardItemsList[ - 1]) - .toString(), - fontSize: 11, - fontWeight: - FontWeight - .bold, - ) - ], - ), - top: MediaQuery.of( - context) - .size - .height * - 0.08, - left: MediaQuery.of( - context) - .size - .width * - 0.09) - ]), - ), - ], - )), - Expanded( - flex: 1, - child: Padding( - padding: - const EdgeInsets.all(5.0), - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[3] - .kPIParameter, - model - .dashboardItemsList[1] - .summaryoptions[3] - .value, - Colors.grey), - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[4] - .kPIParameter, - model - .dashboardItemsList[1] - .summaryoptions[4] - .value, - Colors.grey[300]), - rowCount( - model - .dashboardItemsList[1] - .summaryoptions[5] - .kPIParameter, - model - .dashboardItemsList[1] - .summaryoptions[5] - .value, - Colors.grey[200]) - ], - )), - ) - ])) - ], + ? new Swiper( + itemBuilder: (BuildContext context, int index) { + return getSwiperWidget(model)[index]; + }, + itemCount: 2, + // pagination: new SwiperPagination(), + viewportFraction: 0.9, + // scale: 0.9, + // control: new SwiperControl(), ) : SizedBox()) //ExpandableCardContainer( @@ -1443,23 +1144,23 @@ class _DashboardScreenState extends State { new GaugeSegment( model.dashboardItemsList[0].summaryoptions[0].kPIParameter, getValue(model.dashboardItemsList[0].summaryoptions[0].value), - charts.MaterialPalette.red.shadeDefault), + charts.MaterialPalette.blue.shadeDefault), new GaugeSegment( model.dashboardItemsList[0].summaryoptions[1].kPIParameter, getValue(model.dashboardItemsList[0].summaryoptions[1].value), - charts.MaterialPalette.black.darker), + charts.MaterialPalette.cyan.shadeDefault), new GaugeSegment( model.dashboardItemsList[0].summaryoptions[2].kPIParameter, getValue(model.dashboardItemsList[0].summaryoptions[2].value), - charts.MaterialPalette.gray.shade800), + charts.MaterialPalette.red.shadeDefault), new GaugeSegment( model.dashboardItemsList[0].summaryoptions[3].kPIParameter, getValue(model.dashboardItemsList[0].summaryoptions[3].value), - charts.MaterialPalette.gray.shadeDefault.lighter), + charts.MaterialPalette.deepOrange.shadeDefault.lighter), new GaugeSegment( model.dashboardItemsList[0].summaryoptions[4].kPIParameter, getValue(model.dashboardItemsList[0].summaryoptions[4].value), - charts.MaterialPalette.gray.shadeDefault), + charts.MaterialPalette.green.shadeDefault), ]; return [ @@ -1479,23 +1180,27 @@ class _DashboardScreenState extends State { new GaugeSegment( model.dashboardItemsList[1].summaryoptions[0].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[0].value), - charts.MaterialPalette.red.shadeDefault), + charts.MaterialPalette.blue.shadeDefault), new GaugeSegment( model.dashboardItemsList[1].summaryoptions[1].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[1].value), - charts.MaterialPalette.black.darker), + charts.MaterialPalette.cyan.shadeDefault), new GaugeSegment( model.dashboardItemsList[1].summaryoptions[2].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[2].value), - charts.MaterialPalette.gray.shade800), + charts.MaterialPalette.red.shadeDefault), new GaugeSegment( model.dashboardItemsList[1].summaryoptions[3].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[3].value), - charts.MaterialPalette.gray.shadeDefault), + charts.MaterialPalette.deepOrange.shadeDefault), new GaugeSegment( model.dashboardItemsList[1].summaryoptions[4].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[4].value), - charts.MaterialPalette.gray.shadeDefault.lighter), + charts.MaterialPalette.green.shadeDefault.lighter), + new GaugeSegment( + model.dashboardItemsList[1].summaryoptions[5].kPIParameter, + getValue(model.dashboardItemsList[1].summaryoptions[5].value), + charts.MaterialPalette.purple.shadeDefault.lighter) ]; return [ @@ -1625,7 +1330,7 @@ class _DashboardScreenState extends State { return Row( children: [ dot(c), - Column( + Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( @@ -1636,7 +1341,7 @@ class _DashboardScreenState extends State { textOverflow: TextOverflow.ellipsis, ), AppText( - '(' + count.toString() + ')', + ' (' + count.toString() + ')', color: Colors.black, textAlign: TextAlign.center, fontSize: 14, @@ -1647,6 +1352,170 @@ class _DashboardScreenState extends State { ], ); } + + List getSwiperWidget(model) { + return [ + RoundedContainer( + height: MediaQuery.of(context).size.height * 0.30, + margin: 5, + child: Column(children: [ + Expanded( + flex: 5, + child: Row( + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + rowCount( + model.dashboardItemsList[0] + .summaryoptions[0].kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[0].value, + Colors.blue), + rowCount( + model.dashboardItemsList[0] + .summaryoptions[1].kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[1].value, + Colors.cyan), + rowCount( + model.dashboardItemsList[0] + .summaryoptions[2].kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[2].value, + Colors.red), + rowCount( + model.dashboardItemsList[0] + .summaryoptions[3].kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[3].value, + Colors.orange), + rowCount( + model.dashboardItemsList[0] + .summaryoptions[4].kPIParameter, + model.dashboardItemsList[0] + .summaryoptions[4].value, + Colors.green), + ], + ))), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart(_createInpatientData(model))), + Positioned( + child: Center( + child: Column( + children: [ + AppText( + TranslationBase.of(context).inPatient, + fontSize: 11, + fontWeight: FontWeight.bold, + ), + AppText( + getPatientCount(model.dashboardItemsList[0]) + .toString(), + fontSize: 11, + fontWeight: FontWeight.bold, + ) + ], + )), + top: MediaQuery.of(context).size.height * 0.12, + left: MediaQuery.of(context).size.width * 0.11) + ])), + ], + )), + ])), + RoundedContainer( + height: MediaQuery.of(context).size.height * 0.24, + margin: 5, + child: Column(children: [ + Expanded( + flex: 1, + child: Row( + children: [ + Expanded( + flex: 4, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + rowCount( + model.dashboardItemsList[1] + .summaryoptions[0].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[0].value, + Colors.blue), + rowCount( + model.dashboardItemsList[1] + .summaryoptions[1].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[1].value, + Colors.cyan), + rowCount( + model.dashboardItemsList[1] + .summaryoptions[2].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[2].value, + Colors.red), + rowCount( + model.dashboardItemsList[1] + .summaryoptions[3].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[3].value, + Colors.orange), + rowCount( + model.dashboardItemsList[1] + .summaryoptions[4].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[4].value, + Colors.green), + rowCount( + model.dashboardItemsList[1] + .summaryoptions[5].kPIParameter, + model.dashboardItemsList[1] + .summaryoptions[5].value, + Colors.purple) + ], + ))), + Expanded( + flex: 3, + child: Stack(children: [ + Container( + child: GaugeChart(_createOutPatientData(model))), + Positioned( + child: Column( + children: [ + AppText( + TranslationBase.of(context).outPatient, + fontSize: 11, + fontWeight: FontWeight.bold, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + getPatientCount(model.dashboardItemsList[1]) + .toString(), + fontSize: 11, + fontWeight: FontWeight.bold, + ) + ], + ), + top: MediaQuery.of(context).size.height * 0.12, + left: MediaQuery.of(context).size.width * 0.11) + ]), + ), + ], + )), + ])) + ]; + } } // TODO Move to it file @@ -1707,6 +1576,8 @@ class DashboardItem extends StatelessWidget { ), ); } + + getDashboardWidget() {} } class ExpandableCardContainer extends StatefulWidget { diff --git a/pubspec.yaml b/pubspec.yaml index 7602415e..6dd072f5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -36,6 +36,7 @@ dependencies: maps_launcher: ^1.2.0 url_launcher: ^5.4.5 charts_flutter: ^0.9.0 + flutter_swiper: ^1.1.6 #Icons eva_icons_flutter: ^2.0.0 font_awesome_flutter: ^8.11.0 From b64a388a1d53a2d149feac507468638b8cb31fc0 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 7 Mar 2021 12:00:04 +0200 Subject: [PATCH 334/421] update procedure without entering any data --- lib/screens/procedures/update-procedure.dart | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index 312bdfe1..873e8bcf 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -306,13 +306,13 @@ class _UpdateProcedureWidgetState extends State { .updateProcedure .toUpperCase(), onPressed: () { - if (entityList.isEmpty == true && - widget.remarksController.text == - widget.remarks) { - DrAppToastMsg.showErrorToast( - "Fill the mandatory procedure details"); - return; - } + // if (entityList.isEmpty == true && + // widget.remarksController.text == + // widget.remarks) { + // DrAppToastMsg.showErrorToast( + // "Fill the mandatory procedure details"); + // return; + // } Navigator.pop(context); updateProcedure( limetNO: widget.limetNo, From cf44e6f77a37d18a862c8a7950620ba94a0ba3b6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 7 Mar 2021 12:10:26 +0200 Subject: [PATCH 335/421] hussam --- lib/core/model/get_medication_response_model.dart | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/core/model/get_medication_response_model.dart b/lib/core/model/get_medication_response_model.dart index 57f936dc..a42a8b47 100644 --- a/lib/core/model/get_medication_response_model.dart +++ b/lib/core/model/get_medication_response_model.dart @@ -16,8 +16,7 @@ class GetMedicationResponseModel { this.price, this.quantity, this.isNarcotic, - this.uom}); - this.isNarcotic, + this.uom, this.mediSpanGPICode}); GetMedicationResponseModel.fromJson(Map json) { From d099ac9b57691573e5704fe841fb041bc63fca5e Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 7 Mar 2021 18:33:47 +0200 Subject: [PATCH 336/421] hussam --- .../prescription/add_prescription_form.dart | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index e5c9f712..92c11f62 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -937,14 +937,6 @@ class _PrescriptionFormWidgetState extends State { // formKey.currentState.save(); // Navigator.pop(context); // openDrugToDrug(); - if (_selectedMedication - .isNarcotic == - true) { - DrAppToastMsg.showErrorToast( - "Narcotic medicine can only be prescribed from VIDA"); - Navigator.pop(context); - return; - } if (route == null || frequency == null || doseTime == null || @@ -955,6 +947,15 @@ class _PrescriptionFormWidgetState extends State { "Please Fill All Fields"); return; } + if (_selectedMedication + .isNarcotic == + true) { + DrAppToastMsg.showErrorToast( + "Narcotic medicine can only be prescribed from VIDA"); + Navigator.pop(context); + return; + } + if (double.parse( strengthController.text) > 1000.0) { From 53d22a8d6db06a050221ba43afd2091463b923f8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 8 Mar 2021 09:48:15 +0200 Subject: [PATCH 337/421] hussam --- lib/screens/prescription/add_prescription_form.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 92c11f62..0ca9b49e 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -863,6 +863,7 @@ class _PrescriptionFormWidgetState extends State { ), ), ), + SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, child: InkWell( @@ -1137,11 +1138,13 @@ class _PrescriptionFormWidgetState extends State { onPressed: () { Navigator.pop(context); postProcedure( - icdCode: - model.patientAssessmentList[0].icdCode10ID.isEmpty + icdCode: model.patientAssessmentList.isNotEmpty + ? model.patientAssessmentList[0].icdCode10ID + .isEmpty ? "test" : model.patientAssessmentList[0].icdCode10ID - .toString(), + .toString() + : "test", // icdCode: model // .patientAssessmentList // .map((value) => value From 05ef7a4b2572ce2cd5d53bb719b1de8b37c37465 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 11 Mar 2021 19:43:50 +0300 Subject: [PATCH 338/421] dashboard page updated --- lib/config/localized_values.dart | 3 +- lib/screens/dashboard_screen.dart | 742 +++++++++++++---------- lib/util/translations_delegate_base.dart | 3 + 3 files changed, 438 insertions(+), 310 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 6bdca5c5..3904ed1f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -738,5 +738,6 @@ const Map> localizedValues = { 'en': "A Sick leave is on Hold status for this patient", 'ar': "الإجازة المرضية في حالة الانتظار لهذا المريض" }, - 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"} + 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, + 'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index c16bf7ea..5797b0c1 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -63,6 +63,7 @@ class _DashboardScreenState extends State { bool isExpanded = false; String isInpatient = ""; var clinicName = []; + var clinicId; void didChangeDependencies() async { super.didChangeDependencies(); @@ -146,48 +147,81 @@ class _DashboardScreenState extends State { width: MediaQuery.of(context).size.width * .6, // height: 100, child: projectsProvider.doctorClinicsList.length > 0 - ? DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.white, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: (BuildContext context) { - return projectsProvider.doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.white, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider.doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item.clinicName, + fontSize: + SizeConfig.textMultiplier * + 2.1, + color: Colors.white, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + }, + items: projectsProvider.doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( item.clinicName, - fontSize: - SizeConfig.textMultiplier * 2.1, + textAlign: TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + Positioned( + right: projectsProvider.isArabic ? 35 : 0, + top: 0, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + projectsProvider + .doctorClinicsList.length + .toString(), + style: new TextStyle( color: Colors.white, + fontSize: projectsProvider.isArabic + ? 10 + : 11, ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context); - }, - items: projectsProvider.doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: TextAlign.end, + textAlign: TextAlign.center, + ), ), - value: item.clinicID, - ); - }).toList(), - )) + ) + ], + ) : AppText(TranslationBase.of(context).noClinic), ), ), @@ -284,7 +318,7 @@ class _DashboardScreenState extends State { // ), Container( color: Colors.white, - height: MediaQuery.of(context).size.height * 0.22, + height: MediaQuery.of(context).size.height * 0.23, ), ], ), @@ -293,14 +327,68 @@ class _DashboardScreenState extends State { left: 9, top: MediaQuery.of(context).size.height * .1, child: Container( - height: MediaQuery.of(context).size.height * 0.30, + height: MediaQuery.of(context).size.height * 0.28, child: model.dashboardItemsList.length > 0 ? new Swiper( itemBuilder: (BuildContext context, int index) { return getSwiperWidget(model)[index]; }, - itemCount: 2, - // pagination: new SwiperPagination(), + itemCount: 3, + + pagination: new SwiperCustomPagination(builder: + (BuildContext context, + SwiperPluginConfig config) { + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: -5, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all( + 2), + color: config + .activeIndex == + 0 + ? Colors.black + : Colors.grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all( + 2), + color: config + .activeIndex == + 1 + ? Colors.black + : Colors.grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all( + 2), + color: config + .activeIndex == + 2 + ? Colors.black + : Colors.grey), + ], + ))))) + ]); + }), viewportFraction: 0.9, // scale: 0.9, // control: new SwiperControl(), @@ -738,119 +826,6 @@ class _DashboardScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 10), - child: Icon( - DoctorApp.lab_results, - size: 40, - color: Colors.white, - ), - ), - Container( - // margin: EdgeInsets.only(bottom: 10), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[5]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - AppText( - TranslationBase.of(context) - .targetPatient, - textAlign: TextAlign.center, - color: Colors.white, - ) - ], - ), - ), - ], - ), - imageName: '1.png', - opacity: 0.82, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 10), - child: Icon( - DoctorApp.radiology, - size: 40, - color: Colors.white, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 10), - child: Column( - children: [ - AppText( - clinicName.length.toString(), - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - AppText( - TranslationBase.of(context).clinic, - color: Colors.white, - ) - ], - ), - ), - ], - ), - imageName: '2.png', - opacity: 0.9, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 10), - child: Icon( - DoctorApp.referral, - size: 40, - color: Colors.white, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 10), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[2]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.white, - ), - AppText( - TranslationBase.of(context).referral, - color: Colors.white, - ) - ], - ), - ), - ], - ), - imageName: '3.png', - opacity: 0.9, - ), - ], - ), SizedBox( height: 15, ), @@ -873,32 +848,27 @@ class _DashboardScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Center( - child: Icon( - DoctorApp.search_patient_1, - size: 50, - color: Colors.black, - ), + Icon( + DoctorApp.referred, + size: 50, + color: Colors.black, ), - Column( - children: [ - AppText( - TranslationBase.of(context).searchAbout, - color: Colors.black, - textAlign: TextAlign.center, - ), - AppText( - TranslationBase.of(context).patient, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], + AppText( + TranslationBase.of(context).myReferredPatient, + color: Colors.black, + textAlign: TextAlign.center, ) ], ), hasBorder: true, onTap: () { - Navigator.of(context).pushNamed(PATIENT_SEARCH); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => ReferredPatientScreen(), + // MyReferredPatient(), + ), + ); }, ), DashboardItem( @@ -906,23 +876,14 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - DoctorApp.mail, + DoctorApp.referral, size: 50, color: Colors.black, ), - Column( - children: [ - AppText( - TranslationBase.of(context).theDoctor, - textAlign: TextAlign.center, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).reply, - textAlign: TextAlign.center, - color: Colors.black, - ), - ], + AppText( + TranslationBase.of(context).myReferralPatient, + textAlign: TextAlign.center, + color: Colors.black, ) ], ), @@ -931,7 +892,8 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => DoctorReplyScreen(), + builder: (context) => + MyReferralPatientScreen(), ), ); }, @@ -941,12 +903,11 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - DoctorApp.medicine_search, + DoctorApp.patient, size: 50, - color: Colors.black, ), AppText( - TranslationBase.of(context).searchMedicine, + TranslationBase.of(context).arrived, color: Colors.black, textAlign: TextAlign.center, ) @@ -954,14 +915,13 @@ class _DashboardScreenState extends State { ), hasBorder: true, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicineSearchScreen(), - ), - ); + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7" + }); }, - ), + ) ], ), SizedBox( @@ -975,35 +935,32 @@ class _DashboardScreenState extends State { child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - Icon( - DoctorApp.qr_code, - size: 50, - color: Colors.black, + Center( + child: Icon( + DoctorApp.search_patient_1, + size: 50, + color: Colors.black, + ), ), Column( children: [ AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).reader - : TranslationBase.of(context).qr, + TranslationBase.of(context).searchAbout, color: Colors.black, textAlign: TextAlign.center, ), AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).qr - : TranslationBase.of(context).reader, + TranslationBase.of(context).patient, color: Colors.black, textAlign: TextAlign.center, - ), + ) ], ) ], ), -// imageName: '1.png', hasBorder: true, onTap: () { - Navigator.of(context).pushNamed(QR_READER); + Navigator.of(context).pushNamed(PATIENT_SEARCH); }, ), DashboardItem( @@ -1011,14 +968,14 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - DoctorApp.referral, + DoctorApp.medicine_search, size: 50, color: Colors.black, ), AppText( - TranslationBase.of(context).myReferralPatient, - textAlign: TextAlign.center, + TranslationBase.of(context).searchMedicine, color: Colors.black, + textAlign: TextAlign.center, ) ], ), @@ -1027,8 +984,7 @@ class _DashboardScreenState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - MyReferralPatientScreen(), + builder: (context) => MedicineSearchScreen(), ), ); }, @@ -1038,26 +994,34 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - DoctorApp.referred, + DoctorApp.qr_code, size: 50, color: Colors.black, ), - AppText( - TranslationBase.of(context).myReferredPatient, - color: Colors.black, - textAlign: TextAlign.center, + Column( + children: [ + AppText( + projectsProvider.isArabic + ? TranslationBase.of(context).reader + : TranslationBase.of(context).qr, + color: Colors.black, + textAlign: TextAlign.center, + ), + AppText( + projectsProvider.isArabic + ? TranslationBase.of(context).qr + : TranslationBase.of(context).reader, + color: Colors.black, + textAlign: TextAlign.center, + ), + ], ) ], ), +// imageName: '1.png', hasBorder: true, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => ReferredPatientScreen(), - // MyReferredPatient(), - ), - ); + Navigator.of(context).pushNamed(QR_READER); }, ), ], @@ -1104,23 +1068,34 @@ class _DashboardScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ Icon( - DoctorApp.patient, + DoctorApp.mail, size: 50, - ), - AppText( - TranslationBase.of(context).arrived, color: Colors.black, - textAlign: TextAlign.center, + ), + Column( + children: [ + AppText( + TranslationBase.of(context).theDoctor, + textAlign: TextAlign.center, + color: Colors.black, + ), + AppText( + TranslationBase.of(context).reply, + textAlign: TextAlign.center, + color: Colors.black, + ), + ], ) ], ), hasBorder: true, onTap: () { - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": "7" - }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => DoctorReplyScreen(), + ), + ); }, ) ], @@ -1218,72 +1193,72 @@ class _DashboardScreenState extends State { return value == 0 ? 1 : value; } - showCupertinoPicker( - {context, List actionList, decKey, onSelectFun}) { - showModalBottomSheet( - isDismissible: false, - isScrollControlled: true, - context: context, - builder: (BuildContext builder) { - return Container( - // height: 500, - height: SizeConfig.realScreenHeight * 0.4, - color: Color(0xfff7f7f7), - child: Column( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - color: Color(0xfff7f7f7), - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - CupertinoButton( - child: AppText(TranslationBase.of(context).cancel - // style: TextStyle(context) - ), - onPressed: () { - Navigator.pop(context); - }, - ), - CupertinoButton( - child: AppText(TranslationBase.of(context).done - // style: textStyle(context), - ), - onPressed: () { - Navigator.pop(context); - // onSelectFun(cupertinoPickerIndex); - }, - ) - ], - ), - ), - Container( - height: SizeConfig.realScreenHeight * 0.3, - color: Color(0xfff7f7f7), - child: Column( - children: actionList - .map((e) => Flexible( - child: Container( - height: 50, - child: InkWell( - onTap: () => - changeClinic(e.clinicID, context), - child: AppText( - e.clinicName, - fontSize: - SizeConfig.textMultiplier * 1.9, - )), - ), - )) - .toList(), - )) - ], - ), - ); - }); - } + // showCupertinoPicker( + // {context, List actionList, decKey, onSelectFun}) { + // showModalBottomSheet( + // isDismissible: false, + // isScrollControlled: true, + // context: context, + // builder: (BuildContext builder) { + // return Container( + // // height: 500, + // height: SizeConfig.realScreenHeight * 0.4, + // color: Color(0xfff7f7f7), + // child: Column( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // Container( + // color: Color(0xfff7f7f7), + // child: Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // CupertinoButton( + // child: AppText(TranslationBase.of(context).cancel + // // style: TextStyle(context) + // ), + // onPressed: () { + // Navigator.pop(context); + // }, + // ), + // CupertinoButton( + // child: AppText(TranslationBase.of(context).done + // // style: textStyle(context), + // ), + // onPressed: () { + // Navigator.pop(context); + // // onSelectFun(cupertinoPickerIndex); + // }, + // ) + // ], + // ), + // ), + // Container( + // height: SizeConfig.realScreenHeight * 0.3, + // color: Color(0xfff7f7f7), + // child: Column( + // children: actionList + // .map((e) => Flexible( + // child: Container( + // height: 50, + // child: InkWell( + // onTap: () => changeClinic( + // e.clinicID, context, model), + // child: AppText( + // e.clinicName, + // fontSize: + // SizeConfig.textMultiplier * 1.9, + // )), + // ), + // )) + // .toList(), + // )) + // ], + // ), + // ); + // }); + // } - changeClinic(clinicId, BuildContext context) async { + changeClinic(clinicId, BuildContext context, model) async { // Navigator.pop(context); changeIsLoading(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); @@ -1300,6 +1275,7 @@ class _DashboardScreenState extends State { authProvider.getDocProfiles(docInfo.toJson()).then((res) async { changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); + model.getDashboard(); }).catchError((err) { changeIsLoading(false); helpers.showErrorToast(err); @@ -1420,7 +1396,7 @@ class _DashboardScreenState extends State { AppText( getPatientCount(model.dashboardItemsList[0]) .toString(), - fontSize: 11, + fontSize: 18, fontWeight: FontWeight.bold, ) ], @@ -1502,18 +1478,166 @@ class _DashboardScreenState extends State { AppText( getPatientCount(model.dashboardItemsList[1]) .toString(), - fontSize: 11, + fontSize: 18, fontWeight: FontWeight.bold, ) ], ), top: MediaQuery.of(context).size.height * 0.12, - left: MediaQuery.of(context).size.width * 0.11) + left: MediaQuery.of(context).size.width * 0.10) ]), ), ], )), - ])) + ])), + RoundedContainer( + height: MediaQuery.of(context).size.height * 0.24, + margin: 5, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: AppText(TranslationBase.of(context).otherStatistic)), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + DashboardItem( + width: MediaQuery.of(context).size.width * 0.25, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.18 + : MediaQuery.of(context).size.height * 0.36, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + child: Icon( + DoctorApp.lab_results, + size: 40, + color: Colors.black, + ), + ), + Container( + // margin: EdgeInsets.only(bottom: 10), + child: Column( + children: [ + AppText( + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[5]) + : "", + fontSize: SizeConfig.textMultiplier * 6, + color: Colors.black, + ), + AppText( + TranslationBase.of(context).targetPatient, + textAlign: TextAlign.center, + color: Colors.black, + ) + ], + ), + ), + ], + ), + //imageName: '1.png', + opacity: 0, + ), + Container( + color: Colors.black12, + height: MediaQuery.of(context).size.height * 0.18, + width: 1, + ), + DashboardItem( + width: MediaQuery.of(context).size.width * 0.25, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.18 + : MediaQuery.of(context).size.height * 0.36, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + child: Icon( + DoctorApp.radiology, + size: 40, + color: Colors.black, + ), + ), + Container( + margin: EdgeInsets.only(bottom: 5), + child: Column( + children: [ + AppText( + clinicName.length.toString(), + fontSize: SizeConfig.textMultiplier * 6, + color: Colors.black, + ), + AppText( + TranslationBase.of(context).clinic, + color: Colors.black, + ) + ], + ), + ), + ], + ), + //imageName: '2.png', + opacity: 0, + ), + Container( + color: Colors.black12, + height: MediaQuery.of(context).size.height * 0.18, + width: 1, + ), + DashboardItem( + width: MediaQuery.of(context).size.width * 0.25, + height: MediaQuery.of(context).orientation == + Orientation.portrait + ? MediaQuery.of(context).size.height * 0.18 + : MediaQuery.of(context).size.height * 0.36, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Container( + margin: EdgeInsets.only(top: 5), + child: Icon( + DoctorApp.referral, + size: 40, + color: Colors.black, + ), + ), + Container( + margin: EdgeInsets.only(bottom: 5), + child: Column( + children: [ + AppText( + model.dashboardItemsList.length > 0 + ? getPatientCount( + model.dashboardItemsList[2]) + : "", + fontSize: SizeConfig.textMultiplier * 6, + color: Colors.black, + ), + AppText( + TranslationBase.of(context).referral, + color: Colors.black, + ) + ], + ), + ), + ], + ), + //imageName: '3.png', + opacity: 0, + ), + ], + ) + ], + )) ]; } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3f672218..789d2d0a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1123,6 +1123,9 @@ class TranslationBase { String get sickleaveonhold => localizedValues['sickleaveonhold'][locale.languageCode]; String get noClinic => localizedValues['no-clinic'][locale.languageCode]; + + String get otherStatistic => + localizedValues['otherStatistic'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 3f7961b50c1e9f8b9d671eaefeb9710bef4576a0 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 14 Mar 2021 15:21:25 +0300 Subject: [PATCH 339/421] dashboard sreen updated --- lib/landing_page.dart | 8 +- lib/screens/QR_reader_screen.dart | 221 ++++++++++---------- lib/screens/dashboard_screen.dart | 160 +++++++------- lib/screens/doctor/doctor_reply_screen.dart | 40 ++-- lib/widgets/shared/bottom_nav_bar.dart | 32 +-- pubspec.lock | 21 ++ 6 files changed, 253 insertions(+), 229 deletions(-) diff --git a/lib/landing_page.dart b/lib/landing_page.dart index c5494acf..4d949827 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -1,4 +1,6 @@ +import 'package:doctor_app_flutter/screens/QR_reader_screen.dart'; import 'package:doctor_app_flutter/screens/dashboard_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/doctor_reply_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/message_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/my_schedule_screen.dart'; import 'package:doctor_app_flutter/screens/doctor/services_screen.dart'; @@ -64,9 +66,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - // MessagesScreen(), + DoctorReplyScreen(), MyScheduleScreen(), - // ServicesScreen() + QrReaderScreen() ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), @@ -82,7 +84,7 @@ class _LandingPageState extends State { case 2: return TranslationBase.of(context).mySchedule; case 3: - return TranslationBase.of(context).services; + return TranslationBase.of(context).qr; } } } diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 43492149..2ddb4049 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -17,6 +17,7 @@ import 'package:flutter/material.dart'; import '../routes.dart'; import 'base/base_view.dart'; + Helpers helpers = Helpers(); class QrReaderScreen extends StatefulWidget { @@ -59,6 +60,7 @@ class _QrReaderScreenState extends State { onModelReady: (model) => model.getClinicsList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).qr + TranslationBase.of(context).reader, body: Center( @@ -71,63 +73,63 @@ class _QrReaderScreenState extends State { AppText( TranslationBase.of(context).startScanning, fontSize: 18, - fontWeight: FontWeight.bold, - textAlign: TextAlign.center, - ), - SizedBox( - height: 7, - ), - AppText(TranslationBase.of(context).scanQrCode, - fontSize: 14, - fontWeight: FontWeight.w400, - textAlign: TextAlign.center), - SizedBox( - height: 15, - ), - Container( - height: 150, - child: Image.asset('assets/images/qr_code.png'), - ), - SizedBox( - height: 35, - ), - Button( - onTap: () { - _scanQrAndGetPatient(context, model); - }, - title: TranslationBase.of(context).scanQr, - loading: isLoading, - icon: Image.asset('assets/images/qr_code_white.png'), - ), - isError - ? Container( - margin: EdgeInsets.only(top: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Theme.of(context).errorColor.withOpacity(0.06), - ), - padding: EdgeInsets.symmetric( - vertical: 8.0, horizontal: 12.0), - child: Row( - children: [ - Expanded( - child: AppText( - error ?? - TranslationBase.of(context) - .errorMessage, - color: Theme - .of(context) - .errorColor)), - ], - ), - ) - : Container(), - ], + fontWeight: FontWeight.bold, + textAlign: TextAlign.center, + ), + SizedBox( + height: 7, + ), + AppText(TranslationBase.of(context).scanQrCode, + fontSize: 14, + fontWeight: FontWeight.w400, + textAlign: TextAlign.center), + SizedBox( + height: 15, + ), + Container( + height: 150, + child: Image.asset('assets/images/qr_code.png'), ), - ), + SizedBox( + height: 35, + ), + Button( + onTap: () { + _scanQrAndGetPatient(context, model); + }, + title: TranslationBase.of(context).scanQr, + loading: isLoading, + icon: Image.asset('assets/images/qr_code_white.png'), + ), + isError + ? Container( + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: + Theme.of(context).errorColor.withOpacity(0.06), + ), + padding: EdgeInsets.symmetric( + vertical: 8.0, horizontal: 12.0), + child: Row( + children: [ + Expanded( + child: AppText( + error ?? + TranslationBase.of(context) + .errorMessage, + color: Theme.of(context).errorColor)), + ], + ), + ) + : Container(), + ], ), ), - ),); + ), + ), + ), + ); } _scanQrAndGetPatient(BuildContext context, PatientViewModel model) async { @@ -135,7 +137,7 @@ class _QrReaderScreenState extends State { /// var result = await BarcodeScanner.scan(); /// int patientID = get from qr result var result = await BarcodeScanner.scan(); - if (result.rawContent != "") { + if (result.rawContent != "") { List listOfParams = result.rawContent.split(','); String patientType = "1"; setState(() { @@ -152,66 +154,65 @@ class _QrReaderScreenState extends State { // patient.setClinicID = doctorProfile.clinicID; // patient.setProjectID = doctorProfile.projectID; // Provider.of(context, listen: false); - patient.PatientID = 8808; - patient.TokenID = token; - model - .getPatientList(patient, "1", isBusyLocal: true) - .then((response) { - if (response['MessageStatus'] == 1) { - switch (patientType) { - case "0": - if (response['List_MyOutPatient'] != null) { - setState(() { - patientList = - ModelResponse.fromJson(response['List_MyOutPatient']).list; - isLoading = false; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); - } - break; - case "1": - if (response['List_MyInPatient'] != null) { - setState(() { - patientList = - ModelResponse.fromJson(response['List_MyInPatient']).list; - isLoading = false; - error = ""; - }); - Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - "patient": patientList[0], - }); - } else { - setState(() { - isError = true; - isLoading = false; - }); - DrAppToastMsg.showErrorToast('No patient'); + patient.PatientID = 8808; + patient.TokenID = token; + model.getPatientList(patient, "1", isBusyLocal: true).then((response) { + if (response['MessageStatus'] == 1) { + switch (patientType) { + case "0": + if (response['List_MyOutPatient'] != null) { + setState(() { + patientList = + ModelResponse.fromJson(response['List_MyOutPatient']) + .list; + isLoading = false; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); + } break; - } + case "1": + if (response['List_MyInPatient'] != null) { + setState(() { + patientList = + ModelResponse.fromJson(response['List_MyInPatient']).list; + isLoading = false; + error = ""; + }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": patientList[0], + }); + } else { + setState(() { + isError = true; + isLoading = false; + }); + DrAppToastMsg.showErrorToast('No patient'); + break; + } + } + } else { + setState(() { + isLoading = false; + isError = true; + }); + DrAppToastMsg.showErrorToast( + response['ErrorEndUserMessage'] ?? response['ErrorMessage']); } - } else { + }).catchError((error) { setState(() { isLoading = false; - isError = true; }); - DrAppToastMsg.showErrorToast( - response['ErrorEndUserMessage'] ?? response['ErrorMessage']); - } - }).catchError((error) { - setState(() { - isLoading = false; + helpers.showErrorToast(error.message); + //DrAppToastMsg.showErrorToast(error); }); - helpers.showErrorToast(error.message); - //DrAppToastMsg.showErrorToast(error); - }); - } + } } } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 5797b0c1..fbe39980 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -989,50 +989,6 @@ class _DashboardScreenState extends State { ); }, ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.qr_code, - size: 50, - color: Colors.black, - ), - Column( - children: [ - AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).reader - : TranslationBase.of(context).qr, - color: Colors.black, - textAlign: TextAlign.center, - ), - AppText( - projectsProvider.isArabic - ? TranslationBase.of(context).qr - : TranslationBase.of(context).reader, - color: Colors.black, - textAlign: TextAlign.center, - ), - ], - ) - ], - ), -// imageName: '1.png', - hasBorder: true, - onTap: () { - Navigator.of(context).pushNamed(QR_READER); - }, - ), - ], - ), - SizedBox( - height: 20, - ), - Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ DashboardItem( child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -1060,44 +1016,88 @@ class _DashboardScreenState extends State { ); }, ), +// DashboardItem( +// child: Column( +// mainAxisAlignment: MainAxisAlignment.spaceAround, +// children: [ +// Icon( +// DoctorApp.qr_code, +// size: 50, +// color: Colors.black, +// ), +// Column( +// children: [ +// AppText( +// projectsProvider.isArabic +// ? TranslationBase.of(context).reader +// : TranslationBase.of(context).qr, +// color: Colors.black, +// textAlign: TextAlign.center, +// ), +// AppText( +// projectsProvider.isArabic +// ? TranslationBase.of(context).qr +// : TranslationBase.of(context).reader, +// color: Colors.black, +// textAlign: TextAlign.center, +// ), +// ], +// ) +// ], +// ), +// // imageName: '1.png', +// hasBorder: true, +// onTap: () { +// Navigator.of(context).pushNamed(QR_READER); +// }, +// ), + ], + ), + SizedBox( + height: 20, + ), + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ SizedBox( width: 8, ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.mail, - size: 50, - color: Colors.black, - ), - Column( - children: [ - AppText( - TranslationBase.of(context).theDoctor, - textAlign: TextAlign.center, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).reply, - textAlign: TextAlign.center, - color: Colors.black, - ), - ], - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => DoctorReplyScreen(), - ), - ); - }, - ) + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.mail, + // size: 50, + // color: Colors.black, + // ), + // Column( + // children: [ + // AppText( + // TranslationBase.of(context).theDoctor, + // textAlign: TextAlign.center, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).reply, + // textAlign: TextAlign.center, + // color: Colors.black, + // ), + // ], + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => DoctorReplyScreen(), + // ), + // ); + // }, + // ) ], ), SizedBox( @@ -1275,7 +1275,7 @@ class _DashboardScreenState extends State { authProvider.getDocProfiles(docInfo.toJson()).then((res) async { changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - model.getDashboard(); + // model.getDashboard(); }).catchError((err) { changeIsLoading(false); helpers.showErrorToast(err); diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index dc6de602..b57bd1a2 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -15,32 +15,32 @@ import 'package:flutter/material.dart'; *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service */ class DoctorReplyScreen extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getDoctorReply(), builder: (_, model, w) => AppScaffold( - baseViewModel: model, + baseViewModel: model, appBarTitle: TranslationBase.of(context).replay2, - body: model - .listDoctorWorkingHoursTable.isEmpty ? DrAppEmbeddedError(error: TranslationBase.of(context).noItem):Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: model - .listDoctorWorkingHoursTable - .map((reply) { - return DoctorReplyWidget(reply: reply); - }).toList(), - ) - ], - ), - ), + isShowAppBar: false, + body: model.listDoctorWorkingHoursTable.isEmpty + ? DrAppEmbeddedError( + error: TranslationBase.of(context).noItem) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: + model.listDoctorWorkingHoursTable.map((reply) { + return DoctorReplyWidget(reply: reply); + }).toList(), + ) + ], + ), + ), )); } } diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index 6a791627..c30b1540 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -44,14 +44,14 @@ class _BottomNavBarState extends State { currentIndex: 0, name: TranslationBase.of(context).home, ), - // BottomNavigationItem( - // icon: DoctorApp.message_icon, - // activeIcon: DoctorApp.message_icon_active, - // changeIndex: _changeIndex, - // index: _index, - // currentIndex: 1, - // name: TranslationBase.of(context).replay2, - // ), + BottomNavigationItem( + icon: DoctorApp.message_icon, + activeIcon: DoctorApp.message_icon_active, + changeIndex: _changeIndex, + index: _index, + currentIndex: 1, + name: TranslationBase.of(context).replay2, + ), BottomNavigationItem( icon: DoctorApp.schedule_icon, activeIcon: DoctorApp.scdedule_icon_active, @@ -60,14 +60,14 @@ class _BottomNavBarState extends State { currentIndex: 2, name: TranslationBase.of(context).mySchedule, ), - // BottomNavigationItem( - // icon: DoctorApp.menu_icon, - // activeIcon: DoctorApp.menu_icon_active, - // changeIndex: _changeIndex, - // index: _index, - // currentIndex: 3, - // name: TranslationBase.of(context).services, - // ) + BottomNavigationItem( + icon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_code, + changeIndex: _changeIndex, + index: _index, + currentIndex: 3, + name: TranslationBase.of(context).qr, + ) ], ), ), diff --git a/pubspec.lock b/pubspec.lock index 94f07eea..d044f1fb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -403,6 +403,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -410,6 +417,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" flutter_test: dependency: "direct dev" description: flutter @@ -873,6 +887,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" typed_data: dependency: transitive description: From bcf25d7b9559161b2a7d5e1d8d2cacc15125e4cc Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 14 Mar 2021 14:28:10 +0200 Subject: [PATCH 340/421] Medical Report & update Prescription form update --- .../medical-file/medical_file_details.dart | 16 ++++++++-------- .../prescription/prescription_screen.dart | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 431342eb..35705d12 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -303,8 +303,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isHistoryExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -404,8 +404,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isAssessmentExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -584,8 +584,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isProcedureExpand - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( @@ -758,8 +758,8 @@ class _MedicalFileDetailsState extends State { }); }, child: Icon(isPhysicalExam - ? EvaIcons.minus - : EvaIcons.plus)) + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), bodyWidget: ListView.builder( diff --git a/lib/screens/prescription/prescription_screen.dart b/lib/screens/prescription/prescription_screen.dart index 6e9f0676..f09c99bb 100644 --- a/lib/screens/prescription/prescription_screen.dart +++ b/lib/screens/prescription/prescription_screen.dart @@ -630,7 +630,7 @@ class _NewPrescriptionScreenState extends State { .toString(), patient: patient, drugId: model.prescriptionList[0].entityList[index].medicineCode, - drugName: model.prescriptionList[0].entityList[index].doseDetail, + drugName: model.prescriptionList[0].entityList[index].medicationName, remarks: model.prescriptionList[0].entityList[index].remarks, model: model, enteredRemarks: model.prescriptionList[0].entityList[index].remarks, From 1536632cd4c0c9d28b5e32d4fa36b05be97ed602 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 15 Mar 2021 13:56:19 +0300 Subject: [PATCH 341/421] dashboard updated --- lib/config/config.dart | 4 ++-- lib/screens/dashboard_screen.dart | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 35c35ef3..637721b8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index fbe39980..9d8bdb2c 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -1344,7 +1344,7 @@ class _DashboardScreenState extends State { child: Padding( padding: const EdgeInsets.all(5.0), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ rowCount( @@ -1420,7 +1420,7 @@ class _DashboardScreenState extends State { child: Padding( padding: const EdgeInsets.all(5.0), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, crossAxisAlignment: CrossAxisAlignment.start, children: [ rowCount( From 9b02bdc54136b222d136d602ac6aff1c84ee6d3b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 17 Mar 2021 10:01:43 +0200 Subject: [PATCH 342/421] inhancements --- .../referral/my-referral-patient-screen.dart | 61 ++++++++------- .../shared/app_expandable_notifier.dart | 77 ++++++++++--------- 2 files changed, 75 insertions(+), 63 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 5e749011..54e8e8c9 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -60,32 +60,41 @@ class MyReferralPatientScreen extends StatelessWidget { ), ...List.generate( model.pendingReferral.length, - (index) => PatientReferralItemWidget( - "${model.pendingReferral[index].patientID}", - patientName: model.pendingReferral[index].patientName, - referralStatus: null, - isReferredTo: false, - isSameBranch: model.pendingReferral[index] - .isReferralDoctorSameBranch, - referralDoctorName: - model.pendingReferral[index].referredByDoctorInfo, - clinicDescription: null, - remark: - model.pendingReferral[index].remarksFromSource, - referredOn: model.pendingReferral[index].referredOn, - answerFromTarget: - model.pendingReferral[index].answerFromTarget, - infoIcon: InkWell( - onTap: () { - Navigator.of(context) - .pushNamed(MY_REFERRAL_DETAIL, arguments: { - 'referral': model.pendingReferral[index] - }); - }, - child: Icon( - Icons.info_outline, - color: Colors.black, - size: 30, + (index) => InkWell( + onTap: () { + Navigator.of(context).pushNamed(MY_REFERRAL_DETAIL, + arguments: { + 'referral': model.pendingReferral[index] + }); + }, + child: PatientReferralItemWidget( + "${model.pendingReferral[index].patientID}", + patientName: + model.pendingReferral[index].patientName, + referralStatus: null, + isReferredTo: false, + isSameBranch: model.pendingReferral[index] + .isReferralDoctorSameBranch, + referralDoctorName: model + .pendingReferral[index].referredByDoctorInfo, + clinicDescription: null, + remark: + model.pendingReferral[index].remarksFromSource, + referredOn: model.pendingReferral[index].referredOn, + answerFromTarget: + model.pendingReferral[index].answerFromTarget, + infoIcon: InkWell( + onTap: () { + Navigator.of(context) + .pushNamed(MY_REFERRAL_DETAIL, arguments: { + 'referral': model.pendingReferral[index] + }); + }, + child: Icon( + Icons.info_outline, + color: Colors.black, + size: 30, + ), ), ), ), diff --git a/lib/widgets/shared/app_expandable_notifier.dart b/lib/widgets/shared/app_expandable_notifier.dart index 4ae87e8a..5e934167 100644 --- a/lib/widgets/shared/app_expandable_notifier.dart +++ b/lib/widgets/shared/app_expandable_notifier.dart @@ -6,49 +6,52 @@ class AppExpandableNotifier extends StatelessWidget { final Widget bodyWid; AppExpandableNotifier({this.headerWid, this.bodyWid}); + @override Widget build(BuildContext context) { return ExpandableNotifier( - child: Padding( - padding: const EdgeInsets.all(10), - child: Card( - clipBehavior: Clip.antiAlias, - child: Column( - children: [ - SizedBox( - child: headerWid, - ), - ScrollOnExpand( - scrollOnExpand: true, - scrollOnCollapse: false, - child: ExpandablePanel( - theme: const ExpandableThemeData( - headerAlignment: ExpandablePanelHeaderAlignment.center, - tapBodyToCollapse: true, + child: Padding( + padding: const EdgeInsets.all(10), + child: Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + SizedBox( + child: headerWid, + ), + ScrollOnExpand( + scrollOnExpand: true, + scrollOnCollapse: false, + child: ExpandablePanel( + theme: const ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center, + tapBodyToCollapse: true, + ), + header: Padding( + padding: EdgeInsets.all(10), + child: Text( + "See Graph Details", + style: TextStyle(fontWeight: FontWeight.bold), + )), + collapsed: Text(''), + expanded: bodyWid, + builder: (_, collapsed, expanded) { + return Padding( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + child: Expandable( + collapsed: collapsed, + expanded: expanded, + theme: const ExpandableThemeData(crossFadePoint: 0), + ), + ); + }, ), - header: Padding( - padding: EdgeInsets.all(10), - child: Text( - "See Graph Details", - style: TextStyle(fontWeight: FontWeight.bold), - )), - collapsed: Text(''), - expanded: bodyWid, - builder: (_, collapsed, expanded) { - return Padding( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), - child: Expandable( - collapsed: collapsed, - expanded: expanded, - theme: const ExpandableThemeData(crossFadePoint: 0), - ), - ); - }, ), - ), - ], + ], + ), ), ), - )); + initialExpanded: true, + ); } } From 4d6795fcc020bfb26891f74d45dc12b428550c76 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 17 Mar 2021 12:38:14 +0200 Subject: [PATCH 343/421] show all services for all type of patient. --- .../profile/profile_medical_info_widget.dart | 26 +++++++++---------- pubspec.lock | 21 +++++++++++++++ 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index b5b60619..9f00378c 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -41,7 +41,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -60,7 +60,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -69,7 +69,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -82,7 +82,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { */ , icon: 'heartbeat.png'), - if (selectedPatientType != 7) + // if (selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -97,9 +97,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - if (selectedPatientType != 0 && - selectedPatientType != 5 && - selectedPatientType != 7) + // if (selectedPatientType != 0 && + // selectedPatientType != 5 && + // selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -107,7 +107,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -115,7 +115,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'heartbeat.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -123,7 +123,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -131,7 +131,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -139,7 +139,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -147,7 +147,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, diff --git a/pubspec.lock b/pubspec.lock index 94f07eea..d044f1fb 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -403,6 +403,13 @@ packages: description: flutter source: sdk version: "0.0.0" + flutter_page_indicator: + dependency: transitive + description: + name: flutter_page_indicator + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.3" flutter_plugin_android_lifecycle: dependency: transitive description: @@ -410,6 +417,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_swiper: + dependency: "direct main" + description: + name: flutter_swiper + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.6" flutter_test: dependency: "direct dev" description: flutter @@ -873,6 +887,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.1+3" + transformer_page_view: + dependency: transitive + description: + name: transformer_page_view + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.6" typed_data: dependency: transitive description: From 4190f32cdb0beebfe5cb7a718a25ed9c4fdef982 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 17 Mar 2021 13:41:13 +0200 Subject: [PATCH 344/421] return radiology and insurance approval --- lib/routes.dart | 2 ++ .../profile/profile_medical_info_widget.dart | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/lib/routes.dart b/lib/routes.dart index a339e664..f641d123 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -104,6 +104,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 RADIOLOGY = 'radiology'; //todo: change the routing way. var routes = { ROOT: (_) => RootPage(), @@ -138,6 +139,7 @@ var routes = { PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), + RADIOLOGY: (_) => RadiologyScreen(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9f00378c..ba369d9b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -69,6 +69,25 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), + + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'radiology-1.png'), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'lab.png' + ), + // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, From a329c447a2141a1b1cc1d18db9e756f40b425e13 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 17 Mar 2021 18:43:46 +0200 Subject: [PATCH 345/421] fix allergic in header --- .../medical-file/medical_file_details.dart | 2 +- .../medical-file/medical_file_page.dart | 1 - .../profile/patient_profile_screen.dart | 518 +++++++++++++++++- .../profile/patient-page-header-widget.dart | 6 +- .../profile/patient_profile_widget.dart | 477 ---------------- 5 files changed, 514 insertions(+), 490 deletions(-) delete mode 100644 lib/widgets/patients/profile/patient_profile_widget.dart diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 35705d12..bab2cd2c 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -2,8 +2,8 @@ import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index c4553c07..5d2b7afb 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -5,7 +5,6 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.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/patients/profile/patient_profile_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/network_base_view.dart'; diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index d95eb766..ba42173e 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,17 +1,521 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_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:flutter/material.dart'; +import 'package:provider/provider.dart'; -import '../../../widgets/patients/profile/patient_profile_widget.dart'; -import '../../../widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +/* + *@author: Elham Rababah + *@Date:22/4/2020 + *@param: + *@return:PatientProfileWidget + *@desc: Patient Profile Widget + */ +// ignore: must_be_immutable class PatientProfileScreen extends StatelessWidget { - const PatientProfileScreen({Key key}) : super(key: key); + PatiantInformtion patient; + + + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + ProjectViewModel projectViewModel = Provider.of(context); + + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String from = routeArgs['from']; + String to = routeArgs['to']; + + return BaseView( + onModelReady: (model) async { + GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( + patientMRN: patient.patientMRN??patient.patientId, + doctorID: '', + editedBy: ''); + await model.getPatientAllergy(generalGetReqForSOAP); + if (model.allergiesList.length == 0) { + await model.getMasterLookup(MasterKeysService.Allergies); + } + if (model.allergySeverityList.length == 0) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } + + }, + builder: (_, model, w) =>AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile, + + + body: Container( + color: Color(0XFFF2F2F2), + child: CustomScrollView(primary: false, slivers: [ + SliverList( + delegate: SliverChildListDelegate( + [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration(boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 0, + offset: Offset(0, 10)), + ], color: Colors.white), + child: Column(children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + ' ' + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context).fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 4, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + + + ], + ), + model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?Container( + width: MediaQuery.of(context).size.width *0.65, + child: Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: AppText( + TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ), + ), + ) : AppText(''), + ], + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + height: 11 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).nationality, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.nationalityName ??patient.nationality , + fontWeight: FontWeight.normal, + fontSize: 1.7 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).gender, + fontWeight: FontWeight.bold, + fontSize: 2 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.gender.toString() == '1' ? 'Male' : 'Female', + fontWeight: FontWeight.normal, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ]), + ), + if (patient.admissionNo != null) + Container( + margin: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).admissionDetail, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Column( + children: [ + Row( + children: [ + Container( + width: + 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context) + .dateTime, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ), + Expanded( + child: AppText( + patient.createdOn != null + ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: + 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context) + .admissionNo, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ), + AppText( + patient.admissionNo != null + ? patient.admissionNo + : '', + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: + 14 * SizeConfig.textMultiplier, + child: AppText( + TranslationBase.of(context).losNo, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ), + AppText( + patient.createdOn != null + ? DateUtils + .differenceBetweenServerDateAndCurrent( + patient.createdOn, context) + : "", + color: Colors.black, + fontWeight: FontWeight.normal, + fontSize: + 1.6 * SizeConfig.textMultiplier, + ), + ], + ), + ], + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 5, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + height: 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .area, + fontWeight: FontWeight.bold, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.clinicDescription, + fontWeight: FontWeight.normal, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.spaceEvenly, + children: [ + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of( + context) + .room, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + Expanded( + child: AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: + FontWeight.normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, + ), + ), + ], + ), + ), + SizedBox( + height: 4, + ), + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of( + context) + .bed, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.bedId}", + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ) + ], + ), + ) + ], + ), + ), + ], + ), + ], + ), + ), + SliverPadding( + padding: const EdgeInsets.all(16.0), + sliver: ProfileMedicalInfoWidget( + patient: patient, patientType:patientType, from: from, to: to, + )) + ]), + ), + )); + } +} + +class AvatarWidget extends StatelessWidget { + final Widget avatarIcon; + + AvatarWidget(this.avatarIcon); @override Widget build(BuildContext context) { - return AppScaffold( - appBarTitle: TranslationBase.of(context).patientProfile, - body: PatientProfileWidget(), + return 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), + ), + child: avatarIcon, ); } } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 6457b8cb..71515b1d 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -5,8 +5,8 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.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/screens/patients/profile/patient_profile_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; @@ -24,9 +24,7 @@ class PatientPageHeaderWidget extends StatelessWidget { return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN, - episodeId: patient.episodeNo, - appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN??patient.patientId, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart deleted file mode 100644 index 4834e412..00000000 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ /dev/null @@ -1,477 +0,0 @@ -import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:flutter/material.dart'; - -import './profile_medical_info_widget.dart'; - -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: - *@return:PatientProfileWidget - *@desc: Patient Profile Widget - */ -class PatientProfileWidget extends StatelessWidget { - PatiantInformtion patient; - - - - @override - Widget build(BuildContext context) { - final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patient']; - String patientType = routeArgs['patientType']; - String from = routeArgs['from']; - String to = routeArgs['to']; - - return Container( - color: Color(0XFFF2F2F2), - child: CustomScrollView(primary: false, slivers: [ - SliverList( - delegate: SliverChildListDelegate( - [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration(boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 10.0, - spreadRadius: 0, - offset: Offset(0, 10)), - ], color: Colors.white), - child: Column(children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 4, - ), - AppText( - patient.patientId.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ) - ], - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - Container( - height: 11 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).nationality, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.nationalityName ??patient.nationality , - fontWeight: FontWeight.normal, - fontSize: 1.7 * SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).gender, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.gender.toString() == '1' ? 'Male' : 'Female', - fontWeight: FontWeight.normal, - fontSize: 1.8 * SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ]), - ), - if (patient.admissionNo != null) - Container( - margin: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).admissionDetail, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.8 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - Row( - children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context) - .dateTime, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ), - Expanded( - child: AppText( - patient.createdOn != null - ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context) - .admissionNo, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ), - AppText( - patient.admissionNo != null - ? patient.admissionNo - : '', - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context).losNo, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ), - AppText( - patient.createdOn != null - ? DateUtils - .differenceBetweenServerDateAndCurrent( - patient.createdOn, context) - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - ], - ), - ), - const Divider( - color: Color(0xffCCCCCC), - height: 5, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: 10 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .area, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.clinicDescription, - fontWeight: FontWeight.normal, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, - children: [ - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .room, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - Expanded( - child: AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight.normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, - ), - ), - ], - ), - ), - SizedBox( - height: 4, - ), - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .bed, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - AppText( - "${patient.bedId}", - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - ), - ], - ), - ), - ), - ], - ), - ) - ], - ), - ) - ], - ), - ), - ], - ), - ], - ), - ), - SliverPadding( - padding: const EdgeInsets.all(16.0), - sliver: ProfileMedicalInfoWidget( - patient: patient, patientType:patientType, from: from, to: to, - )) - ]), - ); - } -} - -class AvatarWidget extends StatelessWidget { - final Widget avatarIcon; - - AvatarWidget(this.avatarIcon); - - @override - Widget build(BuildContext context) { - return 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), - ), - child: avatarIcon, - ); - } -} From 983f03108f608107de9e5d0838ed0a42b6a9a3b4 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 17 Mar 2021 19:44:48 +0200 Subject: [PATCH 346/421] adding prescription history & Medical file for all patient types --- lib/config/config.dart | 4 +- lib/routes.dart | 7 +- .../medical-file/medical_file_page.dart | 4 +- .../prescription_screen_history.dart | 517 ++++++++++++++++++ .../profile/profile_medical_info_widget.dart | 212 +++---- pubspec.lock | 6 +- 6 files changed, 639 insertions(+), 111 deletions(-) create mode 100644 lib/screens/prescription/prescription_screen_history.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index 637721b8..35c35ef3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/routes.dart b/lib/routes.dart index f641d123..fe280d40 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; 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/sick_leave.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_screen.dart'; @@ -100,6 +101,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; +const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH'; const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; @@ -144,7 +146,9 @@ var routes = { PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), // PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestDetailScreen(), - CREATE_EPISODE: (_) => UpdateSoapIndex(isUpdate: true,), + CREATE_EPISODE: (_) => UpdateSoapIndex( + isUpdate: true, + ), UPDATE_EPISODE: (_) => UpdateSoapIndex( isUpdate: true, ), @@ -156,6 +160,7 @@ var routes = { PATIENT_SICKLEAVE: (_) => SickLeaveScreen(), ADD_SICKLEAVE: (_) => AddSickLeavScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), + ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), // LIVECARE_END_DIALOG: (_) => EndCallDialogBox() diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 5d2b7afb..d6552a01 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -22,7 +22,7 @@ class _MedicalFilePageState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getMedicalFile(mrn: patient.patientMRN), + onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: (BuildContext context, MedicalFileViewModel model, Widget child) => AppScaffold( @@ -133,7 +133,7 @@ class _MedicalFilePageState extends State { lastName: patient.lastName, gender: patient.genderDescription, encounterNumber: index, - pp: patient.patientMRN, + pp: patient.patientId, )), ); }, diff --git a/lib/screens/prescription/prescription_screen_history.dart b/lib/screens/prescription/prescription_screen_history.dart new file mode 100644 index 00000000..eb20b83e --- /dev/null +++ b/lib/screens/prescription/prescription_screen_history.dart @@ -0,0 +1,517 @@ +import 'package:doctor_app_flutter/core/viewModel/prescription_view_model.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/screens/prescription/add_prescription_form.dart'; +import 'package:doctor_app_flutter/screens/prescription/update_prescription_form.dart'; +import 'package:doctor_app_flutter/util/helpers.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/network_base_view.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; + +class NewPrescriptionHistoryScreen extends StatefulWidget { + @override + _NewPrescriptionHistoryScreenState createState() => + _NewPrescriptionHistoryScreenState(); +} + +class _NewPrescriptionHistoryScreenState + extends State { + PersistentBottomSheetController _controller; + final _scaffoldKey = GlobalKey(); + TextEditingController strengthController = TextEditingController(); + int testNum = 0; + int strengthChar; + PatiantInformtion patient; + + @override + void initState() { + super.initState(); + } + + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getPrescription(mrn: patient.patientId), + builder: + (BuildContext context, PrescriptionViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescription, + body: NetworkBaseView( + baseViewModel: model, + child: SingleChildScrollView( + child: Container( + child: Column( + children: [ + PatientPageHeaderWidget(patient), + Divider( + height: 1.0, + thickness: 1.0, + color: Colors.grey, + ), + (model.prescriptionList.length != 0) + ? SizedBox( + height: + model.prescriptionList[0].rowcount == 0 + ? 200.0 + : 10.0) + : SizedBox(height: 200.0), + //model.prescriptionList == null + (model.prescriptionList.length != 0) + ? model.prescriptionList[0].rowcount == 0 + ? Container( + child: AppText( + 'Sorry , Theres no prescriptions for this patient', + color: Color(0xFFB9382C), + ), + ) + : Padding( + padding: EdgeInsets.all(14.0), + child: NetworkBaseView( + baseViewModel: model, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + ...List.generate( + model.prescriptionList[0] + .rowcount, + (index) => Container( + child: Column( + children: [ + SizedBox( + height: MediaQuery.of( + context) + .size + .height * + 0.022, + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + // crossAxisAlignment: + // CrossAxisAlignment.start, + children: [ + Container( + height: MediaQuery.of( + context) + .size + .height * + 0.21, + width: MediaQuery.of( + context) + .size + .width * + 0.1, + child: Column( + children: [ + AppText( + (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn).year) + .toString() + : DateTime.now() + .year) + .toString(), + color: Colors + .green, + fontSize: + 13.5, + ), + AppText( + Helpers.getMonth(model.prescriptionList[0].entityList[index].createdOn != + null + ? (DateTime.parse(model.prescriptionList[0].entityList[index].createdOn) + .month) + : DateTime.now() + .month) + .toUpperCase(), + color: Colors + .green, + ), + AppText( + DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .createdOn) + .day + .toString(), + color: Colors + .green, + ), + AppText( + Helpers.getTimeFormated(DateTime.parse(model + .prescriptionList[ + 0] + .entityList[ + index] + .createdOn)) + .toString(), + color: Colors + .green, + ), + ], + ), + ), + Container( + // height: MediaQuery.of( + // context) + // .size + // .height * + // 0.3499, + width: MediaQuery.of( + context) + .size + .width * + 0.77, + child: Column( + children: [ + Row( + children: [ + AppText( + 'Start Date:', + fontWeight: + FontWeight + .w700, + fontSize: + 14.0, + ), + Expanded( + child: + AppText( + Helpers.getDateFormatted(DateTime.parse(model + .prescriptionList[0] + .entityList[index] + .startDate)), + fontSize: + 13.5, + ), + ), + SizedBox( + width: + 6.0, + ), + AppText( + 'Order Type:', + fontWeight: + FontWeight + .w700, + fontSize: + 14.0, + ), + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .orderTypeDescription, + fontSize: + 13.0, + ), + ), + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Container( + child: + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .medicationName, + fontWeight: + FontWeight.w700, + fontSize: + 15.0, + ), + ), + ) + ], + ), + SizedBox( + height: 5.5, + ), + Row( + children: [ + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .doseDetail, + fontSize: + 15.0, + ), + ) + ], + ), + SizedBox( + height: 10.0, + ), + Row( + children: [ + AppText( + 'Indication: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].indication), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'UOM: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].uom), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'BOX Quantity: ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].quantity.toString() == null ? "" : model.prescriptionList[0].entityList[index].quantity.toString()), + ), + ), + ], + ), + Row( + children: [ + AppText( + 'pharmacy Intervention ', + fontWeight: + FontWeight + .w700, + fontSize: + 17.0, + ), + Expanded( + child: + RichText( + maxLines: + 3, + overflow: + TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 12.0), + text: TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].pharmacyInervention == null ? "" : model.prescriptionList[0].entityList[index].pharmacyInervention.toString()), + ), + ), + ], + ), + SizedBox( + height: + 5.0), + Row( + children: [ + AppText( + 'pharmacist Remarks : ', + fontWeight: + FontWeight + .w700, + fontSize: + 15.0, + ), + Expanded( + child: AppText( + // commening below code because there is an error coming in the model please fix it before pushing it + model.prescriptionList[0].entityList[index].pharmacistRemarks == null ? "" : model.prescriptionList[0].entityList[index].pharmacistRemarks, + fontSize: 15.0), + ) + ], + ), + SizedBox( + height: 20.0, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .doctorName + + ": ", + fontWeight: + FontWeight + .w600, + ), + Expanded( + child: + AppText( + model + .prescriptionList[0] + .entityList[index] + .doctorName, + fontWeight: + FontWeight.w700, + ), + ) + ], + ), + SizedBox( + height: 8.0, + ), + Row( + children: [ + AppText( + 'Doctor Remarks : ', + fontWeight: + FontWeight + .w700, + fontSize: + 13.0, + ), + Expanded( + child: + Container( + // height: MediaQuery.of(context).size.height * + // 0.038, + child: + RichText( + // maxLines: + // 2, + // overflow: + // TextOverflow.ellipsis, + strutStyle: + StrutStyle(fontSize: 10.0), + text: + TextSpan( + style: + TextStyle(color: Colors.black), + text: model.prescriptionList[0].entityList[index].remarks != null + ? model.prescriptionList[0].entityList[index].remarks + : "", + ), + ), + ), + ), + ], + ), + SizedBox( + height: 10.0, + ), + + // SizedBox( + // height: 40, + // ), + ], + ), + ), + ], + ), + Divider( + height: 0, + thickness: 1.0, + color: Colors.grey, + ), + ], + ), + ), + ), + ], + ), + ), + ) + : Container( + child: AppText( + 'Sorry , theres no prescriptions listed for this patient', + color: Color(0xFFB9382C), + ), + ) + ], + ), + ), + ), + )), + ); + } + + selectDate(BuildContext context, PrescriptionViewModel model) async { + DateTime selectedDate; + selectedDate = DateTime.now(); + final DateTime picked = await showDatePicker( + context: context, + initialDate: selectedDate, + firstDate: DateTime.now().add(Duration(hours: 2)), + lastDate: DateTime(2040), + initialEntryMode: DatePickerEntryMode.calendar, + ); + if (picked != null && picked != selectedDate) { + setState(() { + selectedDate = picked; + }); + } + } +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ba369d9b..9bd2230d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -42,73 +42,72 @@ class ProfileMedicalInfoWidget extends StatelessWidget { childAspectRatio: 1.5, children: [ // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo != 0 ? true : false, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - onTap: () async { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, - patientMRN: patient.patientMRN); - await model.postEpisode(postEpisodeReqModel); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed(CREATE_EPISODE, - arguments: {'patient': patient}); - }, - isLoading: model.state == ViewState.BusyLocal, - icon: 'create-episod.png'), + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + onTap: () async { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context) + .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); + }, + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo == 0 ? true : false, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, + route: UPDATE_EPISODE, + icon: 'modilfy-episode.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'radiology-1.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'lab.png' - ), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'lab.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: - VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + PatientProfileButton( + key: key, + patient: patient, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN */ - , - icon: 'heartbeat.png'), + , + icon: 'heartbeat.png'), // if (selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -119,30 +118,37 @@ class ProfileMedicalInfoWidget extends StatelessWidget { // if (selectedPatientType != 0 && // selectedPatientType != 5 && // selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ADMISSION_REQUEST, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'heartbeat.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), + (int.parse(patientType) == 7 || int.parse(patientType) == 6) + ? PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png') + : PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_HISTORY, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -151,29 +157,29 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'note.png'), + PatientProfileButton( + key: key, + patient: patient, + route: REFER_PATIENT_TO_DOCTOR, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, + icon: 'note.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'lab.png'), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index d044f1fb..909670db 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.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -844,7 +844,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -986,5 +986,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 376653a3440060ec5e5ba5c32bbe90e305dea52b Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Thu, 18 Mar 2021 08:42:17 +0300 Subject: [PATCH 347/421] dashboard changes --- assets/fonts/DoctorApp.ttf | Bin 16960 -> 18544 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 6 + lib/icons_app/config.json | 88 +- lib/icons_app/doctor_app_icons.dart | 100 +- lib/landing_page.dart | 20 +- lib/main.dart | 2 +- lib/screens/dashboard_screen.dart | 2532 +++++++++-------- .../doctor/my_referred_patient_screen.dart | 40 +- .../doctor/patient_arrival_screen.dart | 130 + .../medicine/medicine_search_screen.dart | 281 +- .../search_medicine_patient_screen.dart | 109 + .../patients/patient_search_screen.dart | 141 +- lib/screens/patients/patients_screen.dart | 66 +- .../referral/my-referral-patient-screen.dart | 2 + .../referral/patient_referral_screen.dart | 101 + .../add-rescheduleleave.dart | 2 + lib/util/translations_delegate_base.dart | 7 + .../profile/profile-welcome-widget.dart | 107 +- lib/widgets/shared/app_scaffold_widget.dart | 74 +- lib/widgets/shared/bottom_nav_bar.dart | 20 +- lib/widgets/shared/network_base_view.dart | 1 + 22 files changed, 2253 insertions(+), 1580 deletions(-) create mode 100644 lib/screens/doctor/patient_arrival_screen.dart create mode 100644 lib/screens/medicine/search_medicine_patient_screen.dart create mode 100644 lib/screens/patients/profile/referral/patient_referral_screen.dart diff --git a/assets/fonts/DoctorApp.ttf b/assets/fonts/DoctorApp.ttf index 7c3f1bf1f7a4bec949e74b3cd8319ed91b753cb5..dbf930ff8f68bef59e692cbe5cd54eeb397e0e09 100644 GIT binary patch delta 2243 zcmah}ZERat89wj1ALoA9jve2R*v_?m{n^xuli1gGN#ZzNmo`aNrQJ||Z2g!?lcvzL zSsJYg0vSOY{!FST|5$$v27e}P(-2Z6m{2rTASC!fwI2nvsX}O*kl{yFkctqZ4)4vS zq7sw1SC8NGzW2P(dEax+<2%>kVH?`%R)P?CjS#Z9wANhLzxTI~38Ci+;kGVZ+FrT) z{nLLZL`)J=Ute8ro{yiu^L3p2M?`fM1M+)97stDZ%<9_a*3Qb_Z;|hF^uKlK%2KmC z`}+rk2=~!{cCER!4vX*@zYn0Fyxd${-u*aAOhS&daY5hum8+XC|MR1t6LR!ToOJK? z-E<>K0OukueYfwM=lUie5tVaSB=@g<__Zf?@6p~FvB`Y}eTh&vijSL@?8M;}D0kY> zfD@gM;3V%Rcaro_i|g(^;;>hI1O$h82Ek+E{ry}*euq()~0gAqG6*TcC&C&7y{?#ljScZ&QkT0vY2LHf{!Jz!y^t9c+Hw7Lhr`I z?UC*Y4umf3LT=v^>P8Fu z+WRW^XYK_&IEe(Xz5?#z40(yXOqR$hd4=2{ZSq6%Q}Qc9vL?${CxGQApoGI(x>|=g zXkymEXvwf3oyyfAt!rWdm{Fpw1Zm5*TbE^-A8@V%_=CaT zZoP1!P@f6tsZwSUl(5eiRv_g>M?+FtPw_|39EFvhH8~om3gskWex7MGK05iY-KsO- z-%8n6Wd9d%l{1S^sLC;qic5^oj3;2N*LuRnJhsH>WbfAsi!Cg~m@-xvo-cgqIp-P- z4Z$_%t|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8Nxd*#47Rc*{O9^BJI(A)GOM#WN5l~idpq(;@4 zDyT}pvnr@KHJ4iMpGL?3P0)V=cVZaeaevXFgL-8Fo&^|t}2HKZ4K>J(+v~S3u-(QUypnW;RF{C&cGe9p= zFd)NNG2kd5x5Fcup2PQ}ORV!Z diff --git a/lib/config/config.dart b/lib/config/config.dart index 637721b8..35c35ef3 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 3904ed1f..01d0a58e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -740,4 +740,10 @@ const Map> localizedValues = { }, 'no-clinic': {'en': "No Clinic", 'ar': "لا عيادة"}, 'otherStatistic': {'en': "Other Statistics", 'ar': "دیگر شماریات"}, + 'ptientsreferral': {'en': "Patient's Referrals", 'ar': "مریض کا حوالہ"}, + 'arrivalpatient': {'en': "Arrival Patients", 'ar': "مریضوں کی آمد"}, + 'searchmedicinepatient': { + 'en': "Search patient or Medicines", + 'ar': "مریض یا دوائیں تلاش کریں" + }, }; diff --git a/lib/icons_app/config.json b/lib/icons_app/config.json index 15dda748..0b02017e 100644 --- a/lib/icons_app/config.json +++ b/lib/icons_app/config.json @@ -426,6 +426,48 @@ "search_patient" ] }, + { + "uid": "acee3dc68dc70f4b268b59a42fd957ee", + "css": "referral-1", + "code": 59408, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.7C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.3 725.6 793.1ZM835.9 793.1H844.8C849.3 793.1 853.7 793.4 858.1 793.7L834.2 913.3 781.7 860.8ZM913.8 655.1H912.8A154.1 154.1 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.1ZM603.4 482.7A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.2V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.5ZM603.4 655.1A34.5 34.5 0 1 1 603.4 586.2V637.9A154.1 154.1 0 0 0 604.4 655.1ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.7 586.2H879.2V637.9A120.6 120.6 0 0 1 637.9 637.9ZM1000 1000H517.2V948.3A155.6 155.6 0 0 1 625.2 800.5L655.4 951.7A17.3 17.3 0 0 0 667.3 964.8 17.6 17.6 0 0 0 672.3 965.5 17.3 17.3 0 0 0 684.5 960.4L758.5 886.4 832.5 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.6 155.6 0 0 1 999.8 948.3ZM164.1 413.8L218.3 481.5 165.7 534 141.8 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.4L317 534 264.5 481.5ZM396.5 275.8H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.8ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.6 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.5 206.9H362V258.6A120.6 120.6 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.6 155.6 0 0 1 107.9 421.2L138.2 572.3A17.3 17.3 0 0 0 150.1 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.1L241.3 507.1 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.7 421.2A155.6 155.6 0 0 1 482.6 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.8 731.3 286.1 810.2H258.8A17.2 17.2 0 0 0 241.6 827.4 206.9 206.9 0 0 0 333.6 999.5 172.6 172.6 0 0 1 172.4 827.6Z", + "width": 1000 + }, + "search": [ + "referral" + ] + }, + { + "uid": "7c82c028b3a01309cc1ffd1eaeb1ccf8", + "css": "search", + "code": 59467, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M543.6 353.5A132.3 132.3 0 1 1 411.3 221.2 132.3 132.3 0 0 1 543.6 353.5ZM974.2 974.1A88.2 88.2 0 0 1 849.4 974.1S624.7 749.2 622.9 747A405.4 405.4 0 1 1 747 622.8C749.2 624.6 974.2 849.4 974.2 849.4A88.2 88.2 0 0 1 974.1 974.1ZM726 405.2A320.8 320.8 0 1 0 206.8 657.2 146.9 146.9 0 0 1 352.4 530H470.1A146.9 146.9 0 0 1 614.3 648.4 320 320 0 0 0 726 405.2Z", + "width": 1000 + }, + "search": [ + "search" + ] + }, + { + "uid": "898cfb6ea07e1c004d9173c59903b3c3", + "css": "arrival-patients", + "code": 59469, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M490.4 621.6L473.9 574.9A181.3 181.3 0 0 1 396.3 590.7 177.3 177.3 0 0 1 318 574.2L295.4 620.7A13.4 13.4 0 0 1 287.5 627.5Q281.1 629.6 274.2 631.7A117.4 117.4 0 0 0 304 686.6 127.3 127.3 0 0 0 493.2 682.1 264 264 0 0 1 513.3 634.8C508.1 633.1 503.1 631.4 498.5 629.9A13.2 13.2 0 0 1 490.4 621.6ZM481.4 761.4A266.9 266.9 0 0 1 483.6 727 150.9 150.9 0 0 1 396.3 753.5 149.3 149.3 0 0 1 284.6 705 146.4 146.4 0 0 1 248.5 639.3L233.3 643.5C129.3 672.7 0 708.9 0 820.9V960.9C0 977.4 7.5 1000.1 19.8 1000.1H630.7A265.8 265.8 0 0 1 481.4 761.4ZM401.9 191.2C406.8 191.6 411.8 192 416.4 192.4 457.3 196.1 484.3 198.5 510.1 141.6A13.2 13.2 0 0 1 534.3 141.2L535.6 143.8A198.4 198.4 0 0 1 571.3 227.5C572.5 212.4 573.2 199.6 573.2 194.6S573.2 184.2 573.4 178.7A151.6 151.6 0 0 0 536.5 56.1 193.6 193.6 0 0 0 393.6 0.1 191.6 191.6 0 0 0 255.3 63L251.6 67.2A164.1 164.1 0 0 0 205.3 202.8 286.8 286.8 0 0 0 212.2 239.2 145.9 145.9 0 0 1 243.7 164 70.6 70.6 0 0 1 297.3 140.8C317.2 140.8 324.1 160.7 330.7 179.6 340.6 208.7 352 241.1 399 243.9 374.8 216.8 379 207 381.1 202.3A19.2 19.2 0 0 1 401.9 191.2ZM541.8 420.1A12.9 12.9 0 0 1 549.2 418.1H549.6C571.7 418.1 597.4 385 607.1 343.9A25.6 25.6 0 0 0 599.3 314.8 13.2 13.2 0 0 0 584.1 319.6 13.4 13.4 0 0 1 572.7 328.1L571.6 328.1A13.2 13.2 0 0 1 558.4 315.9 438.1 438.1 0 0 0 524 173C491.9 225.9 452.4 222.6 414.1 219.1H413.5A270.3 270.3 0 0 0 438.7 245.5 13.2 13.2 0 0 1 431.6 268.7C337.9 281.9 317.5 223.2 305.3 188.1A89.3 89.3 0 0 0 296.5 167.3 44.1 44.1 0 0 0 263.2 181.9 131.4 131.4 0 0 0 236.7 255.8 309.2 309.2 0 0 0 235.2 305.5 15.4 15.4 0 0 1 210.2 321.5C204.3 315.3 198 313.3 192.9 316.1A24.5 24.5 0 0 0 185.5 344C195.3 385.1 221 418.2 243.1 418.2H243.7A13.2 13.2 0 0 1 257 431.2 150 150 0 0 0 318.4 544 143.4 143.4 0 0 0 396.2 564.1 146.3 146.3 0 0 0 474.1 544.5L474.3 544.5A145.9 145.9 0 0 0 535.4 431.5 13.2 13.2 0 0 1 541.7 420.4ZM746.8 522.7A238.6 238.6 0 1 0 985.4 761.3 238.6 238.6 0 0 0 746.8 522.7ZM881.7 796.9A17.9 17.9 0 0 1 863.8 814.7H792.4V888.4A17.9 17.9 0 0 1 774.5 906.2H712A17.9 17.9 0 0 1 694.1 888.4V814.7H620.5A17.9 17.9 0 0 1 602.6 796.9V734.4A17.9 17.9 0 0 1 620.5 716.5H694.1V645.1A17.9 17.9 0 0 1 712 627.2H774.5A17.9 17.9 0 0 1 792.4 645.1V716.5H863.8A17.9 17.9 0 0 1 881.7 734.4ZM765.6 725.4V654H721V725.4A17.9 17.9 0 0 1 703.1 743.3H629.5V787.9H703.1A17.9 17.9 0 0 1 721 805.8V879.5H765.6V805.8A17.9 17.9 0 0 1 783.5 787.9H854.9V743.3H783.5A17.9 17.9 0 0 1 765.6 725.4Z", + "width": 985 + }, + "search": [ + "arrival-patients" + ] + }, { "uid": "740f78c2b53c8cc100a8b0d283bbd34f", "css": "home_icon-1", @@ -471,7 +513,7 @@ { "uid": "e2f6f0a56d4570c777c8bd5c50e38ea7", "css": "menu_icon_active-1", - "code": 59408, + "code": 59409, "src": "custom_icons", "selected": false, "svg": { @@ -485,7 +527,7 @@ { "uid": "f7eb1344b3a40f36bb4d32cdd0d76496", "css": "message_icon-1", - "code": 59409, + "code": 59410, "src": "custom_icons", "selected": false, "svg": { @@ -523,6 +565,48 @@ "search": [ "scdedule_icon_active" ] + }, + { + "uid": "2661cb62f53ed61755aa809d5280808e", + "css": "referral-bg", + "code": 59466, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M681.4 793.1L735.5 860.8 683 913.3 659.1 793.8C663.5 793.4 667.9 793.1 672.4 793.1ZM791.7 793.1L758.6 834.5 725.5 793.1ZM835.9 793.1H844.8C849.4 793.1 853.7 793.4 858.1 793.8L834.2 913.3 781.7 860.8ZM913.8 655.2H912.8A154 154 0 0 0 913.8 637.9V586.2A34.5 34.5 0 0 1 913.8 655.2ZM603.4 482.8A103.6 103.6 0 0 1 706.9 379.3H810.3A103.6 103.6 0 0 1 913.8 482.8V551.7H844.8A34.5 34.5 0 0 1 810.3 517.3V448.3H775.9V465.5A86.3 86.3 0 0 1 689.7 551.7H603.4ZM603.4 655.2A34.5 34.5 0 0 1 603.4 586.2V637.9A154 154 0 0 0 604.5 655.2ZM637.9 637.9V586.2H689.6A120.4 120.4 0 0 0 781.2 543.9 69 69 0 0 0 844.8 586.2H879.3V637.9A120.7 120.7 0 1 1 637.9 637.9ZM1000 1000H517.2V948.3A155.4 155.4 0 0 1 625.3 800.5L655.5 951.7A17.3 17.3 0 0 0 667.4 964.8 17.6 17.6 0 0 0 672.4 965.5 17.3 17.3 0 0 0 684.6 960.5L758.6 886.5 832.6 960.5A17.2 17.2 0 0 0 861.7 951.7L891.9 800.5A155.5 155.5 0 0 1 999.9 948.3ZM164.1 413.8L218.3 481.5 165.8 534 141.9 414.5C146.3 414.1 150.7 413.8 155.2 413.8ZM274.5 413.8L241.4 455.2 208.3 413.8ZM318.6 413.8H327.6C332.1 413.8 336.5 414.1 340.9 414.5L317 534 264.5 481.5ZM396.6 275.9H395.5A154 154 0 0 0 396.5 258.6V206.9A34.5 34.5 0 0 1 396.5 275.9ZM86.2 103.5A103.6 103.6 0 0 1 189.7 0H293.1A103.6 103.6 0 0 1 396.6 103.5V172.4H327.6A34.5 34.5 0 0 1 293.1 137.9V69H258.6V86.2A86.3 86.3 0 0 1 172.4 172.4H86.2ZM86.2 275.9A34.5 34.5 0 1 1 86.2 206.9V258.6A154 154 0 0 0 87.2 275.9ZM120.7 258.6V206.9H172.4A120.4 120.4 0 0 0 264 164.6 69 69 0 0 0 327.6 206.9H362V258.6A120.7 120.7 0 1 1 120.7 258.6ZM482.8 620.7H0V569A155.4 155.4 0 0 1 108 421.2L138.2 572.4A17.3 17.3 0 0 0 150.2 585.5 17.6 17.6 0 0 0 155.1 586.2 17.3 17.3 0 0 0 167.3 581.2L241.3 507.2 315.3 581.2A17.2 17.2 0 0 0 344.4 572.3L374.6 421.2A155.5 155.5 0 0 1 482.7 569ZM172.4 827.6A17.2 17.2 0 0 0 155.2 810.3H127.8L206.9 731.3 286 810.3H258.6A17.2 17.2 0 0 0 241.4 827.6 206.9 206.9 0 0 0 333.5 999.6 172.6 172.6 0 0 1 172.4 827.6Z", + "width": 1000 + }, + "search": [ + "referral-bg" + ] + }, + { + "uid": "961571413453d8de8d1d6325705ef204", + "css": "search-bg", + "code": 59468, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M543.6 353.5A132.3 132.3 0 1 1 411.3 221.2 132.3 132.3 0 0 1 543.6 353.5ZM974.2 974.2A88.2 88.2 0 0 1 849.4 974.2S624.7 749.2 622.9 747A405.4 405.4 0 1 1 747 622.9C749.2 624.6 974.2 849.4 974.2 849.4A88.2 88.2 0 0 1 974.2 974.2ZM726 405.2A320.8 320.8 0 1 0 206.8 657.2 147 147 0 0 1 352.4 530H470A147.1 147.1 0 0 1 614.3 648.5 320 320 0 0 0 726 405.2Z", + "width": 1000 + }, + "search": [ + "search-bg" + ] + }, + { + "uid": "6ec3034cfbe5c91e478ef9b9437647ed", + "css": "arrival-patients-bg", + "code": 59470, + "src": "custom_icons", + "selected": false, + "svg": { + "path": "M490.4 621.6L473.9 574.8A181.3 181.3 0 0 1 396.3 590.7 177.3 177.3 0 0 1 318 574.1L295.4 620.6A13.4 13.4 0 0 1 287.5 627.5Q281.1 629.6 274.3 631.6A117.4 117.4 0 0 0 304.2 686.6 127.3 127.3 0 0 0 493.5 682 264 264 0 0 1 513.6 634.6C508.3 633 503.4 631.3 498.7 629.8A13.4 13.4 0 0 1 490.4 621.6ZM481.4 761.4A266.9 266.9 0 0 1 483.6 727 150.9 150.9 0 0 1 396.3 753.3 149.3 149.3 0 0 1 284.6 704.8 146.4 146.4 0 0 1 248.5 639.1L233.3 643.4C129.4 672.5 0 708.8 0 820.7V960.8C0 977.1 7.5 1000 19.9 1000H630.7A265.8 265.8 0 0 1 481.4 761.4ZM401.8 191.2C406.8 191.6 411.6 192 416.4 192.4 457.3 196.1 484.2 198.5 510.1 141.7A13.4 13.4 0 0 1 534.2 141.2L535.5 143.8C552.2 161.8 563.7 195.1 571.3 227.6 572.5 212.4 573.2 199.7 573.2 194.7S573.3 184.3 573.4 178.8C574.2 139.6 575 95.1 536.5 56.1A193.6 193.6 0 0 0 393.6 0 191.5 191.5 0 0 0 255.3 62.7L251.6 67C228.8 92.4 203.1 121.1 205.1 202.5A286.9 286.9 0 0 0 212 238.8 146 146 0 0 1 243.5 163.5 70.6 70.6 0 0 1 297.2 140.4C317.1 140.4 324 160.1 330.5 179.2 340.6 208.3 351.7 240.7 398.9 243.5 374.6 216.4 378.9 206.6 380.9 201.9A19.2 19.2 0 0 1 401.8 191.2ZM541.8 420.1A12.9 12.9 0 0 1 549.2 418.1H549.6C571.7 418.1 597.4 384.9 607.2 343.8A25.6 25.6 0 0 0 599.3 314.8 13.4 13.4 0 0 0 584.2 319.5 13.4 13.4 0 0 1 572.8 328C572.5 328 572.1 328 571.7 328A13.4 13.4 0 0 1 558.3 315.8C555.8 285.8 544.9 209 523.9 172.9 491.9 226 452.4 222.4 414.1 219L413.5 219A270.3 270.3 0 0 0 438.7 245.4 13.4 13.4 0 0 1 431.6 268.5C337.9 281.9 317.5 223.1 305.3 187.9A89.4 89.4 0 0 0 296.5 167.2 44.1 44.1 0 0 0 263.2 181.7 131.4 131.4 0 0 0 236.8 255.7 309.1 309.1 0 0 0 235.3 305.2 15.4 15.4 0 0 1 210.2 321.3C204.3 315.1 198 313.1 192.9 315.9A24.5 24.5 0 0 0 185.6 343.8C195.3 384.9 221 418.1 243.2 418.1H243.8A13.4 13.4 0 0 1 257.2 431C258.1 443.9 265.2 510.1 318.6 543.8A143.4 143.4 0 0 0 396.4 563.9 146.4 146.4 0 0 0 474.3 544.3L474.6 544.1C528.8 510.5 534.9 444.1 535.6 431.1A13.4 13.4 0 0 1 541.9 420.1ZM746.8 522.7A238.6 238.6 0 1 0 985.5 761.3 238.7 238.7 0 0 0 746.8 522.7ZM881.7 796.9A17.9 17.9 0 0 1 863.9 814.7H792.4V888.4A17.9 17.9 0 0 1 774.6 906.2H712.1A17.9 17.9 0 0 1 694.2 888.4V814.7H620.6A17.9 17.9 0 0 1 602.7 796.9V734.4A17.9 17.9 0 0 1 620.6 716.5H694.2V645.1A17.9 17.9 0 0 1 712.1 627.3H774.6A17.9 17.9 0 0 1 792.4 645.1V716.5H863.9A17.9 17.9 0 0 1 881.7 734.4ZM765.6 725.4V654H721V725.4A17.9 17.9 0 0 1 703.1 743.3H629.4V787.9H703.1A17.9 17.9 0 0 1 721 805.8V879.4H765.6V805.8A17.9 17.9 0 0 1 783.5 787.9H854.9V743.3H783.5A17.9 17.9 0 0 1 765.6 725.4Z", + "width": 985 + }, + "search": [ + "arrival-patients-bg" + ] } ] } \ No newline at end of file diff --git a/lib/icons_app/doctor_app_icons.dart b/lib/icons_app/doctor_app_icons.dart index 7c05c223..902de116 100644 --- a/lib/icons_app/doctor_app_icons.dart +++ b/lib/icons_app/doctor_app_icons.dart @@ -11,7 +11,7 @@ /// fonts: /// - asset: fonts/DoctorApp.ttf /// -/// +/// /// import 'package:flutter/widgets.dart'; @@ -19,36 +19,72 @@ class DoctorApp { DoctorApp._(); static const _kFontFam = 'DoctorApp'; - static const _kFontPkg = null; + static const String _kFontPkg = null; - static const IconData female_icon = IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData male = IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData reject_icon = IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon_active = IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon = IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData menu_icon_active = IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon = IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData message_icon_active = IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData scdedule_icon_active = IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData schedule_icon = IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData discharge_patient = IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData approved_icon = IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData pending_icon = IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData in_patient_white = IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData lab_results = IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData home_icon = IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData operations = IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData out_patient = IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData patient = IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData qr_code = IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData radiology = IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referral = IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient = IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData mail = IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData medicine_search = IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData referred = IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData sync_icon = IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData drawer_icon = IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData leaves = IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); - static const IconData search_patient_1 = IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData female_icon = + IconData(0xe800, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData male = + IconData(0xe801, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData reject_icon = + IconData(0xe802, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon_active = + IconData(0xe803, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon = + IconData(0xe804, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData menu_icon_active = + IconData(0xe805, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon = + IconData(0xe806, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData message_icon_active = + IconData(0xe807, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData scdedule_icon_active = + IconData(0xe808, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData schedule_icon = + IconData(0xe809, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData discharge_patient = + IconData(0xe80a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData approved_icon = + IconData(0xe80b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData pending_icon = + IconData(0xe80c, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData in_patient_white = + IconData(0xe80d, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData lab_results = + IconData(0xe80e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData home_icon = + IconData(0xe80f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral_1 = + IconData(0xe810, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData operations = + IconData(0xe813, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData out_patient = + IconData(0xe814, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData patient = + IconData(0xe815, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData qr_code = + IconData(0xe816, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData radiology = + IconData(0xe817, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referral = + IconData(0xe818, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient = + IconData(0xe81a, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData mail = + IconData(0xe81e, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData medicine_search = + IconData(0xe81f, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData referred = + IconData(0xe822, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData sync_icon = + IconData(0xe824, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData drawer_icon = + IconData(0xe825, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData leaves = + IconData(0xe836, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search_patient_1 = + IconData(0xe849, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData search = + IconData(0xe84b, fontFamily: _kFontFam, fontPackage: _kFontPkg); + static const IconData arrival_patients = + IconData(0xe84d, fontFamily: _kFontFam, fontPackage: _kFontPkg); } diff --git a/lib/landing_page.dart b/lib/landing_page.dart index 4d949827..a997675a 100644 --- a/lib/landing_page.dart +++ b/lib/landing_page.dart @@ -42,15 +42,17 @@ class _LandingPageState extends State { return Scaffold( appBar: AppBar( elevation: 0, - backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: Text(getText(currentTab).toUpperCase()), + backgroundColor: Colors.grey[100], + //textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), + title: currentTab != 0 + ? Text(getText(currentTab).toUpperCase()) + : Text(''), leading: Builder( builder: (BuildContext context) { return IconButton( icon: Icon(DoctorApp.drawer_icon), iconSize: 15, - color: Colors.white, + color: Colors.black, onPressed: () => Scaffold.of(context).openDrawer(), ); }, @@ -66,9 +68,9 @@ class _LandingPageState extends State { ShowCaseWidget( builder: Builder(builder: (context) => DashboardScreen()), ), - DoctorReplyScreen(), MyScheduleScreen(), - QrReaderScreen() + QrReaderScreen(), + DoctorReplyScreen(), ], ), bottomNavigationBar: BottomNavBar(changeIndex: _changeCurrentTab), @@ -80,11 +82,11 @@ class _LandingPageState extends State { case 0: return TranslationBase.of(context).home; case 1: - return TranslationBase.of(context).replay; - case 2: return TranslationBase.of(context).mySchedule; - case 3: + case 2: return TranslationBase.of(context).qr; + case 3: + return TranslationBase.of(context).replay; } } } diff --git a/lib/main.dart b/lib/main.dart index 79994205..e3db2e49 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -14,7 +14,7 @@ import './routes.dart'; import 'config/config.dart'; import 'locator.dart'; -void main()async { +void main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp(); setupLocator(); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 9d8bdb2c..369f6a39 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -13,7 +13,10 @@ import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/doctor/patient_arrival_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -21,6 +24,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/dashboard/guage_chart.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -63,7 +67,7 @@ class _DashboardScreenState extends State { bool isExpanded = false; String isInpatient = ""; var clinicName = []; - + int sliderActiveIndex = 0; var clinicId; void didChangeDependencies() async { super.didChangeDependencies(); @@ -111,26 +115,6 @@ class _DashboardScreenState extends State { currentFocus.unfocus(); } - var _patientSearchFormValues = PatientModel( - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: 0, - From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') - .toString(), - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 1.2, - Channel: 9, - TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); return BaseView( onModelReady: (model) => model.getDashboard(), builder: (_, model, w) => AppScaffold( @@ -145,684 +129,743 @@ class _DashboardScreenState extends State { ProfileWelcomeWidget( Container( width: MediaQuery.of(context).size.width * .6, - // height: 100, - child: projectsProvider.doctorClinicsList.length > 0 - ? Stack( - children: [ - DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: Colors.white, - iconEnabledColor: Colors.white, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[0].clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext context) { - return projectsProvider.doctorClinicsList - .map((item) { - return Row( - mainAxisSize: MainAxisSize.max, - children: [ - AppText( - item.clinicName, - fontSize: - SizeConfig.textMultiplier * - 2.1, - color: Colors.white, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - items: projectsProvider.doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - Positioned( - right: projectsProvider.isArabic ? 35 : 0, - top: 0, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red[800], - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - projectsProvider - .doctorClinicsList.length - .toString(), - style: new TextStyle( - color: Colors.white, - fontSize: projectsProvider.isArabic - ? 10 - : 11, - ), - textAlign: TextAlign.center, - ), - ), - ) - ], - ) - : AppText(TranslationBase.of(context).noClinic), + // // height: 100, + // child: projectsProvider.doctorClinicsList.length > 0 + // ? Stack( + // children: [ + // DropdownButtonHideUnderline( + // child: DropdownButton( + // dropdownColor: Colors.white, + // iconEnabledColor: Colors.white, + // isExpanded: true, + // value: clinicId == null + // ? projectsProvider + // .doctorClinicsList[0].clinicID + // : clinicId, + // iconSize: 25, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext context) { + // return projectsProvider.doctorClinicsList + // .map((item) { + // return Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // AppText( + // item.clinicName, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors.white, + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: (newValue) { + // clinicId = newValue; + // changeClinic(newValue, context, model); + // }, + // items: projectsProvider.doctorClinicsList + // .map((item) { + // return DropdownMenuItem( + // child: Text( + // item.clinicName, + // textAlign: TextAlign.end, + // ), + // value: item.clinicID, + // ); + // }).toList(), + // )), + // Positioned( + // right: projectsProvider.isArabic ? 35 : 0, + // top: 0, + // child: new Container( + // padding: EdgeInsets.all(4), + // decoration: new BoxDecoration( + // color: Colors.red[800], + // borderRadius: BorderRadius.circular(20), + // ), + // constraints: BoxConstraints( + // minWidth: 20, + // minHeight: 20, + // ), + // child: new Text( + // projectsProvider + // .doctorClinicsList.length + // .toString(), + // style: new TextStyle( + // color: Colors.white, + // fontSize: projectsProvider.isArabic + // ? 10 + // : 11, + // ), + // textAlign: TextAlign.center, + // ), + // ), + // ) + // ], + // ) + // : AppText(TranslationBase.of(context).noClinic), ), ), - // InkWell( - // onTap: () async { - // showCupertinoPicker( - // decKey: '', - // context: context, - // actionList: projectsProvider.doctorClinicsList); - // }, - // child: Row( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // SizedBox( - // height: 4, - // ), - // InkWell( - // onTap: () async { - // // showCupertinoPicker( - // // decKey: '', - // // context: context, - // // actionList: projectsProvider - // // .doctorClinicsList); - // }, - // child: - // Container( - // alignment: projectsProvider.isArabic - // ? Alignment.topRight - // : Alignment.topLeft, - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - - // Container( - // child: AppText( - // authProvider.selectedClinicName != - // null - // ? authProvider - // .selectedClinicName - // : authProvider.doctorProfile - // .clinicDescription, - // fontSize: - // SizeConfig.textMultiplier * - // 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // alignment: projectsProvider.isArabic - // ? Alignment.topRight - // : Alignment.topLeft, - // ), - // Row( - // mainAxisAlignment: - // MainAxisAlignment.start, - // mainAxisSize: MainAxisSize.max, - // crossAxisAlignment: - // CrossAxisAlignment.start, - // children: [ - // InkWell( - // child: Container( - // margin: EdgeInsets.only( - // left: 5, - // top: projectsProvider - // .isArabic - // ? 0 - // : 5, - // right: 10, - // bottom: - // projectsProvider - // .isArabic - // ? 15 - // : 7), - // child: Icon( - // Icons.arrow_drop_down, - // color: Colors.white, - // size: SizeConfig - // .textMultiplier * - // 3, - // )), - // ), - // ], - //), - // ])), - // ), - // ], - // ), - //]), - // ), - // ), Container( - color: Colors.white, - height: MediaQuery.of(context).size.height * 0.23, + height: MediaQuery.of(context).size.height * 0.20, ), ], ), Positioned( - right: 9.0, - left: 9, - top: MediaQuery.of(context).size.height * .1, - child: Container( - height: MediaQuery.of(context).size.height * 0.28, - child: model.dashboardItemsList.length > 0 - ? new Swiper( - itemBuilder: (BuildContext context, int index) { - return getSwiperWidget(model)[index]; - }, - itemCount: 3, + right: 9.0, + left: 9, + top: MediaQuery.of(context).size.height * .05, + child: Container( + height: MediaQuery.of(context).size.height * 0.30, + child: model.dashboardItemsList.length > 0 + ? new Swiper( + onIndexChanged: (index) { + if (mounted) { + setState(() { + sliderActiveIndex = index; + }); + } + }, + itemBuilder: (BuildContext context, int index) { + return getSwiperWidget(model)[index]; + }, + itemCount: 3, - pagination: new SwiperCustomPagination(builder: - (BuildContext context, - SwiperPluginConfig config) { - return new Stack( - alignment: Alignment.bottomCenter, - children: [ - Positioned( - bottom: -5, - child: Center( - child: InkWell( - onTap: () {}, - child: Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 0 - ? Colors.black - : Colors.grey), - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 1 - ? Colors.black - : Colors.grey), - Container( - height: 10, - width: 50, - margin: - EdgeInsets.all( - 2), - color: config - .activeIndex == - 2 - ? Colors.black - : Colors.grey), - ], - ))))) - ]); - }), - viewportFraction: 0.9, - // scale: 0.9, - // control: new SwiperControl(), - ) - : SizedBox()) - //ExpandableCardContainer( - // expandedChild: Container( - // margin: EdgeInsets.only(left: 10, right: 10), - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.22 - // : MediaQuery.of(context).size.height * 0.25, - // width: double.infinity, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DashboardItem( - // onTap: () { - // setState(() { - // this.isExpanded = false; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Column( - // children: [ - // Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[0] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[0] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 24, - // ), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[0] - // .kPIParameter - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[0] - // .kPIParameter - // : "", - // //'My Admitted Patient', - // color: Colors.white, - // textAlign: TextAlign.center, - // fontSize: 12, - // ) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[1] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[1] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28, - // ), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[1] - // .kPIParameter - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[1] - // .kPIParameter - // : "", - // color: Colors.white, - // textAlign: TextAlign.center, - // fontSize: 12, - // ) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[2] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[2] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[2] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[2] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // )) - // ], - // ), - // Row( - // children: [ - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[3] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[3] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[3] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[3] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // )), - // Expanded( - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[ - // 4] - // .value - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[ - // 4] - // .value - // .toString() - // : "", - // fontWeight: FontWeight.bold, - // color: Colors.white, - // fontSize: 28), - // AppText( - // model.dashboardItemsList - // .length > - // 0 - // ? isInpatient == 'in' - // ? model - // .dashboardItemsList[ - // 0] - // .summaryoptions[ - // 4] - // .kPIParameter - // .toString() - // : model - // .dashboardItemsList[ - // 1] - // .summaryoptions[ - // 4] - // .kPIParameter - // .toString() - // : "", - // color: Colors.white, - // fontSize: 12, - // textAlign: TextAlign.center) - // ], - // ), - // ), - // Expanded( - // child: Container(), - // ) - // ], - // ) - // ], - // )), - // imageName: '5.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.9, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.22 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // ], - // ), - // ), - // collapsedChild: Container( - // margin: EdgeInsets.only(left: 10, right: 10), - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // width: double.infinity, - // child: Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DashboardItem( - // onTap: () { - // setState(() { - // this.isExpanded = true; - // this.isInpatient = 'in'; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[0]) - // : "", - // fontSize: - // SizeConfig.textMultiplier * 6, - // color: Colors.white, - // ), - // Flexible( - // child: AppText( - // TranslationBase.of(context).inPatient, - // color: Colors.white, - // textOverflow: TextOverflow.ellipsis, - // )), - // ], - // ), - // Padding( - // padding: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.end, - // children: [ - // Icon( - // DoctorApp.in_patient_white, - // size: 35, - // color: Colors.white, - // ) - // ], - // )) - // ], - // ), - // ), - // imageName: '4.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.44, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // DashboardItem( - // onTap: () { - // setState(() { - // isExpanded = true; - // this.isInpatient = 'out'; - // }); - // }, - // child: Padding( - // padding: const EdgeInsets.all(8.0), - // child: Row( - // mainAxisAlignment: - // MainAxisAlignment.spaceBetween, - // children: [ - // Column( - // mainAxisAlignment: - // MainAxisAlignment.start, - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[1]) - // : "", - // fontSize: - // SizeConfig.textMultiplier * 6, - // color: Colors.white, - // ), - // Flexible( - // child: AppText( - // TranslationBase.of(context) - // .outPatients, - // color: Colors.white, - // textOverflow: TextOverflow.ellipsis, - // )), - // ], - // ), - // Padding( - // padding: EdgeInsets.all(5), - // child: Column( - // mainAxisAlignment: - // MainAxisAlignment.end, - // children: [ - // Icon( - // DoctorApp.out_patient, - // size: 35, - // color: Colors.white, - // ) - // ], - // )) - // ], - // ), - // ), - // imageName: '5.png', - // color: HexColor('#B8382C'), - // hasBorder: false, - // width: MediaQuery.of(context).size.width * 0.44, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.15 - // : MediaQuery.of(context).size.height * 0.25, - // ), - // ], - // ), - // ), - // isExpanded: isExpanded, - // )) - ) + pagination: new SwiperCustomPagination(builder: + (BuildContext context, + SwiperPluginConfig config) { + return new Stack( + alignment: Alignment.bottomCenter, + children: [ + Positioned( + bottom: -5, + child: Center( + child: InkWell( + onTap: () {}, + child: Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 0 + ? Colors.black + : Colors + .grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 1 + ? Colors.black + : Colors + .grey), + Container( + height: 10, + width: 50, + margin: + EdgeInsets.all(2), + color: + config.activeIndex == + 2 + ? Colors.black + : Colors + .grey), + ], + ))))) + ]); + }), + viewportFraction: 0.9, + // scale: 0.9, + // control: new SwiperControl(), + ) + : SizedBox()), + + //ExpandableCardContainer( + // expandedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = false; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Column( + // children: [ + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 24, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[0] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[0] + // .kPIParameter + // : "", + // //'My Admitted Patient', + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28, + // ), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[1] + // .kPIParameter + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[1] + // .kPIParameter + // : "", + // color: Colors.white, + // textAlign: TextAlign.center, + // fontSize: 12, + // ) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[2] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )) + // ], + // ), + // Row( + // children: [ + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[3] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // )), + // Expanded( + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .value + // .toString() + // : "", + // fontWeight: FontWeight.bold, + // color: Colors.white, + // fontSize: 28), + // AppText( + // model.dashboardItemsList + // .length > + // 0 + // ? isInpatient == 'in' + // ? model + // .dashboardItemsList[ + // 0] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : model + // .dashboardItemsList[ + // 1] + // .summaryoptions[ + // 4] + // .kPIParameter + // .toString() + // : "", + // color: Colors.white, + // fontSize: 12, + // textAlign: TextAlign.center) + // ], + // ), + // ), + // Expanded( + // child: Container(), + // ) + // ], + // ) + // ], + // )), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.9, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.22 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // collapsedChild: Container( + // margin: EdgeInsets.only(left: 10, right: 10), + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // width: double.infinity, + // child: Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // onTap: () { + // setState(() { + // this.isExpanded = true; + // this.isInpatient = 'in'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[0]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context).inPatient, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.in_patient_white, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '4.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // DashboardItem( + // onTap: () { + // setState(() { + // isExpanded = true; + // this.isInpatient = 'out'; + // }); + // }, + // child: Padding( + // padding: const EdgeInsets.all(8.0), + // child: Row( + // mainAxisAlignment: + // MainAxisAlignment.spaceBetween, + // children: [ + // Column( + // mainAxisAlignment: + // MainAxisAlignment.start, + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[1]) + // : "", + // fontSize: + // SizeConfig.textMultiplier * 6, + // color: Colors.white, + // ), + // Flexible( + // child: AppText( + // TranslationBase.of(context) + // .outPatients, + // color: Colors.white, + // textOverflow: TextOverflow.ellipsis, + // )), + // ], + // ), + // Padding( + // padding: EdgeInsets.all(5), + // child: Column( + // mainAxisAlignment: + // MainAxisAlignment.end, + // children: [ + // Icon( + // DoctorApp.out_patient, + // size: 35, + // color: Colors.white, + // ) + // ], + // )) + // ], + // ), + // ), + // imageName: '5.png', + // color: HexColor('#B8382C'), + // hasBorder: false, + // width: MediaQuery.of(context).size.width * 0.44, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.15 + // : MediaQuery.of(context).size.height * 0.25, + // ), + // ], + // ), + // ), + // isExpanded: isExpanded, + // )) + ) ]), + model.dashboardItemsList.length > 0 + ? FractionallySizedBox( + widthFactor: 0.90, + child: Container( + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 15, + ), + sliderActiveIndex == 0 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[3].kPIName, + fontSize: + SizeConfig.textMultiplier * 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[3] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[3] + .summaryoptions[index]); + }))) + ], + ) + : sliderActiveIndex == 1 + ? Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[4] + .kPIName, + fontSize: + SizeConfig.textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: + Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[4] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[4] + .summaryoptions[index]); + }))) + ], + ) + : Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + model.dashboardItemsList[5] + .kPIName, + fontSize: + SizeConfig.textMultiplier * + 2.2, + fontWeight: FontWeight.bold, + ), + ], + ), + new Container( + height: MediaQuery.of(context) + .orientation == + Orientation.portrait + ? MediaQuery.of(context) + .size + .height * + 0.15 + : MediaQuery.of(context) + .size + .height * + 0.20, + child: new ListView( + scrollDirection: + Axis.horizontal, + children: new List.generate( + model + .dashboardItemsList[5] + .summaryoptions + .length, (int index) { + return getActivityButton(model + .dashboardItemsList[5] + .summaryoptions[index]); + }))) + ], + ), + ]))) + : SizedBox(), FractionallySizedBox( - widthFactor: 0.90, + // widthFactor: 0.90, child: Container( - color: Colors.white, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.only( + topRight: Radius.circular(50), + )), + padding: EdgeInsets.all(15), + margin: EdgeInsets.only(top: 15), child: Column( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -831,10 +874,23 @@ class _DashboardScreenState extends State { ), Row( children: [ - AppText( - TranslationBase.of(context).patientServices, - fontSize: SizeConfig.textMultiplier * 3, - ), + Container( + width: 150, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).services, + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + )), ], ), SizedBox( @@ -845,81 +901,112 @@ class _DashboardScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ DashboardItem( + color: Colors.red[800], child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.referred, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).myReferredPatient, - color: Colors.black, - textAlign: TextAlign.center, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.referral_1, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .patientsreferral, + color: Colors.white, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { Navigator.push( context, MaterialPageRoute( - builder: (context) => ReferredPatientScreen(), + builder: (context) => PatientReferralScreen(), // MyReferredPatient(), ), ); }, ), DashboardItem( + color: Colors.grey[300], child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.referral, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).myReferralPatient, - textAlign: TextAlign.center, - color: Colors.black, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.arrival_patients, + size: 35, + color: Colors.black, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .arrivalpatient, + color: Colors.black, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MyReferralPatientScreen(), - ), - ); + context, + MaterialPageRoute( + builder: (context) => + PatientArrivalScreen(), + )); }, ), DashboardItem( + color: Colors.black, child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Icon( - DoctorApp.patient, - size: 50, - ), - AppText( - TranslationBase.of(context).arrived, - color: Colors.black, - textAlign: TextAlign.center, - ) + Padding( + padding: EdgeInsets.only( + top: 10, left: 10, right: 0), + child: Icon( + DoctorApp.search, + size: 35, + color: Colors.white, + )), + Container( + padding: EdgeInsets.all(10), + child: AppText( + TranslationBase.of(context) + .searchmedicinepatient, + color: Colors.white, + textAlign: TextAlign.start, + )) ], ), - hasBorder: true, + hasBorder: false, onTap: () { - Navigator.of(context) - .pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": "7" - }); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + SearchMedicinePatientScreen(), + )); + + // Navigator.of(context) + // .pushNamed(PATIENTS, arguments: { + // "patientSearchForm": _patientSearchFormValues, + // "selectedType": "7" + // }); }, ) ], @@ -927,95 +1014,95 @@ class _DashboardScreenState extends State { SizedBox( height: 10, ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Center( - child: Icon( - DoctorApp.search_patient_1, - size: 50, - color: Colors.black, - ), - ), - Column( - children: [ - AppText( - TranslationBase.of(context).searchAbout, - color: Colors.black, - textAlign: TextAlign.center, - ), - AppText( - TranslationBase.of(context).patient, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.of(context).pushNamed(PATIENT_SEARCH); - }, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.medicine_search, - size: 50, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).searchMedicine, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => MedicineSearchScreen(), - ), - ); - }, - ), - DashboardItem( - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Icon( - DoctorApp.leaves, - size: 50, - ), - AppText( - TranslationBase.of(context).rescheduleLeaves, - color: Colors.black, - textAlign: TextAlign.center, - ) - ], - ), - hasBorder: true, - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - AddRescheduleLeavScreen(), - // MyReferredPatient(), - ), - ); - }, - ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Center( + // child: Icon( + // DoctorApp.search_patient_1, + // size: 50, + // color: Colors.black, + // ), + // ), + // Column( + // children: [ + // AppText( + // TranslationBase.of(context).searchAbout, + // color: Colors.black, + // textAlign: TextAlign.center, + // ), + // AppText( + // TranslationBase.of(context).patient, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.of(context).pushNamed(PATIENT_SEARCH); + // }, + // ), + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.medicine_search, + // size: 50, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).searchMedicine, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // // Navigator.push( + // // context, + // // MaterialPageRoute( + // // builder: (context) => MedicineSearchScreen(), + // // ), + // // ); + // }, + // ), + // DashboardItem( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Icon( + // DoctorApp.leaves, + // size: 50, + // ), + // AppText( + // TranslationBase.of(context).rescheduleLeaves, + // color: Colors.black, + // textAlign: TextAlign.center, + // ) + // ], + // ), + // hasBorder: true, + // onTap: () { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => + // AddRescheduleLeavScreen(), + // // MyReferredPatient(), + // ), + // ); + // }, + // ), // DashboardItem( // child: Column( // mainAxisAlignment: MainAxisAlignment.spaceAround, @@ -1051,8 +1138,8 @@ class _DashboardScreenState extends State { // Navigator.of(context).pushNamed(QR_READER); // }, // ), - ], - ), + //], + //), SizedBox( height: 20, ), @@ -1114,68 +1201,55 @@ class _DashboardScreenState extends State { ); } - static List> _createInpatientData(model) { - final data = [ - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[0].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[0].value), - charts.MaterialPalette.blue.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[1].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[1].value), - charts.MaterialPalette.cyan.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[2].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[2].value), - charts.MaterialPalette.red.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[3].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[3].value), - charts.MaterialPalette.deepOrange.shadeDefault.lighter), - new GaugeSegment( - model.dashboardItemsList[0].summaryoptions[4].kPIParameter, - getValue(model.dashboardItemsList[0].summaryoptions[4].value), - charts.MaterialPalette.green.shadeDefault), - ]; + // static List> _createInpatientData(model) { + // final data = [ + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[0].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[0].value), + // charts.MaterialPalette.blue.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[1].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[1].value), + // charts.MaterialPalette.cyan.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[2].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[2].value), + // charts.MaterialPalette.red.shadeDefault), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[3].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[3].value), + // charts.MaterialPalette.deepOrange.shadeDefault.lighter), + // new GaugeSegment( + // model.dashboardItemsList[0].summaryoptions[4].kPIParameter, + // getValue(model.dashboardItemsList[0].summaryoptions[4].value), + // charts.MaterialPalette.green.shadeDefault), + // ]; - return [ - new charts.Series( - id: 'Segments', - domainFn: (GaugeSegment segment, _) => segment.segment, - measureFn: (GaugeSegment segment, _) => segment.size, - data: data, - colorFn: (GaugeSegment segment, _) => segment.color, - ) - ]; - } + // return [ + // new charts.Series( + // id: 'Segments', + // domainFn: (GaugeSegment segment, _) => segment.segment, + // measureFn: (GaugeSegment segment, _) => segment.size, + // data: data, + // colorFn: (GaugeSegment segment, _) => segment.color, + // ) + // ]; + // } - static List> _createOutPatientData( - model) { + static List> _createReferralData(model) { final data = [ new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[0].kPIParameter, + model.dashboardItemsList[2].summaryoptions[0].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[0].value), - charts.MaterialPalette.blue.shadeDefault), + charts.MaterialPalette.black), new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[1].kPIParameter, + model.dashboardItemsList[2].summaryoptions[1].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[1].value), - charts.MaterialPalette.cyan.shadeDefault), + charts.MaterialPalette.gray.shadeDefault), new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[2].kPIParameter, + model.dashboardItemsList[2].summaryoptions[2].kPIParameter, getValue(model.dashboardItemsList[1].summaryoptions[2].value), charts.MaterialPalette.red.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[3].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[3].value), - charts.MaterialPalette.deepOrange.shadeDefault), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[4].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[4].value), - charts.MaterialPalette.green.shadeDefault.lighter), - new GaugeSegment( - model.dashboardItemsList[1].summaryoptions[5].kPIParameter, - getValue(model.dashboardItemsList[1].summaryoptions[5].value), - charts.MaterialPalette.purple.shadeDefault.lighter) ]; return [ @@ -1295,6 +1369,39 @@ class _DashboardScreenState extends State { return value.toString(); } + Widget getActivityButton(value) { + return Container( + width: MediaQuery.of(context).size.width * 0.24, + padding: EdgeInsets.all(5), + margin: EdgeInsets.all(5), + height: MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.15 + : MediaQuery.of(context).size.height * 0.20, + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: AppText(value.value.toString(), + fontSize: 28, fontWeight: FontWeight.bold)), + Expanded( + child: AppText( + value.kPIParameter, + textOverflow: TextOverflow.clip, + fontSize: 12, + textAlign: TextAlign.center, + ), + ), + ], + ), + ); + } + Widget dot(Color c) { return Container( padding: EdgeInsets.all(5.0), @@ -1306,111 +1413,177 @@ class _DashboardScreenState extends State { return Row( children: [ dot(c), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - name, - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 10, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - ' (' + count.toString() + ')', - color: Colors.black, - textAlign: TextAlign.center, - fontSize: 14, - fontWeight: FontWeight.bold, - ) - ], + Padding( + padding: EdgeInsets.only(top: 5, bottom: 5), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + name, + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 12, + textOverflow: TextOverflow.ellipsis, + ), + AppText( + ' (' + count.toString() + ')', + color: Colors.black, + textAlign: TextAlign.center, + fontSize: 14, + fontWeight: FontWeight.bold, + ) + ], + )), + ], + ); + } + + Widget getOutPatientStack(value) { + value.summaryoptions + .sort((Summaryoptions a, Summaryoptions b) => b.value - a.value); + + var list = new List(); + value.summaryoptions.forEach((result) => + {list.add(getStack(result, value.summaryoptions.first.value))}); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + Texts( + value.kPIName, + medium: true, ), + Row(mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: list) ], ); } + getStack(Summaryoptions value, max) { + return Stack(children: [ + Container( + height: 150, + margin: EdgeInsets.all(5), + width: ((SizeConfig.screenWidth * .55) / 5), + child: SizedBox(), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), color: Colors.red[50]), + ), + Positioned( + bottom: 0, + child: Container( + child: SizedBox(), + margin: EdgeInsets.all(5), + padding: EdgeInsets.all(10), + height: max != 0 ? (150 * value.value) / max : 0, + width: ((SizeConfig.screenWidth * .55) / 5), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.red[300]))), + Container( + height: 150, + margin: EdgeInsets.only(left: 10, top: 5), + padding: EdgeInsets.all(8), + child: RotatedBox( + quarterTurns: 1, + child: Center( + child: Align( + child: AppText( + value.kPIParameter + ' (' + value.value.toString() + ') ', + fontSize: 11, + textAlign: TextAlign.center, + fontWeight: FontWeight.bold, + )), + ), + )) + ]); + } + List getSwiperWidget(model) { return [ RoundedContainer( - height: MediaQuery.of(context).size.height * 0.30, + height: MediaQuery.of(context).size.height * 0.32, margin: 5, - child: Column(children: [ - Expanded( - flex: 5, - child: Row( - children: [ - Expanded( - flex: 4, - child: Padding( - padding: const EdgeInsets.all(5.0), - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - rowCount( - model.dashboardItemsList[0] - .summaryoptions[0].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[0].value, - Colors.blue), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[1].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[1].value, - Colors.cyan), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[2].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[2].value, - Colors.red), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[3].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[3].value, - Colors.orange), - rowCount( - model.dashboardItemsList[0] - .summaryoptions[4].kPIParameter, - model.dashboardItemsList[0] - .summaryoptions[4].value, - Colors.green), - ], - ))), - Expanded( - flex: 3, - child: Stack(children: [ - Container( - child: GaugeChart(_createInpatientData(model))), - Positioned( - child: Center( - child: Column( - children: [ - AppText( - TranslationBase.of(context).inPatient, - fontSize: 11, - fontWeight: FontWeight.bold, - ), - AppText( - getPatientCount(model.dashboardItemsList[0]) - .toString(), - fontSize: 18, - fontWeight: FontWeight.bold, - ) - ], - )), - top: MediaQuery.of(context).size.height * 0.12, - left: MediaQuery.of(context).size.width * 0.11) - ])), - ], - )), - ])), + child: Padding( + padding: const EdgeInsets.all(5.0), + child: getOutPatientStack(model.dashboardItemsList[0]))), + RoundedContainer( + height: MediaQuery.of(context).size.height * 0.32, + margin: 5, + child: Padding( + padding: const EdgeInsets.all(5.0), + child: getOutPatientStack(model.dashboardItemsList[1]))), + // Column( + // mainAxisAlignment: MainAxisAlignment.spaceEvenly, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[0].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[0].value, + // Colors.blue), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[1].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[1].value, + // Colors.cyan), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[2].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[2].value, + // Colors.red), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[3].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[3].value, + // Colors.orange), + // rowCount( + // model.dashboardItemsList[0] + // .summaryoptions[4].kPIParameter, + // model.dashboardItemsList[0] + // .summaryoptions[4].value, + // Colors.green), + // ], + // ))), + // Expanded( + // flex: 3, + // child: Stack(children: [ + // Container( + // child: GaugeChart(_createInpatientData(model))), + // Positioned( + // child: Center( + // child: Column( + // children: [ + // AppText( + // TranslationBase.of(context).inPatient, + // fontSize: 11, + // fontWeight: FontWeight.bold, + // ), + // AppText( + // getPatientCount(model.dashboardItemsList[0]) + // .toString(), + // fontSize: 18, + // fontWeight: FontWeight.bold, + // ) + // ], + // )), + // top: MediaQuery.of(context).size.height * 0.12, + // left: MediaQuery.of(context).size.width * 0.11) + // ])), + // ], + // ) + + // ), + //]) + //), RoundedContainer( height: MediaQuery.of(context).size.height * 0.24, margin: 5, - child: Column(children: [ + child: + Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( flex: 1, child: Row( @@ -1420,224 +1593,239 @@ class _DashboardScreenState extends State { child: Padding( padding: const EdgeInsets.all(5.0), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start, children: [ - rowCount( - model.dashboardItemsList[1] - .summaryoptions[0].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[0].value, - Colors.blue), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[1].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[1].value, - Colors.cyan), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[2].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[2].value, - Colors.red), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[3].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[3].value, - Colors.orange), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[4].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[4].value, - Colors.green), - rowCount( - model.dashboardItemsList[1] - .summaryoptions[5].kPIParameter, - model.dashboardItemsList[1] - .summaryoptions[5].value, - Colors.purple) + Expanded( + flex: 1, + child: Padding( + child: AppText( + TranslationBase.of(context).referral, + fontSize: 20, + fontWeight: FontWeight.bold, + ), + padding: EdgeInsets.all(10))), + Expanded( + flex: 2, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + rowCount( + model.dashboardItemsList[2] + .summaryoptions[0].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[0].value, + Colors.black), + rowCount( + model.dashboardItemsList[2] + .summaryoptions[1].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[1].value, + Colors.grey), + rowCount( + model.dashboardItemsList[2] + .summaryoptions[2].kPIParameter, + model.dashboardItemsList[2] + .summaryoptions[2].value, + Colors.red), + // rowCount( + // model.dashboardItemsList[2] + // .summaryoptions[3].kPIParameter, + // model.dashboardItemsList[2] + // .summaryoptions[3].value, + // Colors.orange), + // rowCount( + // model.dashboardItemsList[2] + // .summaryoptions[4].kPIParameter, + // model.dashboardItemsList[2] + // .summaryoptions[4].value, + // Colors.green), + ], + ), + ) ], ))), Expanded( flex: 3, child: Stack(children: [ Container( - child: GaugeChart(_createOutPatientData(model))), + child: GaugeChart(_createReferralData(model))), Positioned( child: Column( + crossAxisAlignment: CrossAxisAlignment.center, children: [ + // AppText( + // TranslationBase.of(context)., + // fontSize: 11, + // fontWeight: FontWeight.bold, + // textOverflow: TextOverflow.ellipsis, + // ), AppText( - TranslationBase.of(context).outPatient, - fontSize: 11, - fontWeight: FontWeight.bold, - textOverflow: TextOverflow.ellipsis, - ), - AppText( - getPatientCount(model.dashboardItemsList[1]) + getPatientCount(model.dashboardItemsList[2]) .toString(), - fontSize: 18, + fontSize: 30, fontWeight: FontWeight.bold, ) ], ), top: MediaQuery.of(context).size.height * 0.12, - left: MediaQuery.of(context).size.width * 0.10) + left: 0, + right: 0) ]), ), ], )), ])), - RoundedContainer( - height: MediaQuery.of(context).size.height * 0.24, - margin: 5, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: EdgeInsets.all(10), - child: AppText(TranslationBase.of(context).otherStatistic)), - Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.lab_results, - size: 40, - color: Colors.black, - ), - ), - Container( - // margin: EdgeInsets.only(bottom: 10), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[5]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).targetPatient, - textAlign: TextAlign.center, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '1.png', - opacity: 0, - ), - Container( - color: Colors.black12, - height: MediaQuery.of(context).size.height * 0.18, - width: 1, - ), - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.radiology, - size: 40, - color: Colors.black, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 5), - child: Column( - children: [ - AppText( - clinicName.length.toString(), - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).clinic, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '2.png', - opacity: 0, - ), - Container( - color: Colors.black12, - height: MediaQuery.of(context).size.height * 0.18, - width: 1, - ), - DashboardItem( - width: MediaQuery.of(context).size.width * 0.25, - height: MediaQuery.of(context).orientation == - Orientation.portrait - ? MediaQuery.of(context).size.height * 0.18 - : MediaQuery.of(context).size.height * 0.36, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Container( - margin: EdgeInsets.only(top: 5), - child: Icon( - DoctorApp.referral, - size: 40, - color: Colors.black, - ), - ), - Container( - margin: EdgeInsets.only(bottom: 5), - child: Column( - children: [ - AppText( - model.dashboardItemsList.length > 0 - ? getPatientCount( - model.dashboardItemsList[2]) - : "", - fontSize: SizeConfig.textMultiplier * 6, - color: Colors.black, - ), - AppText( - TranslationBase.of(context).referral, - color: Colors.black, - ) - ], - ), - ), - ], - ), - //imageName: '3.png', - opacity: 0, - ), - ], - ) - ], - )) + // RoundedContainer( + // height: MediaQuery.of(context).size.height * 0.24, + // margin: 5, + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Padding( + // padding: EdgeInsets.all(10), + // child: AppText(TranslationBase.of(context).otherStatistic)), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // crossAxisAlignment: CrossAxisAlignment.center, + // children: [ + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.lab_results, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // // margin: EdgeInsets.only(bottom: 10), + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[5]) + // : "", + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).targetPatient, + // textAlign: TextAlign.center, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '1.png', + // opacity: 0, + // ), + // Container( + // color: Colors.black12, + // height: MediaQuery.of(context).size.height * 0.18, + // width: 1, + // ), + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.radiology, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // margin: EdgeInsets.only(bottom: 5), + // child: Column( + // children: [ + // AppText( + // clinicName.length.toString(), + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).clinic, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '2.png', + // opacity: 0, + // ), + // Container( + // color: Colors.black12, + // height: MediaQuery.of(context).size.height * 0.18, + // width: 1, + // ), + // DashboardItem( + // width: MediaQuery.of(context).size.width * 0.25, + // height: MediaQuery.of(context).orientation == + // Orientation.portrait + // ? MediaQuery.of(context).size.height * 0.18 + // : MediaQuery.of(context).size.height * 0.36, + // child: Column( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + // children: [ + // Container( + // margin: EdgeInsets.only(top: 5), + // child: Icon( + // DoctorApp.referral, + // size: 40, + // color: Colors.black, + // ), + // ), + // Container( + // margin: EdgeInsets.only(bottom: 5), + // child: Column( + // children: [ + // AppText( + // model.dashboardItemsList.length > 0 + // ? getPatientCount( + // model.dashboardItemsList[2]) + // : "", + // fontSize: SizeConfig.textMultiplier * 6, + // color: Colors.black, + // ), + // AppText( + // TranslationBase.of(context).referral, + // color: Colors.black, + // ) + // ], + // ), + // ), + // ], + // ), + // //imageName: '3.png', + // opacity: 0, + // ), + // ], + // ) + // ], + // )) ]; } } @@ -1673,7 +1861,7 @@ class DashboardItem extends StatelessWidget { height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.20 + ? MediaQuery.of(context).size.height * 0.16 : MediaQuery.of(context).size.height * 0.36, decoration: BoxDecoration( color: !hasBorder @@ -1681,7 +1869,7 @@ class DashboardItem extends StatelessWidget { ? color : HexColor('#050705').withOpacity(opacity) : Colors.white, - borderRadius: BorderRadius.circular(6.0), + borderRadius: BorderRadius.circular(15.0), border: hasBorder ? Border.all(width: 1.0, color: const Color(0xffcccccc)) : Border.all(width: 0.0, color: Colors.transparent), diff --git a/lib/screens/doctor/my_referred_patient_screen.dart b/lib/screens/doctor/my_referred_patient_screen.dart index cd9112e2..86e5de53 100644 --- a/lib/screens/doctor/my_referred_patient_screen.dart +++ b/lib/screens/doctor/my_referred_patient_screen.dart @@ -8,41 +8,39 @@ import 'package:flutter/material.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; class MyReferredPatient extends StatelessWidget { - @override Widget build(BuildContext context) { return BaseView( onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, - appBarTitle: TranslationBase.of(context).myReferredPatient, - body: model.listMyReferredPatientModel.length == 0 - ? Center( - child: AppText( - TranslationBase.of(context).errorNoSchedule, - color: Theme.of(context).errorColor, - ), - ) - : Container( - padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), - child: ListView( - children: [ - Column( + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).myReferredPatient, + body: model.listMyReferredPatientModel.length == 0 + ? Center( + child: AppText( + TranslationBase.of(context).errorNoSchedule, + color: Theme.of(context).errorColor, + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(20, 0, 20, 0), + child: ListView( + children: [ + Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( - height: 10, + height: 100, ), Container( child: Column( //children: referredPatientProvider.listMyReferralPatientModel.map((item) { - children: model - .listMyReferredPatientModel + children: model.listMyReferredPatientModel .map((item) { return MyReferredPatientWidget( - myReferredPatientModel: item, - model:model - ); + myReferredPatientModel: item, + model: model); }).toList(), ), ), @@ -51,6 +49,6 @@ class MyReferredPatient extends StatelessWidget { ], ), ), - )); + )); } } diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart new file mode 100644 index 00000000..367f1728 --- /dev/null +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -0,0 +1,130 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientArrivalScreen extends StatefulWidget { + @override + _PatientArrivalScreen createState() => _PatientArrivalScreen(); +} + +class _PatientArrivalScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).arrivalpatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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).arrivalpatient), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).rescheduleLeaves), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientsScreen( + patientSearchForm: _patientSearchFormValues, + selectedType: "7", + isAppbar: false, + ), + AddRescheduleLeavScreen(), + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index f08f52cb..187d1b9a 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -88,8 +88,8 @@ class _MedicineSearchState extends State { }); } - InputDecoration textFieldSelectorDecoration(String hintText, - String selectedText, bool isDropDown, + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, {IconData icon}) { return InputDecoration( focusedBorder: OutlineInputBorder( @@ -117,159 +117,154 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if(model.allMedicationList.length == 0) - await model.getMedicationList(); + if (model.allMedicationList.length == 0) + await model.getMedicationList(); }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .searchMedicine, - body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Column( + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).searchMedicine, + body: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: 0.97, + child: SingleChildScrollView( + child: Column( + children: [ + SizedBox( + height: 50, + ), + Column( children: [ - 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, - ), - ), - Padding( - padding: const EdgeInsets.only(top: 5.0), - child: AppText( - TranslationBase.of(context).searchMedicineImageCaption, - fontSize: SizeConfig.heightMultiplier * 2, - ), - ) - ], + Container( + child: Icon( + DoctorApp.medicine_search, + size: 100, + color: Colors.black, + ), + margin: EdgeInsets.only(top: 50), ), - SizedBox( - height: 15, + Padding( + padding: const EdgeInsets.only(top: 12.0), + child: AppText( + TranslationBase.of(context).type.toUpperCase(), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.heightMultiplier * 2.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< + Padding( + padding: const EdgeInsets.only(top: 5.0), + child: AppText( + TranslationBase.of(context) + .searchMedicineImageCaption, + fontSize: SizeConfig.heightMultiplier * 2, + ), + ) + ], + ), + SizedBox( + height: 15, + ), + 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); - }, + 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); + }, ), - ), - ], + ], + ), ), - ), - ], + ], + ), ), - ), + ], ), - ),),); + ), + ), + ), + ), + ); } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (_selectedMedication.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase - .of(context) - .typeMedicineName); + helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); //"Type Medicine Name") return; - } else - if (_selectedMedication.description.length < 3) { - helpers.showErrorToast(TranslationBase - .of(context) - .moreThan3Letter); + } else if (_selectedMedication.description.length < 3) { + helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); return; } @@ -277,16 +272,14 @@ class _MedicineSearchState extends State { Navigator.push( context, MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID:_selectedMedication.itemId, - selectedMedication: _selectedMedication, - ), + builder: (context) => PharmaciesListScreen( + itemID: _selectedMedication.itemId, + selectedMedication: _selectedMedication, + ), ), ); // await model.getMedicineItem(_selectedMedication.description); // GifLoaderDialogUtils.hideDialog(context); - } startVoiceSearch() { diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart new file mode 100644 index 00000000..39c0deae --- /dev/null +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -0,0 +1,109 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SearchMedicinePatientScreen extends StatefulWidget { + @override + _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); +} + +class _SearchMedicinePatientScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).searchmedicinepatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).searchMedicine), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientSearchScreen(), + MedicineSearchScreen() + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 34e68779..6e43657b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -44,7 +44,7 @@ class _PatientSearchScreenState extends State { bool _autoValidate = false; bool onlyArrived = true; - bool isFormSubmitted = false; + bool isFormSubmitted = false; FocusNode _nodeText1 = FocusNode(); FocusNode _nodeText2 = FocusNode(); @@ -70,23 +70,24 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { - setState(() { - isFormSubmitted = true; - }); + setState(() { + isFormSubmitted = true; + }); try { if (_formKey.currentState.validate()) { _formKey.currentState.save(); if ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "7" || ((_patientSearchFormValues.From == "0" || - _patientSearchFormValues.To == "0") && - _selectedType == "6") ) { + _patientSearchFormValues.To == "0") && + _selectedType == "7" || + ((_patientSearchFormValues.From == "0" || + _patientSearchFormValues.To == "0") && + _selectedType == "6")) { // helpers.showErrorToast("Please Choose The Dates"); } else { setState(() { - isFormSubmitted = false; + isFormSubmitted = false; }); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, @@ -115,11 +116,12 @@ class _PatientSearchScreenState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: AppScaffold( appBarTitle: TranslationBase.of(context).searchPatient, + isShowAppBar: false, body: ListView( children: [ RoundedContainer( @@ -261,14 +263,15 @@ class _PatientSearchScreenState extends State { borderColor: Colors.white, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues.setFirstName = - "0" - : _patientSearchFormValues.setFirstName = - value; + ? _patientSearchFormValues + .setFirstName = "0" + : _patientSearchFormValues + .setFirstName = value; if (value != null && value.toString().trim().isEmpty) { - _patientSearchFormValues.setFirstName = "0"; + _patientSearchFormValues.setFirstName = + "0"; } }, // validator: (value) { @@ -292,16 +295,14 @@ class _PatientSearchScreenState extends State { borderColor: Colors.white, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues.setMiddleName = - "0" - : _patientSearchFormValues.setMiddleName = - value; - if (value != null && value - .toString() - .trim() - .isEmpty) { + ? _patientSearchFormValues + .setMiddleName = "0" + : _patientSearchFormValues + .setMiddleName = value; + if (value != null && + value.toString().trim().isEmpty) { _patientSearchFormValues.setMiddleName = - "0"; + "0"; } }, // validator: (value) { @@ -320,7 +321,8 @@ class _PatientSearchScreenState extends State { width: 1.0, color: HexColor("#CCCCCC"))), padding: EdgeInsets.only(top: 5), child: AppTextFormField( - labelText: TranslationBase.of(context).lastName, + labelText: + TranslationBase.of(context).lastName, borderColor: Colors.white, onSaved: (value) { value == null || value == '' @@ -328,11 +330,10 @@ class _PatientSearchScreenState extends State { "0" : _patientSearchFormValues.setLastName = value; - if (value != null && value - .toString() - .trim() - .isEmpty) { - _patientSearchFormValues.setLastName = "0"; + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues.setLastName = + "0"; } }, inputFormatter: ONLY_LETTERS), @@ -340,39 +341,38 @@ class _PatientSearchScreenState extends State { 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 (_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"; - } - }, + if (value != null && + value.toString().trim().isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } + }, + ), ), - ), SizedBox( height: 10, ), @@ -391,15 +391,13 @@ class _PatientSearchScreenState extends State { 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) { + value == null || value == '' + ? _patientSearchFormValues + .setPatientID = 0 + : _patientSearchFormValues + .setPatientID = int.parse(value); + if (value != null && + value.trim().toString().isEmpty) { _patientSearchFormValues.setPatientID = 0; } }), @@ -425,7 +423,8 @@ class _PatientSearchScreenState extends State { ), ), (!(_selectedType == '2' || _selectedType == '4')) - ? DynamicElements(_patientSearchFormValues, isFormSubmitted) + ? DynamicElements( + _patientSearchFormValues, isFormSubmitted) : SizedBox( height: 0, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 733a1b9c..8244cea2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -22,6 +22,11 @@ import '../../config/size_config.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; class PatientsScreen extends StatefulWidget { + final patientSearchForm; + final selectedType; + final isAppbar; + PatientsScreen( + {this.patientSearchForm, this.selectedType, this.isAppbar = true}); @override _PatientsScreenState createState() => _PatientsScreenState(); } @@ -59,7 +64,6 @@ class _PatientsScreenState extends State { PatientModel patient; - searchData(String str) { this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; @@ -132,7 +136,6 @@ class _PatientsScreenState extends State { return newDate.toString(); } - filterBooking(String str) { this.responseModelList = this.responseModelList2; @@ -197,9 +200,13 @@ class _PatientsScreenState extends State { projectsProvider = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; - patient = routeArgs['patientSearchForm']; + patient = widget.patientSearchForm != null + ? widget.patientSearchForm + : routeArgs['patientSearchForm']; - patientType = routeArgs['selectedType']; + patientType = widget.selectedType != null + ? widget.selectedType + : routeArgs['selectedType']; if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -213,7 +220,11 @@ class _PatientsScreenState extends State { GetPatientArrivalListRequestModel getPatientArrivalListRequestModel; if (val2 == 7) { getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, to: patient.To, pageIndex: 0, pageSize: 0,patientMRN: patient.getPatientID); + from: patient.From, + to: patient.To, + pageIndex: 0, + pageSize: 0, + patientMRN: patient.getPatientID); } model @@ -224,8 +235,6 @@ class _PatientsScreenState extends State { patientType) .then((res) { setState(() { - - if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { if (res[SERVICES_PATIANT2[val2]] == null) { @@ -234,7 +243,7 @@ class _PatientsScreenState extends State { this.error = error.toString(); } else { var localList = []; - if(res["patientArrivalList"]["entityList"] == null){ + if (res["patientArrivalList"]["entityList"] == null) { res["patientArrivalList"]["entityList"] = []; } res["patientArrivalList"]["entityList"].forEach((v) { @@ -253,10 +262,11 @@ class _PatientsScreenState extends State { responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList2 = responseModelList; _isError = false; - } else { _isError = true; - error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage']; + error = model.error ?? + res['ErrorEndUserMessage'] ?? + res['ErrorMessage']; } _isLoading = false; @@ -271,6 +281,7 @@ class _PatientsScreenState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: patientTypeTitle, + isShowAppBar: widget.isAppbar, isLoading: _isLoading, body: _isLoading ? Container() @@ -351,19 +362,24 @@ class _PatientsScreenState extends State { children: responseModelList .map((PatiantInformtion item) { - return PatientCard(patientInfo: item, + return PatientCard( + patientInfo: item, patientType: patientType, onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType":patientType, - "from" : patient.getFrom, - "to" : patient.getTo, - }); - },); + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType": + patientType, + "from": patient + .getFrom, + "to": + patient.getTo, + }); + }, + ); }).toList(), ) : Center( @@ -429,8 +445,7 @@ class _PatientsScreenState extends State { topRight: Radius.circular(12.5), topLeft: Radius.circular(9.5), bottomLeft: Radius.circular(9.5)), - color: - _isActive ? HexColor("#B8382B") : Colors.white, + color: _isActive ? HexColor("#B8382B") : Colors.white, ), child: Center( child: Text( @@ -470,9 +485,4 @@ class _PatientsScreenState extends State { ), ); } - - } - - - diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 5e749011..87a2aec4 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -22,6 +22,7 @@ class MyReferralPatientScreen extends StatelessWidget { onModelReady: (model) => model.getPendingReferralPatients(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -35,6 +36,7 @@ class MyReferralPatientScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + SizedBox(height: 100), ProfileWelcomeWidget( AppText( authProvider.selectedClinicName != null diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart new file mode 100644 index 00000000..f4b04d02 --- /dev/null +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -0,0 +1,101 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientReferralScreen extends StatefulWidget { + @override + _PatientReferralScreen createState() => _PatientReferralScreen(); +} + +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).patientsreferral, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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).myReferral), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + MyReferralPatientScreen(), + MyReferredPatient(), + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index c3cbe19c..bb4e23ae 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -28,11 +28,13 @@ class AddRescheduleLeavScreen extends StatelessWidget { {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: model.getReschduleLeave.length > 0 ? SingleChildScrollView( child: Column( children: [ + SizedBox(height: 50), Container( margin: EdgeInsets.only(left: 15, right: 15, top: 20), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 789d2d0a..43fae7a6 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1126,6 +1126,13 @@ class TranslationBase { String get otherStatistic => localizedValues['otherStatistic'][locale.languageCode]; + + String get patientsreferral => + localizedValues['ptientsreferral'][locale.languageCode]; + String get arrivalpatient => + localizedValues['arrivalpatient'][locale.languageCode]; + String get searchmedicinepatient => + localizedValues['searchmedicinepatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index fe5a9c9b..f2baac67 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -18,65 +18,70 @@ class ProfileWelcomeWidget extends StatelessWidget { return Container( height: height, - color: HexColor('#515B5D'), + // color: HexColor('#515B5D'), width: double.infinity, child: FractionallySizedBox( widthFactor: 0.9, child: Row( + mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).welcome, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - ) - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).dr + - ' ${authProvider.doctorProfile.doctorName}', - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.white, - ) - ], - ), - SizedBox( - height: 4, - ), - clinicWidget, - ], + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).welcome, + // fontSize: SizeConfig.textMultiplier * 1.7, + // color: Colors.black, + // ) + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + AppText( + // TranslationBase.of(context).dr + + ' ${authProvider.doctorProfile.doctorName}', + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2.5, + color: Colors.black, ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - CircleAvatar( - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Image.network( - authProvider.doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 70, - height: 60, - ), - ), - backgroundColor: Colors.transparent, - ) - ], - ), + SizedBox( + width: 20, ), + CircleAvatar( + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Image.network( + authProvider.doctorProfile.doctorImageURL, + fit: BoxFit.fill, + width: 75, + height: 75, + ), + ), + backgroundColor: Colors.transparent, + ) + // ], + // ), + // SizedBox( + // height: 4, + // ), + // clinicWidget, + /// ], + // ), + // Expanded( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ + + // ], + // ), + // ), ], ), ), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index e337b72d..378094c7 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -14,7 +14,7 @@ import 'network_base_view.dart'; class AppScaffold extends StatelessWidget { final String appBarTitle; final Widget body; - final bool isLoading; + final bool isLoading; final bool isShowAppBar; final BaseViewModel baseViewModel; @@ -30,45 +30,45 @@ class AppScaffold extends StatelessWidget { AppGlobal.CONTEX = context; ProjectViewModel projectProvider = Provider.of(context); return GestureDetector( - onTap: (){ + onTap: () { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: Colors.white, - appBar: isShowAppBar - ? AppBar( - elevation: 0, - backgroundColor: HexColor('#515B5D'), - textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), - title: Text(appBarTitle.toUpperCase()), - leading: Builder(builder: (BuildContext context) { - return IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pop(context), - ); - }), - centerTitle: true, - actions: [ - IconButton( - icon: Icon(DoctorApp.home_icon_active), - color: Colors.white, //Colors.black, - onPressed: () => Navigator.pushNamedAndRemoveUntil( - context, HOME, (r) => false), - ), - ], - ) - : null, - body: projectProvider.isInternetConnection - ? baseViewModel != null - ? NetworkBaseView( - baseViewModel: baseViewModel, - child: body, - ) - : Stack( - children: [body, buildAppLoaderWidget(isLoading)]) - : Center( - child: Column( + backgroundColor: Colors.white, + appBar: isShowAppBar + ? AppBar( + elevation: 0, + backgroundColor: HexColor('#515B5D'), + textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), + title: Text(appBarTitle.toUpperCase()), + leading: Builder(builder: (BuildContext context) { + return IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pop(context), + ); + }), + centerTitle: true, + actions: [ + IconButton( + icon: Icon(DoctorApp.home_icon_active), + color: Colors.white, //Colors.black, + onPressed: () => Navigator.pushNamedAndRemoveUntil( + context, HOME, (r) => false), + ), + ], + ) + : null, + body: projectProvider.isInternetConnection + ? baseViewModel != null + ? NetworkBaseView( + baseViewModel: baseViewModel, + child: body, + ) + : Stack( + children: [body, buildAppLoaderWidget(isLoading)]) + : Center( + child: Column( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, children: [ diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index c30b1540..026f46b2 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -45,29 +45,29 @@ class _BottomNavBarState extends State { name: TranslationBase.of(context).home, ), BottomNavigationItem( - icon: DoctorApp.message_icon, - activeIcon: DoctorApp.message_icon_active, + icon: DoctorApp.schedule_icon, + activeIcon: DoctorApp.scdedule_icon_active, changeIndex: _changeIndex, index: _index, currentIndex: 1, - name: TranslationBase.of(context).replay2, + name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( - icon: DoctorApp.schedule_icon, - activeIcon: DoctorApp.scdedule_icon_active, + icon: DoctorApp.qr_code, + activeIcon: DoctorApp.qr_code, changeIndex: _changeIndex, index: _index, currentIndex: 2, - name: TranslationBase.of(context).mySchedule, + name: TranslationBase.of(context).qr, ), BottomNavigationItem( - icon: DoctorApp.qr_code, - activeIcon: DoctorApp.qr_code, + icon: DoctorApp.message_icon, + activeIcon: DoctorApp.message_icon_active, changeIndex: _changeIndex, index: _index, currentIndex: 3, - name: TranslationBase.of(context).qr, - ) + name: TranslationBase.of(context).replay2, + ), ], ), ), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index b8db1546..139b85e8 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -15,6 +15,7 @@ class NetworkBaseView extends StatelessWidget { @override Widget build(BuildContext context) { return Container( + color: Colors.grey[100], child: buildBaseViewWidget(), ); } From fdc893c3d66c284432a8da638be94642d303a45b Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 18 Mar 2021 15:01:35 +0200 Subject: [PATCH 348/421] make search patient profile have preview services --- .../service/patient-vital-signs-service.dart | 2 +- lib/screens/dashboard_screen.dart | 3 +- .../patients/patient_search_screen.dart | 3 +- lib/screens/patients/patients_screen.dart | 6 + .../profile/patient_profile_screen.dart | 893 ++++++++++-------- .../profile/PatientProfileButton.dart | 42 +- .../profile/profile_medical_info_widget.dart | 174 +--- .../profile_medical_info_widget_search.dart | 94 ++ 8 files changed, 636 insertions(+), 581 deletions(-) create mode 100644 lib/widgets/patients/profile/profile_medical_info_widget_search.dart diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index 8d404e27..bac13c7f 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -41,7 +41,7 @@ class VitalSignsService extends BaseService { patientVitalSigns = null; hasError = false; Map body = Map(); - body['PatientMRN'] = patient.patientMRN; + body['PatientMRN'] = patient.patientId; // patient.patientMRN body['AppointmentNo'] = patient.appointmentNo; // body['EpisodeID'] = patient.episodeNo; body['PatientTypeID'] = 1; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 9d8bdb2c..ea486f35 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -918,7 +918,8 @@ class _DashboardScreenState extends State { Navigator.of(context) .pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, - "selectedType": "7" + "selectedType": "7", + "isSearch": false, }); }, ) diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 34e68779..1414f9ba 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -90,7 +90,8 @@ class _PatientSearchScreenState extends State { }); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType + "selectedType": _selectedType, + "isSearch": true, }); } } else { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 733a1b9c..14d3fc75 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -48,6 +48,7 @@ class _PatientsScreenState extends State { bool _isInit = true; String patientType; + bool isSearch = false; String patientTypeTitle; var _isLoading = true; @@ -201,6 +202,10 @@ class _PatientsScreenState extends State { patientType = routeArgs['selectedType']; + if(routeArgs.containsKey("isSearch")){ + isSearch = routeArgs['isSearch']; + } + if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; else @@ -362,6 +367,7 @@ class _PatientsScreenState extends State { "patientType":patientType, "from" : patient.getFrom, "to" : patient.getTo, + "isSearch" : isSearch, }); },); }).toList(), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ba42173e..1437a583 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -9,12 +9,12 @@ 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/profile/profile_medical_info_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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:flutter/material.dart'; import 'package:provider/provider.dart'; - /* *@author: Elham Rababah *@Date:22/4/2020 @@ -25,8 +25,7 @@ import 'package:provider/provider.dart'; // ignore: must_be_immutable class PatientProfileScreen extends StatelessWidget { PatiantInformtion patient; - - + bool isFromSearch = false; @override Widget build(BuildContext context) { @@ -37,11 +36,14 @@ class PatientProfileScreen extends StatelessWidget { String patientType = routeArgs['patientType']; String from = routeArgs['from']; String to = routeArgs['to']; + if (routeArgs.containsKey("isSearch")) { + isFromSearch = routeArgs['isSearch']; + } return BaseView( onModelReady: (model) async { GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP( - patientMRN: patient.patientMRN??patient.patientId, + patientMRN: patient.patientMRN ?? patient.patientId, doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); @@ -51,449 +53,534 @@ class PatientProfileScreen extends StatelessWidget { if (model.allergySeverityList.length == 0) { await model.getMasterLookup(MasterKeysService.AllergySeverity); } - }, - builder: (_, model, w) =>AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase.of(context).patientProfile, - - - body: Container( - color: Color(0XFFF2F2F2), - child: CustomScrollView(primary: false, slivers: [ - SliverList( - delegate: SliverChildListDelegate( - [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration(boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 10.0, - spreadRadius: 0, - offset: Offset(0, 10)), - ], color: Colors.white), - child: Column(children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - SizedBox( - width: 20, - ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + ' ' + patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).patientProfile, + body: Container( + color: Color(0XFFF2F2F2), + child: CustomScrollView(primary: false, slivers: [ + SliverList( + delegate: SliverChildListDelegate( + [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration(boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 0, + offset: Offset(0, 10)), + ], color: Colors.white), + child: Column(children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, ), - Row( + Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNo, + patient.firstName + + ' ' + + patient.lastName, color: Colors.black, fontWeight: FontWeight.bold, ), - SizedBox( - width: 4, - ), - AppText( - patient.patientId.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, + Row( + children: [ + AppText( + TranslationBase.of(context) + .fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 4, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], ), - - + model.patientAllergiesList + .isNotEmpty && + model.getAllergicNames( + projectViewModel + .isArabic) != + '' + ? Container( + width: MediaQuery.of(context) + .size + .width * + 0.65, + child: Padding( + padding: const EdgeInsets + .symmetric(vertical: 8), + child: AppText( + TranslationBase.of( + context) + .allergicTO + + " : " + + model.getAllergicNames( + projectViewModel + .isArabic), + color: Color(0xFFB9382C), + fontWeight: + FontWeight.bold, + ), + ), + ) + : AppText(''), ], - ), - model.patientAllergiesList.isNotEmpty && model.getAllergicNames(projectViewModel.isArabic)!='' ?Container( - width: MediaQuery.of(context).size.width *0.65, + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + height: 11 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( child: Padding( - padding: const EdgeInsets.symmetric(vertical: 8), - child: AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context) /*patient.age*/}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ], ), ), - ) : AppText(''), - ], - ) - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - Container( - height: 11 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)/*patient.age*/}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * SizeConfig.textMultiplier, - ), - ], ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).nationality, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.nationalityName ??patient.nationality , - fontWeight: FontWeight.normal, - fontSize: 1.7 * SizeConfig.textMultiplier, - ), - ], + Container( + width: 1, + color: Color(0xffCCCCCC), ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).gender, - fontWeight: FontWeight.bold, - fontSize: 2 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .nationality, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.normal, + fontSize: 1.7 * + SizeConfig.textMultiplier, + ), + ], ), - AppText( - patient.gender.toString() == '1' ? 'Male' : 'Female', - fontWeight: FontWeight.normal, - fontSize: 1.8 * SizeConfig.textMultiplier, + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .gender, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.gender.toString() == '1' + ? 'Male' + : 'Female', + fontWeight: FontWeight.normal, + fontSize: 1.8 * + SizeConfig.textMultiplier, + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ]), - ), - if (patient.admissionNo != null) - Container( - margin: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).admissionDetail, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.8 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, ), Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - ), - child: Column( - children: [ - Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - Row( - children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context) - .dateTime, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ), - Expanded( - child: AppText( - patient.createdOn != null - ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context) - .admissionNo, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ), - AppText( - patient.admissionNo != null - ? patient.admissionNo - : '', - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ]), + ), + if (patient.admissionNo != null) + Container( + margin: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .admissionDetail, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Column( children: [ - Container( - width: - 14 * SizeConfig.textMultiplier, - child: AppText( - TranslationBase.of(context).losNo, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), + Row( + children: [ + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( + context) + .dateTime, + color: Colors.black, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + Expanded( + child: AppText( + patient.createdOn != + null + ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", + color: Colors.black, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + ], ), - AppText( - patient.createdOn != null - ? DateUtils - .differenceBetweenServerDateAndCurrent( - patient.createdOn, context) - : "", - color: Colors.black, - fontWeight: FontWeight.normal, - fontSize: - 1.6 * SizeConfig.textMultiplier, + SizedBox( + height: 4, ), - ], - ), - ], - ), - ), - const Divider( - color: Color(0xffCCCCCC), - height: 5, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: 10 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, + Row( children: [ - AppText( - TranslationBase.of(context) - .area, - fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( + context) + .admissionNo, + color: Colors.black, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), ), AppText( - patient.clinicDescription, - fontWeight: FontWeight.normal, + patient.admissionNo != + null + ? patient.admissionNo + : '', + color: Colors.black, + fontWeight: + FontWeight.normal, fontSize: 1.6 * - SizeConfig.textMultiplier, + SizeConfig + .textMultiplier, ), ], ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - mainAxisAlignment: - MainAxisAlignment.spaceEvenly, + SizedBox( + height: 4, + ), + Row( children: [ - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( context) - .room, - fontWeight: + .losNo, + color: Colors.black, + fontWeight: FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - Expanded( - child: AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight.normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, - ), - ), - ], + fontSize: 1.6 * + SizeConfig + .textMultiplier, ), ), - SizedBox( - height: 4, + AppText( + patient.createdOn != null + ? DateUtils + .differenceBetweenServerDateAndCurrent( + patient + .createdOn, + context) + : "", + color: Colors.black, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, ), - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( - context) - .bed, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, + ], + ), + ], + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 5, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + height: + 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets + .fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .area, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient + .clinicDescription, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets + .fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + children: [ + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .room, + fontWeight: + FontWeight + .bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + Expanded( + child: AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: + FontWeight + .normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, + ), + ), + ], ), - AppText( - "${patient.bedId}", - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, + ), + SizedBox( + height: 4, + ), + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .bed, + fontWeight: + FontWeight + .bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.bedId}", + fontWeight: + FontWeight + .normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], ), - ], - ), + ), + ], ), - ], + ), ), - ), + ], ), - ], - ), - ) - ], - ), - ) - ], - ), - ), + ) + ], + ), + ) + ], + ), + ), + ], + ), ], ), - ], - ), + ), + SliverPadding( + padding: const EdgeInsets.all(16.0), + sliver: isFromSearch + ? ProfileMedicalInfoWidgetSearch( + patient: patient, + patientType: patientType, + from: from, + to: to, + ) + : ProfileMedicalInfoWidget( + patient: patient, + patientType: patientType, + from: from, + to: to, + ), + ) + ]), ), - SliverPadding( - padding: const EdgeInsets.all(16.0), - sliver: ProfileMedicalInfoWidget( - patient: patient, patientType:patientType, from: from, to: to, - )) - ]), - ), - )); + )); } } diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index dab1f9de..e0a1e5f0 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -1,6 +1,8 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.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:flutter/material.dart'; class PatientProfileButton extends StatelessWidget { @@ -9,24 +11,44 @@ class PatientProfileButton extends StatelessWidget { final String icon; final dynamic route; final PatiantInformtion patient; + String from; + String to; final String url = "assets/images/"; + final bool isDisable; + final bool isLoading; + final Function onTap; + PatientProfileButton( - {Key key, this.patient, this.nameLine1, this.nameLine2, this.icon, this.route}) + {Key key, + this.patient, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, + this.isDisable = false, + this.onTap, + this.isLoading = false, + this.from, + this.to}) : super(key: key); + @override Widget build(BuildContext context) { return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), child: InkWell( - onTap: () { + onTap: isDisable + ? null + : onTap != null + ? onTap + : () { navigator(context, this.route); }, child: Column(children: [ Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), - child: - Column( + child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( @@ -43,6 +65,7 @@ class PatientProfileButton extends StatelessWidget { textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 2, ), + if (isLoading) DrAppCircularProgressIndeicator() ], ), ), @@ -61,7 +84,7 @@ class PatientProfileButton extends StatelessWidget { ), decoration: BoxDecoration( // border: Border.all(), - color: Colors.white, + color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), border: Border.fromBorderSide(BorderSide( color: Color(0xffBBBBBB), @@ -81,6 +104,13 @@ class PatientProfileButton extends StatelessWidget { } void navigator(BuildContext context, route) { - Navigator.of(context).pushNamed(route, arguments: {'patient': patient}); + if (from == null) { + from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + if (to == null) { + to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); + } + Navigator.of(context).pushNamed(route, + arguments: {'patient': patient, 'from': from, 'to': to}); } } \ No newline at end of file diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 9bd2230d..3c67cb6a 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -15,22 +16,16 @@ import 'package:hexcolor/hexcolor.dart'; import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: - *@return:ProfileMedicalInfoWidget - *@desc: Profile Medical Info Widget - */ class ProfileMedicalInfoWidget extends StatelessWidget { - ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.from, this.to}); String from; String to; - PatiantInformtion patient; String patientType; + + ProfileMedicalInfoWidget( + {Key key, this.patient, this.patientType, this.from, this.to}); + @override Widget build(BuildContext context) { return BaseView( @@ -185,162 +180,3 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ); } } - -class CircleAvatarWidget extends StatelessWidget { - const CircleAvatarWidget( - {Key key, - @required this.url, - @required this.des, - this.height, - this.width}) - : super(key: key); - - final String url; - final String des; - - final double height; - final double width; - - @override - Widget build(BuildContext context) { - return Container( - child: Column( - children: [ - Container( - height: height, - width: width, - // width: 50, - // height: 50, - decoration: new BoxDecoration( - // color: Colors.green, // border color - shape: BoxShape.circle, - border: Border.all(color: HexColor('#B7831A'), width: 1.5)), - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - child: Image.asset(url), - backgroundColor: Colors.transparent, - ), - ), - SizedBox( - height: 10, - ), - AppText( - des, - fontSize: 1.5 * SizeConfig.textMultiplier, - textAlign: TextAlign.center, - ) - ], - ), - ); - } -} - -class PatientProfileButton extends StatelessWidget { - final String nameLine1; - final String nameLine2; - final String icon; - final dynamic route; - final PatiantInformtion patient; - String from; - String to; - final String url = "assets/images/"; - final bool isDisable; - final bool isLoading; - final Function onTap; - - PatientProfileButton( - {Key key, - this.patient, - this.nameLine1, - this.nameLine2, - this.icon, - this.route, - this.isDisable = false, - this.onTap, - this.isLoading = false, - this.from, - this.to}) - : super(key: key); - - @override - Widget build(BuildContext context) { - return new Container( - margin: new EdgeInsets.symmetric(horizontal: 4.0), - child: InkWell( - onTap: isDisable - ? null - : onTap != null - ? onTap - : () { - navigator(context, this.route); - }, - child: Column(children: [ - Container( - alignment: Alignment.topLeft, - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - this.nameLine1, - color: Color(0xFFB9382C), - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, - ), - AppText( - this.nameLine2, - color: Colors.black, - fontWeight: FontWeight.w600, - textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, - ), - if (isLoading) DrAppCircularProgressIndeicator() - ], - ), - ), - Expanded( - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(10), - child: new Image.asset(url + icon)) - ], - )), - ) - ]), - ), - decoration: BoxDecoration( - // border: Border.all(), - color: isDisable ? Colors.grey.withOpacity(0.4) : Colors.white, - borderRadius: BorderRadius.all(Radius.circular(10)), - border: Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - boxShadow: [ - BoxShadow( - color: Colors.grey.withOpacity(0.2), - spreadRadius: 5, - blurRadius: 7, - offset: Offset(0, 3), // changes position of shadow - ), - ], - ), - padding: EdgeInsets.fromLTRB(5, 10, 5, 5), - ); - } - - void navigator(BuildContext context, route) { - if (from == null) { - from = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } - if (to == null) { - to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); - } - Navigator.of(context).pushNamed(route, - arguments: {'patient': patient, 'from': from, 'to': to}); - } -} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart new file mode 100644 index 00000000..a3f84804 --- /dev/null +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -0,0 +1,94 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../../config/size_config.dart'; +import '../../shared/app_texts_widget.dart'; + +class ProfileMedicalInfoWidgetSearch extends StatelessWidget { + String from; + String to; + PatiantInformtion patient; + String patientType; + + ProfileMedicalInfoWidgetSearch( + {Key key, this.patient, this.patientType, this.from, this.to}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => SliverGrid.count( + crossAxisSpacing: 10, + mainAxisSpacing: 20, + crossAxisCount: 2, + childAspectRatio: 1.5, + children: [ + PatientProfileButton( + key: key, + patient: patient, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, + icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), + (int.parse(patientType) == 7 || int.parse(patientType) == 6) + ? PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png') + : PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_HISTORY, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), + PatientProfileButton( + key: key, + patient: patient, + route: MEDICAL_FILE, + nameLine1: TranslationBase.of(context).previewHealth, + nameLine2: TranslationBase.of(context).summaryReport, + icon: 'radiology-1.png'), + ], + ), + ); + } +} From 92e60bd3fd7d0310ea27a19c628a98ae51b02691 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 18 Mar 2021 15:26:45 +0200 Subject: [PATCH 349/421] Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into development # Conflicts: # lib/screens/dashboard_screen.dart # lib/screens/patients/patients_screen.dart --- .../doctor/patient_arrival_screen.dart | 130 ++++++++++++++++++ .../search_medicine_patient_screen.dart | 109 +++++++++++++++ .../referral/patient_referral_screen.dart | 101 ++++++++++++++ 3 files changed, 340 insertions(+) create mode 100644 lib/screens/doctor/patient_arrival_screen.dart create mode 100644 lib/screens/medicine/search_medicine_patient_screen.dart create mode 100644 lib/screens/patients/profile/referral/patient_referral_screen.dart diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart new file mode 100644 index 00000000..367f1728 --- /dev/null +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -0,0 +1,130 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientArrivalScreen extends StatefulWidget { + @override + _PatientArrivalScreen createState() => _PatientArrivalScreen(); +} + +class _PatientArrivalScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).arrivalpatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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).arrivalpatient), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).rescheduleLeaves), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientsScreen( + patientSearchForm: _patientSearchFormValues, + selectedType: "7", + isAppbar: false, + ), + AddRescheduleLeavScreen(), + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart new file mode 100644 index 00000000..39c0deae --- /dev/null +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -0,0 +1,109 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patient_search_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.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/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class SearchMedicinePatientScreen extends StatefulWidget { + @override + _SearchMedicinePatientScreen createState() => _SearchMedicinePatientScreen(); +} + +class _SearchMedicinePatientScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).searchmedicinepatient, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).searchMedicine), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + PatientSearchScreen(), + MedicineSearchScreen() + ], + ), + ) + ], + ), + )); + } +} diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart new file mode 100644 index 00000000..f4b04d02 --- /dev/null +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -0,0 +1,101 @@ +import 'dart:ui'; +import 'package:doctor_app_flutter/screens/doctor/my_referral_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/doctor/my_referred_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/referral/referred-patient-screen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PatientReferralScreen extends StatefulWidget { + @override + _PatientReferralScreen createState() => _PatientReferralScreen(); +} + +class _PatientReferralScreen extends State + with SingleTickerProviderStateMixin { + TabController _tabController; + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + } + + @override + void dispose() { + super.dispose(); + _tabController.dispose(); + } + + @override + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).patientsreferral, + body: Scaffold( + extendBodyBehindAppBar: true, + appBar: PreferredSize( + preferredSize: Size.fromHeight(65.0), + child: Center( + child: Container( + height: 60.0, + 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).myReferral), + ), + ), + Container( + width: MediaQuery.of(context).size.width * 0.30, + child: Center( + child: AppText( + TranslationBase.of(context).myReferredPatient), + ), + ), + ], + ), + ), + ), + ), + ), + body: Column( + children: [ + Expanded( + child: TabBarView( + physics: BouncingScrollPhysics(), + controller: _tabController, + children: [ + MyReferralPatientScreen(), + MyReferredPatient(), + ], + ), + ) + ], + ), + )); + } +} From 340bfd0a1cf19b52913a70bb81a547b25c132215 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 18 Mar 2021 16:27:12 +0200 Subject: [PATCH 350/421] add clinic to arrival search patient --- lib/core/viewModel/auth_view_model.dart | 13 +- lib/screens/patients/patients_screen.dart | 405 +++++++++++++++------- 2 files changed, 297 insertions(+), 121 deletions(-) diff --git a/lib/core/viewModel/auth_view_model.dart b/lib/core/viewModel/auth_view_model.dart index 3a873049..87b89123 100644 --- a/lib/core/viewModel/auth_view_model.dart +++ b/lib/core/viewModel/auth_view_model.dart @@ -202,16 +202,19 @@ class AuthViewModel extends BaseViewModel { *@return:Future *@desc: getDocProfiles */ - Future getDocProfiles(docInfo) async { + Future getDocProfiles(docInfo, {bool allowChangeProfile = true}) async { try { dynamic localRes; await baseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { localRes = response; - doctorProfile = - DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); - selectedClinicName = - response['DoctorProfileList'][0]['ClinicDescription']; + if(allowChangeProfile) { + doctorProfile = + DoctorProfileModel.fromJson(response['DoctorProfileList'][0]); + selectedClinicName = + response['DoctorProfileList'][0]['ClinicDescription']; + } + }, onFailure: (String error, int statusCode) { throw error; }, body: docInfo); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 733a1b9c..2334eaa8 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,19 +1,22 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.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'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -34,6 +37,9 @@ class _PatientsScreenState extends State { List date; List unFilterDate; + var clinicId; + AuthViewModel authProvider; + Color sideColor = Colors.black; List responseModelList; List responseModelList2; @@ -188,14 +194,26 @@ class _PatientsScreenState extends State { @override Widget build(BuildContext context) { + authProvider = Provider.of(context); _locations = [ - TranslationBase.of(context).all, - TranslationBase.of(context).today, - TranslationBase.of(context).tomorrow, - TranslationBase.of(context).nextWeek, + TranslationBase + .of(context) + .all, + TranslationBase + .of(context) + .today, + TranslationBase + .of(context) + .tomorrow, + TranslationBase + .of(context) + .nextWeek, ]; projectsProvider = Provider.of(context); - final routeArgs = ModalRoute.of(context).settings.arguments as Map; + final routeArgs = ModalRoute + .of(context) + .settings + .arguments as Map; patient = routeArgs['patientSearchForm']; @@ -218,14 +236,12 @@ class _PatientsScreenState extends State { model .getPatientList( - val2 == 7 - ? getPatientArrivalListRequestModel.toJson() - : patient, - patientType) + val2 == 7 + ? getPatientArrivalListRequestModel.toJson() + : patient, + patientType) .then((res) { setState(() { - - if (res != null && res['MessageStatus'] == 1) { if (val2 == 7) { if (res[SERVICES_PATIANT2[val2]] == null) { @@ -253,7 +269,6 @@ class _PatientsScreenState extends State { responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList2 = responseModelList; _isError = false; - } else { _isError = true; error = model.error??res['ErrorEndUserMessage'] ?? res['ErrorMessage']; @@ -275,114 +290,272 @@ class _PatientsScreenState extends State { body: _isLoading ? Container() : _isError - ? DrAppEmbeddedError(error: error) - : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient) - : Container( - child: ListView( - scrollDirection: Axis.vertical, - children: [ - Container( - child: lItems == null - ? Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - child: Center( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 0, 0, 0, 0), //250 - child: - DrAppCircularProgressIndeicator(), - )), - ), - ], - ) - : 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, - child: TextField( - controller: _controller, - onChanged: (String str) { - this.searchData(str); - }, - decoration: buildInputDecoration( - context, - TranslationBase.of(context) - .searchPatient), - ), - ), - 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), - child: (responseModelList.length > 0) - ? Column( - // mainAxisAlignment: MainAxisAlignment.center, - children: responseModelList - .map((PatiantInformtion - item) { - return PatientCard(patientInfo: item, - patientType: patientType, - onTap: () { - Navigator.of(context) - .pushNamed( - PATIENTS_PROFILE, - arguments: { - "patient": item, - "patientType":patientType, - "from" : patient.getFrom, - "to" : patient.getTo, - }); - },); - }).toList(), - ) - : Center( - child: DrAppEmbeddedError( - error: TranslationBase.of( - context) - .youDontHaveAnyPatient), - ), + ? DrAppEmbeddedError(error: error) + : lItems == null || lItems.length == 0 + ? DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient) + : Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( + child: lItems == null + ? Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 0, 0, 0, 0), //250 + child: + DrAppCircularProgressIndeicator(), + )), + ), + ], + ) + : 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, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); + }, + decoration: buildInputDecoration( + context, + TranslationBase + .of(context) + .searchPatient), + ), + ), + SizedBox( + height: 10.0, + ), + if(int.parse(patientType)==7) + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, ), - ], - ), - ) - ], - ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + Divider( + thickness: 0.8, + color: Color(0xffCCCCCC), + ), + Container( + decoration: BoxDecoration( + color: Color(0Xffffffff), + borderRadius: + BorderRadius.circular(20)), + margin: + EdgeInsets.fromLTRB(0, 0, 0, 0), + child: (responseModelList.length > 0) + ? Column( + // mainAxisAlignment: MainAxisAlignment.center, + children: responseModelList + .map((PatiantInformtion + item) { + return PatientCard(patientInfo: item, + patientType: patientType, + onTap: () { + Navigator.of(context) + .pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item, + "patientType":patientType, + "from" : patient.getFrom, + "to" : patient.getTo, + }); + },); + }).toList(), + ) + : Center( + child: DrAppEmbeddedError( + error: TranslationBase.of( + context) + .youDontHaveAnyPatient), ), + ), + ], + ), + ) + ], + ), + ), ), ); } + changeClinic(clinicId, BuildContext context, model) async { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: doctorProfile.doctorID, + clinicID: clinicId, + license: true, + projectID: doctorProfile.projectID, + tokenID: '', + languageID: 2); + + authProvider.getDocProfiles(docInfo.toJson(), allowChangeProfile: false) + .then((profileList) async { + print(profileList['DoctorProfileList'][0]); + int val2 = int.parse(patientType); + + GetPatientArrivalListRequestModel + + getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( + from: patient.From, + to: patient.To, + clinicID: profileList['DoctorProfileList'][0]['ClinicID'], + doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(), + patientMRN: patient.getPatientID, + pageIndex: 0, + pageSize: 0); + + + model + .getPatientList( + getPatientArrivalListRequestModel.toJson(), + patientType) + .then((res) { + setState(() { + if (res != null && res['MessageStatus'] == 1) { + if (val2 == 7) { + if (res[SERVICES_PATIANT2[val2]] == null) { + _isError = true; + _isLoading = false; + this.error = error.toString(); + } else { + var localList = []; + if (res["patientArrivalList"]["entityList"] == null) { + res["patientArrivalList"]["entityList"] = []; + } + res["patientArrivalList"]["entityList"].forEach((v) { + Map mergedPatient = { + ...v, + ...v["patientDetails"] + }; + localList.add(mergedPatient); + }); + lItems = localList; + } + } + parsed = lItems; + responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList2 = responseModelList; + _isError = false; + } else { + _isError = true; + error = model.error ?? res['ErrorEndUserMessage'] ?? + res['ErrorMessage']; + } + + _isLoading = false; + }); + GifLoaderDialogUtils.hideDialog(context); + + }).catchError((error) { + helpers.showErrorToast(error.toString()); + GifLoaderDialogUtils.hideDialog(context); + + }); + + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + helpers.showErrorToast(err); + }); + } + InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( prefixIcon: Icon(Icons.search, color: Colors.grey), From 15774e5b05391c9b36251fe869e5775efc2ae88f Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 18 Mar 2021 19:54:40 +0200 Subject: [PATCH 351/421] 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 e2e92c1c59e96236975120f473d03af63b5df8a3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 18 Mar 2021 20:37:54 +0200 Subject: [PATCH 352/421] Clinic List widget --- lib/screens/patients/patients_screen.dart | 179 ++++++++++++---------- 1 file changed, 100 insertions(+), 79 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ed535b47..ac91050e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -42,7 +42,7 @@ class _PatientsScreenState extends State { List date; List unFilterDate; - var clinicId; + int clinicId; AuthViewModel authProvider; Color sideColor = Colors.black; @@ -340,10 +340,7 @@ class _PatientsScreenState extends State { children: [ Padding( padding: EdgeInsets.only( - top: MediaQuery.of(context) - .size - .height * - 0.03), + top:0), child: SERVICES_PATIANT2[ int.parse(patientType)] == "List_MyOutPatient" @@ -371,80 +368,10 @@ class _PatientsScreenState extends State { height: 10.0, ), if(int.parse(patientType)==7) - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), Divider( thickness: 0.8, color: Color(0xffCCCCCC), @@ -663,3 +590,97 @@ class _PatientsScreenState extends State { ); } } + +// ignore: must_be_immutable +class ClinicList extends StatelessWidget { + + ProjectViewModel projectsProvider; + final int clinicId; + final Function (int value) onClinicChange; + + ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + + @override + Widget build(BuildContext context) { + // authProvider = Provider.of(context); + + projectsProvider = Provider.of(context); + return Container( + child: + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue){ + onClinicChange(newValue); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ); + } +} + From cf7d494944daaefd7b710c5b4facc8e2eec7d3f8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Mar 2021 10:05:19 +0300 Subject: [PATCH 353/421] 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$N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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 354/421] 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 42666e2200f9ceaed32249999c47fef0072000b4 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 09:36:01 +0200 Subject: [PATCH 355/421] move clinic list to its own file --- lib/screens/patients/patients_screen.dart | 111 +++--------------- .../patients/clinic_list_dropdwon.dart | 99 ++++++++++++++++ 2 files changed, 116 insertions(+), 94 deletions(-) create mode 100644 lib/widgets/patients/clinic_list_dropdwon.dart diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ac91050e..e0f3fe0e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.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/patients/clinic_list_dropdwon.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'; @@ -312,9 +313,22 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient) + ? Column( + children: [ + if(int.parse(patientType)==7) + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), + Divider( + thickness: 0.8, + color: Color(0xffCCCCCC), + ), + DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient), + ], + ) : Container( child: ListView( scrollDirection: Axis.vertical, @@ -591,96 +605,5 @@ class _PatientsScreenState extends State { } } -// ignore: must_be_immutable -class ClinicList extends StatelessWidget { - - ProjectViewModel projectsProvider; - final int clinicId; - final Function (int value) onClinicChange; - - ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); - - @override - Widget build(BuildContext context) { - // authProvider = Provider.of(context); - projectsProvider = Provider.of(context); - return Container( - child: - projectsProvider - .doctorClinicsList.length > - 0 - ? FractionallySizedBox( - widthFactor: 0.9, - child: Column( - children: [ - Container( - width: MediaQuery.of(context).size.width *0.8, - child: Center( - child: DropdownButtonHideUnderline( - child: DropdownButton( - dropdownColor: - Colors.white, - iconEnabledColor: - Colors.black, - isExpanded: true, - value: clinicId == null - ? projectsProvider - .doctorClinicsList[ - 0] - .clinicID - : clinicId, - iconSize: 25, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return projectsProvider - .doctorClinicsList - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( - item.clinicName, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .black, - ), - ], - ); - }).toList(); - }, - onChanged: (newValue){ - onClinicChange(newValue); - }, - items: projectsProvider - .doctorClinicsList - .map((item) { - return DropdownMenuItem( - child: Text( - item.clinicName, - textAlign: - TextAlign.end, - ), - value: item.clinicID, - ); - }).toList(), - )), - ), - ), - ], - ), - ) - : AppText( - TranslationBase - .of(context) - .noClinic), - ); - } -} diff --git a/lib/widgets/patients/clinic_list_dropdwon.dart b/lib/widgets/patients/clinic_list_dropdwon.dart new file mode 100644 index 00000000..c903bd7b --- /dev/null +++ b/lib/widgets/patients/clinic_list_dropdwon.dart @@ -0,0 +1,99 @@ +// ignore: must_be_immutable +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class ClinicList extends StatelessWidget { + + ProjectViewModel projectsProvider; + final int clinicId; + final Function (int value) onClinicChange; + + ClinicList({Key key, this.clinicId, this.onClinicChange}) : super(key: key); + + @override + Widget build(BuildContext context) { + // authProvider = Provider.of(context); + + projectsProvider = Provider.of(context); + return Container( + child: + projectsProvider + .doctorClinicsList.length > + 0 + ? FractionallySizedBox( + widthFactor: 0.9, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width *0.8, + child: Center( + child: DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: + Colors.white, + iconEnabledColor: + Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[ + 0] + .clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors + .black, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue){ + onClinicChange(newValue); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: + TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ), + ), + ], + ), + ) + : AppText( + TranslationBase + .of(context) + .noClinic), + ); + } +} \ No newline at end of file From 1af6115365aea868b406623c65f1140ef3c8322e Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 21 Mar 2021 09:53:25 +0200 Subject: [PATCH 356/421] 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'), ], ), ); From 51c6329517c0e0745fc51d975fc6bfd45c730cde Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 10:23:00 +0200 Subject: [PATCH 357/421] return back my code --- lib/screens/patients/patients_screen.dart | 32 ++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index f645e33b..5da9f397 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -1,7 +1,11 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_arrival/get_patient_arrival_list_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; @@ -301,9 +305,26 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 - ? DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient) + ? Column( + children: [ + + if(int.parse(patientType)==7) + Container( + margin: EdgeInsets.only(top: 70), + child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), + ), + Container( + margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.35), + + child: DrAppEmbeddedError( + error: + TranslationBase.of(context).youDontHaveAnyPatient), + ), + ], + ) : Container( color: Colors.grey[200], child: ListView( @@ -347,6 +368,11 @@ class _PatientsScreenState extends State { SizedBox( height: 10.0, ), + if(int.parse(patientType)==7) + ClinicList(clinicId: clinicId,onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + },), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) From 7d85c8b69268d9901430e7b6727bfddacd9fcb3b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 10:26:23 +0200 Subject: [PATCH 358/421] return back the condition --- .../profile/profile_medical_info_widget.dart | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ee500957..fb0ef609 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -35,7 +35,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -54,7 +54,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { }, isLoading: model.state == ViewState.BusyLocal, icon: 'create-episod.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -64,7 +64,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: UPDATE_EPISODE, icon: 'modilfy-episode.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -72,7 +72,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'radiology-1.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -81,7 +81,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).service, icon: 'lab.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -94,7 +94,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { */ , icon: 'heartbeat.png'), - // if (selectedPatientType != 7) + if (selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -109,9 +109,9 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, icon: 'radiology-1.png'), - // if (selectedPatientType != 0 && - // selectedPatientType != 5 && - // selectedPatientType != 7) + if (selectedPatientType != 0 && + selectedPatientType != 5 && + selectedPatientType != 7) PatientProfileButton( key: key, patient: patient, @@ -119,7 +119,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, icon: 'heartbeat.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -150,7 +150,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -158,7 +158,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, icon: 'note.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -166,7 +166,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - // if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, From 5861d159ac9e4df0a967e6f6bdc66669cf00c61a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Mar 2021 15:02:19 +0300 Subject: [PATCH 359/421] bug fixes --- lib/screens/dashboard_screen.dart | 32 ++- .../doctor/patient_arrival_screen.dart | 5 - .../add-rescheduleleave.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 205 ++++++++++-------- 4 files changed, 138 insertions(+), 106 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 369f6a39..ac8119f0 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/doctor/patient_arrival_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/search_medicine_patient_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/patients_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/my-referral-patient-screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/referral/patient_referral_screen.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; @@ -69,6 +70,26 @@ class _DashboardScreenState extends State { var clinicName = []; int sliderActiveIndex = 0; var clinicId; + var _patientSearchFormValues = PatientModel( + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: 0, + From: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + To: DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd') + .toString(), + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "2Fi7HoIHB0eDyekVa6tCJg==", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); void didChangeDependencies() async { super.didChangeDependencies(); if (_isInit) { @@ -961,12 +982,11 @@ class _DashboardScreenState extends State { ), hasBorder: false, onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PatientArrivalScreen(), - )); + Navigator.of(context) + .pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": "7" + }); }, ), DashboardItem( diff --git a/lib/screens/doctor/patient_arrival_screen.dart b/lib/screens/doctor/patient_arrival_screen.dart index 367f1728..fa2bd11b 100644 --- a/lib/screens/doctor/patient_arrival_screen.dart +++ b/lib/screens/doctor/patient_arrival_screen.dart @@ -114,11 +114,6 @@ class _PatientArrivalScreen extends State physics: BouncingScrollPhysics(), controller: _tabController, children: [ - PatientsScreen( - patientSearchForm: _patientSearchFormValues, - selectedType: "7", - isAppbar: false, - ), AddRescheduleLeavScreen(), ], ), diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index bb4e23ae..d5760cc0 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -28,7 +28,7 @@ class AddRescheduleLeavScreen extends StatelessWidget { {model.getRescheduleLeave(), model.getCoveringDoctors()}, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: false, + isShowAppBar: true, appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: model.getReschduleLeave.length > 0 ? SingleChildScrollView( diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index a29d764e..7f4d0caf 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/screens/reschedule-leaves/add-rescheduleleave.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:flutter/material.dart'; @@ -49,46 +50,46 @@ class _AppDrawerState extends State { // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ - Expanded( - flex: 4, - child: ListView(padding: EdgeInsets.zero, children: [ - Container( - height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset( + Expanded( + flex: 4, + child: ListView(padding: EdgeInsets.zero, children: [ + Container( + height: SizeConfig.heightMultiplier * 50, + child: InkWell( + child: DrawerHeader( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + child: Image.asset( 'assets/images/logo.png', ), margin: EdgeInsets.only(top: 10, bottom: 15), ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, - ), - ), - SizedBox(height: 15), - InkWell( - onTap: (){ - Navigator.of(context).pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - child: Column( - children: [ - authProvider.doctorProfile != null - ? CircleAvatar( + SizedBox( + height: 1, + child: Container( + color: Colors.black26, + ), + ), + SizedBox(height: 15), + InkWell( + onTap: () { + Navigator.of(context) + .pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + children: [ + authProvider.doctorProfile != null + ? CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, - // radius: (52) + // radius: (52) child: ClipRRect( - borderRadius:BorderRadius.circular(50), - + borderRadius: BorderRadius.circular(50), child: Image.network( authProvider .doctorProfile.doctorImageURL, @@ -98,77 +99,93 @@ class _AppDrawerState extends State { ), backgroundColor: Colors.transparent, ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( + : SizedBox(), + authProvider.doctorProfile != null + ? Padding( padding: EdgeInsets.only(top: 10), child: AppText( - TranslationBase.of(context).dr +authProvider.doctorProfile?.doctorName, + TranslationBase.of(context).dr + + authProvider + .doctorProfile?.doctorName, fontWeight: FontWeight.bold, color: Colors.black, fontSize: SizeConfig.textMultiplier * 2, )) - : SizedBox(), - ], - ), - ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - }, - ), - ], + : SizedBox(), + ], + ), + ), + RaisedButton( + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(18.0), + side: BorderSide(color: Colors.red)), + child: AppText( + TranslationBase.of(context).logout, + color: Colors.white, + ), + onPressed: () async { + Navigator.pop(context); + await helpers.logout(); + }, ), - ), + ], ), ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, - ), - ]), + ), ), - Expanded( - flex: 1, - child: Column(children: [ - Container( - // This align moves the children to the bottom - child: Align( - alignment: FractionalOffset.bottomCenter, - child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], - )))) - ])) - ])), + InkWell( + child: DrawerItem( + TranslationBase.of(context).settings, Icons.settings), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(SETTINGS); + }, + ), + InkWell( + child: DrawerItem(TranslationBase.of(context).rescheduleLeaves, + DoctorApp.leaves), + onTap: () { + Navigator.pop(context); + + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + )); + }, + ), + InkWell( + child: DrawerItem( + TranslationBase.of(context).qr + + TranslationBase.of(context).reader, + DoctorApp.qr_code), + onTap: () { + Navigator.pop(context); + Navigator.of(context).pushNamed(QR_READER); + }, + ), + ]), + ), + Expanded( + flex: 1, + child: Column(children: [ + Container( + // This align moves the children to the bottom + child: Align( + alignment: FractionalOffset.bottomCenter, + child: Container( + child: Column( + children: [ + Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 30, + ) + ], + )))) + ])) + ])), ), width: SizeConfig.realScreenWidth * 0.60, margin: 0, From 8a332b4d83f4001f2d06fbc81e576b2f2b5ea25c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 14:06:11 +0200 Subject: [PATCH 360/421] hot fix with search --- lib/screens/patients/patients_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5da9f397..3296bb25 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -488,6 +488,7 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, + "isSearch":isSearch }); }, ); From c10a0cf88e22d4cdddcf179fd83fdd533bf5bb1d Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 14:26:12 +0200 Subject: [PATCH 361/421] hot fix profile_medical_info_widget_search --- .../profile_medical_info_widget_search.dart | 68 +++++++++---------- 1 file changed, 31 insertions(+), 37 deletions(-) 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 5b4d5593..29b769c5 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -1,20 +1,11 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.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/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; -import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -import '../../../config/size_config.dart'; -import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidgetSearch extends StatelessWidget { String from; @@ -35,15 +26,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ + PatientProfileButton( key: key, patient: patient, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: VITAL_SIGN_DETAILS, - icon: 'heartbeat.png'), + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'radiology-1.png'), PatientProfileButton( key: key, patient: patient, @@ -54,32 +44,36 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_ADMISSION_REQUEST, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), - (int.parse(patientType) == 7 || int.parse(patientType) == 6) - ? PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png') - : PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + + // PatientProfileButton( + // key: key, + // patient: patient, + // route: PATIENT_ADMISSION_REQUEST, + // nameLine1: TranslationBase.of(context).admission, + // nameLine2: TranslationBase.of(context).request, + // icon: 'heartbeat.png'), + // (int.parse(patientType) == 7 || int.parse(patientType) == 6) + // ? PatientProfileButton( + // key: key, + // patient: patient, + // route: ORDER_PRESCRIPTION, + // nameLine1: TranslationBase.of(context).orders, + // nameLine2: TranslationBase.of(context).prescription, + // icon: 'lab.png') + // : PatientProfileButton( key: key, patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + route: ORDER_PRESCRIPTION_HISTORY, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, From ed251955937c982528ebdd2c2336ab21f26153e9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 14:32:55 +0200 Subject: [PATCH 362/421] add lab result --- .../profile_medical_info_widget_search.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 29b769c5..fb4eb4b1 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -41,6 +41,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'lab.png'), + + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -95,6 +103,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), + + // PatientProfileButton( + // key: key, + // patient: patient, + // route: PROGRESS_NOTE, + // nameLine1: TranslationBase.of(context).progress, + // nameLine2: TranslationBase.of(context).note, + // icon: 'heartbeat.png'), ], ), ); From 98c02be9a3299ba607d3e9bcd0965db732c6dfdf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Mar 2021 14:33:45 +0200 Subject: [PATCH 363/421] add progress note --- .../profile_medical_info_widget_search.dart | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) 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 fb4eb4b1..67b1cad1 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -103,14 +103,13 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, icon: 'sick_leaves_icons.png'), - - // PatientProfileButton( - // key: key, - // patient: patient, - // route: PROGRESS_NOTE, - // nameLine1: TranslationBase.of(context).progress, - // nameLine2: TranslationBase.of(context).note, - // icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), ], ), ); From 27bbb9ac5986b873b876593b9ac5890c2778dc3a Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 21 Mar 2021 17:29:51 +0300 Subject: [PATCH 364/421] changes updated --- lib/screens/dashboard_screen.dart | 163 +++++++++--------- lib/screens/patients/patients_screen.dart | 88 +++++----- lib/widgets/patients/PatientCard.dart | 13 +- .../profile/profile-welcome-widget.dart | 127 +++++++------- 4 files changed, 203 insertions(+), 188 deletions(-) diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index ac8119f0..77bbe042 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -148,87 +148,90 @@ class _DashboardScreenState extends State { Column( children: [ ProfileWelcomeWidget( - Container( - width: MediaQuery.of(context).size.width * .6, - // // height: 100, - // child: projectsProvider.doctorClinicsList.length > 0 - // ? Stack( - // children: [ - // DropdownButtonHideUnderline( - // child: DropdownButton( - // dropdownColor: Colors.white, - // iconEnabledColor: Colors.white, - // isExpanded: true, - // value: clinicId == null - // ? projectsProvider - // .doctorClinicsList[0].clinicID - // : clinicId, - // iconSize: 25, - // elevation: 16, - // selectedItemBuilder: - // (BuildContext context) { - // return projectsProvider.doctorClinicsList - // .map((item) { - // return Row( - // mainAxisSize: MainAxisSize.max, - // children: [ - // AppText( - // item.clinicName, - // fontSize: - // SizeConfig.textMultiplier * - // 2.1, - // color: Colors.white, - // ), - // ], - // ); - // }).toList(); - // }, - // onChanged: (newValue) { - // clinicId = newValue; - // changeClinic(newValue, context, model); - // }, - // items: projectsProvider.doctorClinicsList - // .map((item) { - // return DropdownMenuItem( - // child: Text( - // item.clinicName, - // textAlign: TextAlign.end, - // ), - // value: item.clinicID, - // ); - // }).toList(), - // )), - // Positioned( - // right: projectsProvider.isArabic ? 35 : 0, - // top: 0, - // child: new Container( - // padding: EdgeInsets.all(4), - // decoration: new BoxDecoration( - // color: Colors.red[800], - // borderRadius: BorderRadius.circular(20), - // ), - // constraints: BoxConstraints( - // minWidth: 20, - // minHeight: 20, - // ), - // child: new Text( - // projectsProvider - // .doctorClinicsList.length - // .toString(), - // style: new TextStyle( - // color: Colors.white, - // fontSize: projectsProvider.isArabic - // ? 10 - // : 11, - // ), - // textAlign: TextAlign.center, - // ), - // ), - // ) - // ], - // ) - // : AppText(TranslationBase.of(context).noClinic), + Row( + children: [ + Container( + padding: EdgeInsets.all(4), + margin: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red[800], + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + projectsProvider.doctorClinicsList.length + .toString(), + style: new TextStyle( + color: Colors.white, + fontSize: projectsProvider.isArabic ? 10 : 11, + ), + textAlign: TextAlign.center, + ), + ), + Container( + width: MediaQuery.of(context).size.width * .6, + // // height: 100, + child: projectsProvider.doctorClinicsList.length > 0 + ? Stack( + children: [ + DropdownButtonHideUnderline( + child: DropdownButton( + dropdownColor: Colors.white, + iconEnabledColor: Colors.black, + isExpanded: true, + value: clinicId == null + ? projectsProvider + .doctorClinicsList[0].clinicID + : clinicId, + iconSize: 25, + elevation: 16, + selectedItemBuilder: + (BuildContext context) { + return projectsProvider + .doctorClinicsList + .map((item) { + return Row( + mainAxisSize: MainAxisSize.max, + children: [ + AppText( + item.clinicName, + fontSize: SizeConfig + .textMultiplier * + 2.1, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + ], + ); + }).toList(); + }, + onChanged: (newValue) { + clinicId = newValue; + changeClinic( + newValue, context, model); + }, + items: projectsProvider + .doctorClinicsList + .map((item) { + return DropdownMenuItem( + child: Text( + item.clinicName, + textAlign: TextAlign.end, + ), + value: item.clinicID, + ); + }).toList(), + )), + ], + ) + : AppText(TranslationBase.of(context).noClinic), + ), + ], ), + isClilic: true, ), Container( height: MediaQuery.of(context).size.height * 0.20, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 5da9f397..9f75a731 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -221,7 +221,7 @@ class _PatientsScreenState extends State { ? widget.selectedType : routeArgs['selectedType']; - if(routeArgs != null && routeArgs.containsKey("isSearch")){ + if (routeArgs != null && routeArgs.containsKey("isSearch")) { isSearch = routeArgs['isSearch']; } @@ -306,25 +306,27 @@ class _PatientsScreenState extends State { ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 ? Column( - children: [ - - if(int.parse(patientType)==7) + children: [ + if (int.parse(patientType) == 7) + Container( + margin: EdgeInsets.only(top: 10), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic(newValue, context, model); + }, + ), + ), Container( - margin: EdgeInsets.only(top: 70), - child: ClinicList(clinicId: clinicId,onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - },), + margin: EdgeInsets.only( + top: MediaQuery.of(context).size.height * 0.35), + child: DrAppEmbeddedError( + error: TranslationBase.of(context) + .youDontHaveAnyPatient), ), - Container( - margin: EdgeInsets.only(top: MediaQuery.of(context).size.height*0.35), - - child: DrAppEmbeddedError( - error: - TranslationBase.of(context).youDontHaveAnyPatient), - ), - ], - ) + ], + ) : Container( color: Colors.grey[200], child: ListView( @@ -368,11 +370,15 @@ class _PatientsScreenState extends State { SizedBox( height: 10.0, ), - if(int.parse(patientType)==7) - ClinicList(clinicId: clinicId,onClinicChange: (newValue) { - clinicId = newValue; - changeClinic(newValue, context, model); - },), + if (int.parse(patientType) == 7) + ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic( + newValue, context, model); + }, + ), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) @@ -522,27 +528,26 @@ class _PatientsScreenState extends State { tokenID: '', languageID: 2); - authProvider.getDocProfiles(docInfo.toJson(), allowChangeProfile: false) + authProvider + .getDocProfiles(docInfo.toJson(), allowChangeProfile: false) .then((profileList) async { print(profileList['DoctorProfileList'][0]); int val2 = int.parse(patientType); - GetPatientArrivalListRequestModel - - getPatientArrivalListRequestModel = GetPatientArrivalListRequestModel( - from: patient.From, - to: patient.To, - clinicID: profileList['DoctorProfileList'][0]['ClinicID'], - doctorID: profileList['DoctorProfileList'][0]['DoctorID'].toString(), - patientMRN: patient.getPatientID, - pageIndex: 0, - pageSize: 0); - + GetPatientArrivalListRequestModel getPatientArrivalListRequestModel = + GetPatientArrivalListRequestModel( + from: patient.From, + to: patient.To, + clinicID: profileList['DoctorProfileList'][0]['ClinicID'], + doctorID: + profileList['DoctorProfileList'][0]['DoctorID'].toString(), + patientMRN: patient.getPatientID, + pageIndex: 0, + pageSize: 0); model .getPatientList( - getPatientArrivalListRequestModel.toJson(), - patientType) + getPatientArrivalListRequestModel.toJson(), patientType) .then((res) { setState(() { if (res != null && res['MessageStatus'] == 1) { @@ -572,20 +577,18 @@ class _PatientsScreenState extends State { _isError = false; } else { _isError = true; - error = model.error ?? res['ErrorEndUserMessage'] ?? + error = model.error ?? + res['ErrorEndUserMessage'] ?? res['ErrorMessage']; } _isLoading = false; }); GifLoaderDialogUtils.hideDialog(context); - }).catchError((error) { helpers.showErrorToast(error.toString()); GifLoaderDialogUtils.hideDialog(context); - }); - }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); helpers.showErrorToast(err); @@ -684,6 +687,3 @@ class _PatientsScreenState extends State { ); } } - - - diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 94585e75..98d2a8f5 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; @@ -42,7 +43,11 @@ class PatientCard extends StatelessWidget { color: Colors.green[800], fontWeight: FontWeight.bold, ), - AppText(patientInfo.arrivedOn) + isToday(patientInfo.arrivedOn) == false + ? AppText(DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, 'mm-dd-yyyy hh:mm')) + : AppText(DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, 'hh:mm')) ], ) : SizedBox(), @@ -293,6 +298,12 @@ class PatientCard extends StatelessWidget { return newDate.toString(); } + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + myBoxDecoration() { return BoxDecoration( border: Border( diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index f2baac67..72f06fb1 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -9,8 +9,9 @@ import 'package:provider/provider.dart'; class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; - - ProfileWelcomeWidget(this.clinicWidget, {this.height = 140}); + final bool isClilic; + ProfileWelcomeWidget(this.clinicWidget, + {this.height = 150, this.isClilic = false}); @override Widget build(BuildContext context) { @@ -21,70 +22,70 @@ class ProfileWelcomeWidget extends StatelessWidget { // color: HexColor('#515B5D'), width: double.infinity, child: FractionallySizedBox( - widthFactor: 0.9, - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).welcome, - // fontSize: SizeConfig.textMultiplier * 1.7, - // color: Colors.black, - // ) - // ], - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - AppText( - // TranslationBase.of(context).dr + - ' ${authProvider.doctorProfile.doctorName}', - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, - color: Colors.black, - ), - SizedBox( - width: 20, - ), - CircleAvatar( - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(10), - child: Image.network( - authProvider.doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 75, - height: 75, + widthFactor: 0.9, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + this.isClilic == true ? clinicWidget : SizedBox(), + // Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // mainAxisAlignment: MainAxisAlignment.start, + // children: [ + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).welcome, + // fontSize: SizeConfig.textMultiplier * 1.7, + // color: Colors.black, + // ) + // ], + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.end, + // children: [ + // AppText( + // // TranslationBase.of(context).dr + + // ' ${authProvider.doctorProfile.doctorName}', + // fontWeight: FontWeight.bold, + // fontSize: SizeConfig.textMultiplier * 2.5, + // color: Colors.black, + // ), + SizedBox( + width: 20, + ), + CircleAvatar( + // radius: (52) + child: ClipRRect( + borderRadius: BorderRadius.circular(10), + child: Image.network( + authProvider.doctorProfile.doctorImageURL, + fit: BoxFit.fill, + width: 75, + height: 75, + ), ), + backgroundColor: Colors.transparent, ), - backgroundColor: Colors.transparent, - ) - // ], - // ), - // SizedBox( - // height: 4, - // ), - // clinicWidget, - /// ], - // ), - // Expanded( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ + // ], + // ), + SizedBox( + height: 20, + ), + + /// ], + // ), + // Expanded( + // child: Column( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.end, + // children: [ - // ], - // ), - // ), - ], - ), - ), + // ], + // ), + // ), + ], + )), ); } } From 53f45adf69275fb1df521ce676801e48a20d4787 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 14:11:42 +0200 Subject: [PATCH 365/421] hussam --- .../profile_medical_info_widget_search.dart | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) 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 67b1cad1..98487523 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -26,7 +26,6 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { crossAxisCount: 2, childAspectRatio: 1.5, children: [ - PatientProfileButton( key: key, patient: patient, @@ -66,22 +65,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { // nameLine1: TranslationBase.of(context).admission, // nameLine2: TranslationBase.of(context).request, // icon: 'heartbeat.png'), - // (int.parse(patientType) == 7 || int.parse(patientType) == 6) - // ? PatientProfileButton( - // key: key, - // patient: patient, - // route: ORDER_PRESCRIPTION, - // nameLine1: TranslationBase.of(context).orders, - // nameLine2: TranslationBase.of(context).prescription, - // icon: 'lab.png') - // : - PatientProfileButton( - key: key, - patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, - nameLine1: TranslationBase.of(context).orders, - nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + (int.parse(patientType) == 7 || int.parse(patientType) == 6) + ? PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png') + : PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_HISTORY, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, From 6f3977d1862e2735d0065670a56ec6c3e99e5546 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 22 Mar 2021 14:44:04 +0200 Subject: [PATCH 366/421] lab orders ui enhancements --- lib/widgets/doctor/lab_result_widget.dart | 102 +++++++++++----------- 1 file changed, 52 insertions(+), 50 deletions(-) diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart index e897f33e..5ca50864 100644 --- a/lib/widgets/doctor/lab_result_widget.dart +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -59,9 +59,58 @@ class _LabResultWidgetState extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), ), - child: Column( - children: widget.labResult.map((result) { + child: Column(children: [ + Container( + child: Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + color: HexColor('#515B5D'), + child: Center( + child: Texts( + TranslationBase.of(context).value, + color: Colors.white), + ), + height: 60), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: HexColor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).range, + color: Colors.white), + ), + height: 60), + ), + ], + ), + ), + ...widget.labResult.map((result) { return Container( + padding: EdgeInsets.symmetric(horizontal: 4), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(10)), border: Border( @@ -76,53 +125,6 @@ class _LabResultWidgetState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - color: HexColor('#515B5D'), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(10.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context) - .description, - color: Colors.white, - ), - ), - height: 60, - ), - ), - Expanded( - child: Container( - color: HexColor('#515B5D'), - child: Center( - child: Texts( - TranslationBase.of(context).value, - color: Colors.white), - ), - height: 60), - ), - Expanded( - child: Container( - decoration: BoxDecoration( - color: HexColor('#515B5D'), - borderRadius: BorderRadius.only( - topRight: Radius.circular(10.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context).range, - color: Colors.white), - ), - height: 60), - ), - ], - ), Row( children: [ Expanded( @@ -164,7 +166,7 @@ class _LabResultWidgetState extends State { ), ); }).toList(), - ), + ]), ), ) ], From 234cc57a2a342b132bce815066cc1d078b1787b3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 14:45:31 +0200 Subject: [PATCH 367/421] return search medicine --- lib/core/service/medicine_service.dart | 3 +- lib/core/viewModel/medicine_view_model.dart | 4 +- .../medicine/medicine_search_screen.dart | 282 ++++++++++-------- .../medicine/pharmacies_list_screen.dart | 67 ++--- 4 files changed, 183 insertions(+), 173 deletions(-) diff --git a/lib/core/service/medicine_service.dart b/lib/core/service/medicine_service.dart index 44b380d6..5c716d6d 100644 --- a/lib/core/service/medicine_service.dart +++ b/lib/core/service/medicine_service.dart @@ -11,7 +11,7 @@ class MedicineService extends BaseService { var _pharmaciesList = []; get pharmacyItemsList => _pharmacyItemsList; get pharmaciesList => _pharmaciesList; - + String searchText=''; List patientAssessmentList = []; PharmaciesItemsRequestModel _itemsRequestModel = @@ -20,6 +20,7 @@ class MedicineService extends BaseService { Future getMedicineItem(String itemName) async { _itemsRequestModel.pHRItemName = itemName; + searchText =itemName; await baseAppClient.post( PHARMACY_ITEMS_URL, onSuccess: (dynamic response, int statusCode) { diff --git a/lib/core/viewModel/medicine_view_model.dart b/lib/core/viewModel/medicine_view_model.dart index a029b519..9e83d63e 100644 --- a/lib/core/viewModel/medicine_view_model.dart +++ b/lib/core/viewModel/medicine_view_model.dart @@ -15,7 +15,7 @@ class MedicineViewModel extends BaseViewModel { PrescriptionService _prescriptionService = locator(); get pharmacyItemsList => _medicineService.pharmacyItemsList; - + get searchText=>_medicineService.searchText; get pharmaciesList => _medicineService.pharmaciesList; get medicationStrengthList => _prescriptionService.medicationStrengthList; @@ -34,6 +34,7 @@ class MedicineViewModel extends BaseViewModel { List get patientAssessmentList => _prescriptionService.patientAssessmentList; + List get allMedicationList => _prescriptionService.allMedicationList; List get itemMedicineList => _prescriptionService.itemMedicineList; @@ -41,6 +42,7 @@ class MedicineViewModel extends BaseViewModel { _prescriptionService.itemMedicineListRoute; List get itemMedicineListUnit => _prescriptionService.itemMedicineListUnit; + Future getItem({int itemID}) async { //hasError = false; //_insuranceCardService.clearInsuranceCard(); diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index ea891f3e..a37debbf 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -1,10 +1,10 @@ import 'dart:math'; import 'package:autocomplete_textfield/autocomplete_textfield.dart'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -12,13 +12,13 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; @@ -117,151 +117,169 @@ class _MedicineSearchState extends State { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async { - if (model.allMedicationList.length == 0) - await model.getMedicationList(); + // if (model.allMedicationList.length == 0) + // await model.getMedicationList(); }, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: false, - appBarTitle: TranslationBase.of(context).searchMedicine, - body: SingleChildScrollView( - child: FractionallySizedBox( - widthFactor: 0.97, - child: SingleChildScrollView( - child: Container( - // height: SizeConfig.screenHeight, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - SizedBox( - height: SizeConfig.screenHeight * .16, - ), - 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, - ), + builder: (_, model, w) { + myController.text =model.searchText; + return AppScaffold( + // baseViewModel: model, + isShowAppBar: false, + appBarTitle: TranslationBase.of(context).searchMedicine, + body: SingleChildScrollView( + child: FractionallySizedBox( + widthFactor: 0.97, + child: SingleChildScrollView( + child: Container( + // height: SizeConfig.screenHeight, + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: SizeConfig.screenHeight * .16, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: 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, + hintText: TranslationBase.of(context) + .searchMedicineNameHere, + controller: myController, + onSaved: (value) {}, + onFieldSubmitted: (value) { + searchMedicine(context, model); + }, + inputFormatter: ONLY_LETTERS, ), ), - ], - ), - ) - ]), - SizedBox( - height: SizeConfig.screenHeight * .5, - ), - 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); - }, + ), + FractionallySizedBox( + widthFactor: 0.9, + child: 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); + + }, + ), + ], ), - ], + ), + ), + + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase + .of(context) + .youCanFind + + (myController.text !=''?model.pharmacyItemsList.length + .toString():'0' )+ + " " + + TranslationBase + .of(context) + .itemsInSearch, + fontWeight: FontWeight.bold, + ), + ], + ), + ), + SizedBox( + height:10, ), - ) - ], - ) - ], - ), - )), + if(myController.text !='') + Container( + height: MediaQuery + .of(context) + .size + .height * 0.5, + child: ListView.builder( + padding: const EdgeInsets.only(top:20), + + scrollDirection: Axis.vertical, + // shrinkWrap: true, + itemCount: + model.pharmacyItemsList == + null + ? 0 + : model + .pharmacyItemsList.length, + itemBuilder: + (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: model + .pharmacyItemsList[index] + ["ItemDescription"], + url: model + .pharmacyItemsList[index] + ["ImageSRCUrl"], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmaciesListScreen( + itemID: model + .pharmacyItemsList[ + index]["ItemID"], + url: model + .pharmacyItemsList[ + index]["ImageSRCUrl"]), + ), + ); + }, + ); + }, + ), + ), + ], + ), + )), + ), ), - ), - ), + );} + ); } searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); - if (_selectedMedication.isNullOrEmpty()) { - helpers.showErrorToast(TranslationBase.of(context).typeMedicineName); + if (myController.text.isNullOrEmpty()) { + helpers.showErrorToast(TranslationBase + .of(context) + .typeMedicineName); //"Type Medicine Name") return; - } else if (_selectedMedication.description.length < 3) { - helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); + } + if (myController.text.length < 3) { + helpers.showErrorToast(TranslationBase + .of(context) + .moreThan3Letter); return; } - // GifLoaderDialogUtils.showMyDialog(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: _selectedMedication.itemId, - selectedMedication: _selectedMedication, - ), - ), - ); - // await model.getMedicineItem(_selectedMedication.description); - // GifLoaderDialogUtils.hideDialog(context); + GifLoaderDialogUtils.showMyDialog(context); + + await model.getMedicineItem(myController.text); + GifLoaderDialogUtils.hideDialog(context); } startVoiceSearch() { diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 61bd7ad4..6af1d5b7 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -2,7 +2,6 @@ import 'dart:convert'; import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/core/model/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; @@ -23,11 +22,9 @@ class PharmaciesListScreen extends StatefulWidget { final int itemID; final String url; - final GetMedicationResponseModel selectedMedication; // In the constructor, require a item id. - PharmaciesListScreen( - {Key key, @required this.itemID, this.url, this.selectedMedication}) + PharmaciesListScreen({Key key, @required this.itemID, this.url}) : super(key: key); @override @@ -52,39 +49,31 @@ class _PharmaciesListState extends State { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) async { - await model.getPharmaciesList(widget.selectedMedication.itemId); - await model.getMedicineItem(widget.selectedMedication.description); - - }, - builder: (_, model, w) => - AppScaffold( - baseViewModel: model, - appBarTitle: TranslationBase - .of(context) - .pharmaciesList, - body: Container( - height: SizeConfig.screenHeight, - child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ - model.pharmaciesList.length > 0 && model.pharmacyItemsList.length > 0 + onModelReady: (model) => model.getPharmaciesList(widget.itemID), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + appBarTitle: TranslationBase.of(context).pharmaciesList, + body: Container( + height: SizeConfig.screenHeight, + child: ListView( + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ + model.pharmaciesList.length > 0 ? RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: model.pharmacyItemsList[0] - ["ImageSRCUrl"]!= null - ? Image.network( - model.pharmacyItemsList[0]["ImageSRCUrl"], - height: - SizeConfig.imageSizeMultiplier * + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: widget.url != null + ? Image.network( + widget.url, + height: + SizeConfig.imageSizeMultiplier * 21, width: SizeConfig.imageSizeMultiplier * @@ -241,8 +230,8 @@ class _PharmaciesListState extends State { }), ), ) - ]), - ),),); + ]), + ),),); } @@ -253,7 +242,7 @@ class _PharmaciesListState extends State { //TODO CHECK THE URL IS NULL OR NOT Uint8List dataFromBase64String(String base64String) { if(base64String !=null) - return base64Decode(base64String); + return base64Decode(base64String); } String base64String(Uint8List data) { From 06fdee2d2da93a7e514b9cf918b59c82ed9d9b55 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 15:49:04 +0200 Subject: [PATCH 368/421] hussam --- lib/core/model/prescription_req_model.dart | 5 +- lib/core/service/prescription_service.dart | 4 +- .../medical-file/medical_file_page.dart | 222 +++++++++--------- .../prescription/prescription_screen.dart | 2 +- 4 files changed, 116 insertions(+), 117 deletions(-) diff --git a/lib/core/model/prescription_req_model.dart b/lib/core/model/prescription_req_model.dart index 3accb428..3eb71072 100644 --- a/lib/core/model/prescription_req_model.dart +++ b/lib/core/model/prescription_req_model.dart @@ -1,18 +1,21 @@ class PrescriptionReqModel { String vidaAuthTokenID; dynamic patientMRN; + dynamic appNo; - PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN}); + PrescriptionReqModel({this.vidaAuthTokenID, this.patientMRN, this.appNo}); PrescriptionReqModel.fromJson(Map json) { vidaAuthTokenID = json['VidaAuthTokenID']; patientMRN = json['PatientMRN']; + appNo = json['AppointmentNo']; } Map toJson() { final Map data = new Map(); data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['PatientMRN'] = this.patientMRN; + data['AppointmentNo'] = this.appNo; return data; } } diff --git a/lib/core/service/prescription_service.dart b/lib/core/service/prescription_service.dart index 8b518c07..758f4595 100644 --- a/lib/core/service/prescription_service.dart +++ b/lib/core/service/prescription_service.dart @@ -82,7 +82,9 @@ class PrescriptionService extends LookupService { } Future getPrescription({int mrn}) async { - _prescriptionReqModel = PrescriptionReqModel(patientMRN: mrn); + _prescriptionReqModel = PrescriptionReqModel( + patientMRN: mrn, + ); hasError = false; _prescriptionList.clear(); await baseAppClient.post(GET_PRESCRIPTION_LIST, diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 2b817d8b..79f7416f 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -31,128 +31,122 @@ class _MedicalFilePageState extends State { body: NetworkBaseView( baseViewModel: model, child: SingleChildScrollView( - 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, - ), - 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, - fontWeight: FontWeight.w700, - ), - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( + 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 != null && + model.medicalFileList.length != 0) + ? 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] - .clinicName, + .doctorName, + fontWeight: FontWeight.w700, ), - ], - ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) - ], - ), + ), + ], + ), + 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, - )), - ); - }, ), - ); - }) - : Center( - child: Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', + 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, + )), + ); + }, ), - ), - ) - ], - ), + ); + }) + : 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 87202979..18655e65 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: 0), + onModelReady: (model) => model.getPrescription(mrn: patient.patientId), builder: (BuildContext context, PrescriptionViewModel model, Widget child) => AppScaffold( From 7ebf36f98fa810b6a4b94c7065c57ca0493e7579 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 15:49:16 +0200 Subject: [PATCH 369/421] add radiology open image --- lib/config/localized_values.dart | 2 + .../radiology/radiology_report_screen.dart | 74 ++++++++++++++----- .../profile/radiology/radiology_screen.dart | 2 + lib/util/translations_delegate_base.dart | 2 + lib/widgets/shared/app_scaffold_widget.dart | 6 +- 5 files changed, 64 insertions(+), 22 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 356c321d..9df6a544 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -748,4 +748,6 @@ const Map> localizedValues = { }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, + "open-rad": {"en": "Open Image", "ar": "فتح صور الاشعة"}, + }; diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 29544cdf..29430b27 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -1,37 +1,71 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_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:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:url_launcher/url_launcher.dart'; class RadiologyReportScreen extends StatelessWidget { final String reportData; + final String url; - RadiologyReportScreen({Key key, this.reportData}); + RadiologyReportScreen({Key key, this.reportData, this.url}); @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - body: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), - top: BorderSide(color: Colors.grey, width: 0.5), - left: BorderSide(color: Colors.grey, width: 0.5), - right: BorderSide(color: Colors.grey, width: 0.5), + appBarTitle: TranslationBase.of(context).radiologyReport, + body: SingleChildScrollView( + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: Colors.white, + border: Border( + bottom: BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), + ), + ), + child: AppText( + reportData, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), ), ), - child: AppText( - reportData, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - ), - ); + bottomSheet: url == null + ? Container( + height: MediaQuery.of(context).size.height * 0, + ) + : Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.1, + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + FractionallySizedBox( + widthFactor: 0.9, + child: Container( + child: Wrap( + alignment: WrapAlignment.center, + children: [ + // TODO change it secondary button and add loading + AppButton( + title: TranslationBase.of(context).openRad, + onPressed: () async { + launch(url); + }, + ), + ], + ), + ), + ), + ], + ), + )); } } diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index cdab5bca..0bce886a 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -102,6 +102,8 @@ class _RadiologyScreenState extends State { reportData: model .patientRadiologyList[index] .reportData, + url: model + .patientRadiologyList[index].imageURL, )), ); }, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 8c8afde2..f7f94812 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1136,6 +1136,8 @@ class TranslationBase { String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + String get openRad => localizedValues['open-rad'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 378094c7..9842bbed 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -17,13 +17,13 @@ class AppScaffold extends StatelessWidget { final bool isLoading; final bool isShowAppBar; final BaseViewModel baseViewModel; - + final Widget bottomSheet; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel}); + this.baseViewModel, this.bottomSheet}); @override Widget build(BuildContext context) { @@ -59,6 +59,8 @@ class AppScaffold extends StatelessWidget { ], ) : null, + + bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null ? NetworkBaseView( From 96d07e7a594ef4cc39c812fef2194e9018238bf9 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Mar 2021 17:28:36 +0200 Subject: [PATCH 370/421] fix small issue in radiology --- .../radiology/radiology_report_screen.dart | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 29430b27..75be23e8 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -18,23 +18,28 @@ class RadiologyReportScreen extends StatelessWidget { return AppScaffold( appBarTitle: TranslationBase.of(context).radiologyReport, body: SingleChildScrollView( - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(10)), - color: Colors.white, - border: Border( - bottom: BorderSide(color: Colors.grey, width: 0.5), - top: BorderSide(color: Colors.grey, width: 0.5), - left: BorderSide(color: Colors.grey, width: 0.5), - right: BorderSide(color: Colors.grey, width: 0.5), + child: Column( + children: [ + Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + color: Colors.white, + border: Border( + bottom: BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), + ), + ), + child: AppText( + reportData, + fontSize: 2.5 * SizeConfig.textMultiplier, + ), ), - ), - child: AppText( - reportData, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), + SizedBox(height:MediaQuery.of(context).size.height * 0.13 ,) + ], ), ), bottomSheet: url == null From bbb1a8ff74307248a35a17c338c8b181113c621d Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 22 Mar 2021 20:44:26 +0300 Subject: [PATCH 371/421] arrival list updated --- assets/fonts/Poppins/Poppins-Bold.ttf | Bin 0 -> 153900 bytes assets/fonts/Poppins/Poppins-Medium.ttf | Bin 0 -> 156480 bytes assets/fonts/Poppins/Poppins-Regular.ttf | Bin 0 -> 158192 bytes assets/images/female_avatar.png | Bin 0 -> 2042 bytes assets/images/male_avatar.png | Bin 0 -> 1732 bytes lib/config/localized_values.dart | 7 + lib/models/patient/patiant_info_model.dart | 231 +++++----- lib/screens/dashboard_screen.dart | 511 +-------------------- lib/screens/patients/patients_screen.dart | 58 ++- lib/util/helpers.dart | 4 + lib/util/translations_delegate_base.dart | 5 + lib/widgets/auth/verification_methods.dart | 2 +- lib/widgets/patients/PatientCard.dart | 432 ++++++++++------- lib/widgets/shared/app_drawer_widget.dart | 7 +- lib/widgets/shared/drawer_item_widget.dart | 1 + pubspec.yaml | 9 + 16 files changed, 456 insertions(+), 811 deletions(-) create mode 100644 assets/fonts/Poppins/Poppins-Bold.ttf create mode 100644 assets/fonts/Poppins/Poppins-Medium.ttf create mode 100644 assets/fonts/Poppins/Poppins-Regular.ttf create mode 100644 assets/images/female_avatar.png create mode 100644 assets/images/male_avatar.png diff --git a/assets/fonts/Poppins/Poppins-Bold.ttf b/assets/fonts/Poppins/Poppins-Bold.ttf new file mode 100644 index 0000000000000000000000000000000000000000..b94d47f3af31505f3cfcba533da52b881b6a1b33 GIT binary patch literal 153900 zcmce<2Yg)Bu?M{OZj)upwq*6Xy=b+)s!OZhyJT6CC9R6PEL*Z=xyWUWDW=&Nj198s zokt5`5)vTwk-UV2B$PBl!Xt!0@?Jth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OJuse`}KGP05|GvOnsM<)Y zSmB%_vTSJRd?e7fc>pb%M_AuH!MD-Vk+IJ~zCM8@bqyyA#xo+j^rrjt`oOv|mVO%f zyXr|jH_&ie#wuz8O{SxfrMrf4M09$7&WV8I?1E*WNi&ycu8XUakLzMsTUIqrq0#hT z(GL2Gjd1#*GrBRSIKS~vyk9BHb6E8_$*BD$tLKJyi?*!cIvuSG(I2`WNxZjIrzg5Q zgYa8@_Dq2A0xkx*V%bL4uhy7vk$VVm}J*sz_T~?l;;zM>l zoe$Y@Y-_rrTlIR*LHrUurN=mvkdLlUnFEO5eD608){Z?}Icd_}^h8_hb;$VKg&x%% z<}dm*7XSPQaSwoHv6l2T8e?amS@i*S6nCTXlrPxnGaH|22fS}dr;Wa8rLhC_Gt+_& z)3bT@%g7#Mtn1Bq9MoZ2>)0WoWW3V6rtS5y6{x+e*GMX@Wml;7=Lhzyy#FG#moZZE zFZ0Cyq$($u3#chtd%{{}dK5+Yiy3Iestub(0pl%Ik zxHScC3)Ssfb(35zl55Rhvu9HS)`s;pkrHXugBdOn%Tr8Rbg`CEgy)g05}qL|PalwZ zl(9Eh`96Zd{kjNeswiPsu104P?I|(YnV0-rhkuztGb6DwOXy;kfbx8f+3VFUSZ&}7 zHR8HVThYk1zuDJzlJlN~L_9Y$<<(p<|Z zEoYye*7Ht(XZ#Y4xgr@?q9>QCB}b8SIbSe?x@^6lJxE#PGLIZoCNnqZ`l4qqdA8rP zcLLVI&wpeFBXgkC{725D?IyRW9+DgB5KBvGs1*H_oB%>EWvdQK{B}V8?q0O(iXPov z_OIxr{SLZeMZ2cx)|4?Z6g|4jqLF-lIgqs2;Aul1@Ey{+{sZg1d9 zWY<%6BIjc1@0r+G>_uWEDB(z_IMv~JHt$LyHk-<1L#El)U G$NfLB&PKNY literal 0 HcmV?d00001 diff --git a/assets/fonts/Poppins/Poppins-Medium.ttf b/assets/fonts/Poppins/Poppins-Medium.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e90e87ed69a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7l2vTC!wFFSV7u~!^> z!)F5mYagk_!oa#`8|(4j5t0@f5J`ymnkz+bCFg?BSJ|tZlCT4i$9o8^yP{urkM}q9 z)t-aSSkbyEIyXNIq&6&+j4sOy&}Ml)8Z3t*(>@H@dRY}Ed&kbwN?VC`S!8lu--)tE z#OUSQMsYX!T0tbP0~6PX>igZ{$@8_}Xw&Px7!1lV=6tErgngh1|UQ59CgtsPO+u~gpux;>K1Gd{4 z!!DnpPOm*+t7i=L`YmBB_1a1qLA|z_URS_2iE-HLm&(ZNwGC#p_1dD|P1r=vC+;RP zE*|4O85a+CSyjYG``{kr?wu_vGQ9kHLrC}}?@N5o%Ib}-_3E@u_^KD7bndVt?*9V5 Ckeh!1 literal 0 HcmV?d00001 diff --git a/assets/images/female_avatar.png b/assets/images/female_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..9ff4b8b79b7823a303578a7300b8d7190b4c40d3 GIT binary patch literal 2042 zcmVR#6+Ra(d5%8F$>7 z+1W>xFLS1bLUPaQ5VtQL@=m_L^p^^ z2mdFeySsa+)w}%Z?d|=9n2sf88i)pT%!<`3qB?vAf%*8Y87GYnC)!2y#01lPdWs{1 zBl*7>Z)j+EpER^q$T%?o<>lpY;J^V$NlAgk#6?+vrV5QlKWRI_+<1>3oNQdZ1Q{6_ zyvF$ebU_ee;lhPf=m|{p7*l(GsnEpRy?eJo^FjcqY15`r5K&Q4LL-4I+!9m5<`v&V zOG-*0Ffh<;02Bh?t6Hr#wB*hao0Ob{VjhPZdrXXZF#t4#r>Cdj#70jfUpR_cDz!qP zbLPw$(dKivt%7CW_!|VkNsX_#^fos)3qfew+S)!4S}s+FlFo(=8w?tsOTsIAOFY1( zJMO)Uirx_2HVxsIsy$ zF%a9|44omE#ti}B18Kt{^MW8k8O;1%|Lb~|aV`K_JLAG%hmX4(%$o6fWb*Rz7ytnX zEIEeg0;~{IbZNC(#&BVV3W|vEeRQN!ujhpTa3s(;8ea3A0vh(lGXOa`IV=D^2+UKu z;ZrX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C8mG0? zVjk!CY2t&L-Dk4qzIZ4b1%z$n+`y_iHtGO_%F{4Ul$bs(w3X813BW=(?=c5p=d_gW`{%V*=IZO~-yw%_V-)~1 zPe1maag6m*ax${WeZ|0718{KhBAXZ&Ru$^lgxwS1@$UDGyvGGIkm-_~&O=g>8ww>1N zl*Yz!NfZW9zAgY_-gViU1cT1WOsoWMrq&Ll?u-_I zZ(ztB3#$djyq*<@hlh`gh>Sjyo*`C_6u^N45@qz3t-r^_#Jo3RC-!SYBfba1L<=TP88|a(>a)U6r*>WZY+8Bp4Aav)&E{J1 a(e{72?|rP8s2Fts0000> localizedValues = { }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, + 'fileNumber': {'en': "File Number: ", 'ar': " :رقم الملف"}, + 'searchPatient-name': { + 'en': 'Search Name, Medical File, Phone Number', + 'ar': "اسم البحث ، الملف الطبي ، رقم الهاتف" + }, + 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة الجدولة'}, + 'leaves': {'en': 'Leaves', 'ar': 'يغادر'}, }; diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index ceb84175..7b54af8a 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,5 +1,3 @@ - - // TODO : it have to be changed. class PatiantInformtion { @@ -55,114 +53,129 @@ class PatiantInformtion { String nursingStationName; String startTime; String visitType; - - PatiantInformtion({ - this.list, - this.projectId, - this.clinicId, - this.doctorId, - this.patientId, - this.doctorName, - this.doctorNameN, - this.firstName, - this.middleName, - this.lastName, - this.firstNameN, - this.middleNameN, - this.lastNameN, - this.gender, - this.dateofBirth, - this.nationalityId, - this.mobileNumber, - this.emailAddress, - this.patientIdentificationNo, - this.patientType, - this.admissionNo, - this.admissionDate, - this.createdOn, - this.roomId, - this.bedId, - this.nursingStationId, - this.description, - this.clinicDescription, - this.clinicDescriptionN, - this.nationalityName, - this.nationalityNameN, - this.age, - this.genderDescription, - this.nursingStationName, - this.appointmentDate, - this.startTime, - this.appointmentNo, - this.appointmentType, - this.arrivedOn, - this.clinicGroupId, - this.companyName, - this.dischargeStatus, - this.doctorDetails, - this.endTime, - this.episodeNo, - this.fallRiskScore, - this.genderInt, - this.isSigned, - this.medicationOrders, - this.nationality, - this.patientMRN, - this.visitType, - }); + String nationalityFlagURL; + int patientStatusType; + PatiantInformtion( + {this.list, + this.projectId, + this.clinicId, + this.doctorId, + this.patientId, + this.doctorName, + this.doctorNameN, + this.firstName, + this.middleName, + this.lastName, + this.firstNameN, + this.middleNameN, + this.lastNameN, + this.gender, + this.dateofBirth, + this.nationalityId, + this.mobileNumber, + this.emailAddress, + this.patientIdentificationNo, + this.patientType, + this.admissionNo, + this.admissionDate, + this.createdOn, + this.roomId, + this.bedId, + this.nursingStationId, + this.description, + this.clinicDescription, + this.clinicDescriptionN, + this.nationalityName, + this.nationalityNameN, + this.age, + this.genderDescription, + this.nursingStationName, + this.appointmentDate, + this.startTime, + this.appointmentNo, + this.appointmentType, + this.arrivedOn, + this.clinicGroupId, + this.companyName, + this.dischargeStatus, + this.doctorDetails, + this.endTime, + this.episodeNo, + this.fallRiskScore, + this.genderInt, + this.isSigned, + this.medicationOrders, + this.nationality, + this.patientMRN, + this.visitType, + this.nationalityFlagURL, + this.patientStatusType}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - projectId: json["ProjectID"] ?? json["projectID"], - clinicId: json["ClinicID"]?? json["clinicID"], - doctorId: json["DoctorID"]?? json["doctorID"], - patientId: json["PatientID"]?? json["patientID"]??json['patientMRN'] ?? json['PatientMRN'], - doctorName: json["DoctorName"]?? json["doctorName"], - doctorNameN: json["DoctorNameN"]?? json["doctorNameN"], - firstName: json["FirstName"]?? json["firstName"], - middleName: json["MiddleName"]?? json["middleName"], - lastName: json["LastName"]?? json["lastName"], - firstNameN: json["FirstNameN"]?? json["firstNameN"], - middleNameN: json["MiddleNameN"]?? json["middleNameN"], - lastNameN: json["LastNameN"]?? json["lastNameN"], - gender: json["Gender"]?? json["gender"], - dateofBirth: json["DateofBirth"]?? json["dob"], - nationalityId: json["NationalityID"]?? json["nationalityID"], - mobileNumber: json["MobileNumber"]?? json["mobileNumber"], - emailAddress: json["EmailAddress"]?? json["emailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"]?? json["patientIdentificationNo"], - patientType: json["PatientType"]?? json["patientType"], - admissionNo: json["AdmissionNo"]?? json["admissionNo"], - admissionDate: json["AdmissionDate"]?? json["admissionDate"], - createdOn: json["CreatedOn"]?? json["CreatedOn"], - roomId: json["RoomID"]?? json["roomID"], - bedId: json["BedID"]?? json["bedID"], - nursingStationId: json["NursingStationID"]?? json["nursingStationID"], - description: json["Description"]?? json["description"], - clinicDescription: json["ClinicDescription"]?? json["clinicDescription"], - clinicDescriptionN: json["ClinicDescriptionN"]?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"]?? json["nationalityName"]??json['NationalityName'], - nationalityNameN: json["NationalityNameN"]?? json["nationalityNameN"]??json['NationalityNameN'], - age: json["Age"]?? json["age"], - genderDescription: json["GenderDescription"], - nursingStationName: json["NursingStationName"], - appointmentDate: json["AppointmentDate"]?? '', - startTime: json["StartTime"], - appointmentNo :json['appointmentNo'] ?? json['AppointmentNo'], - appointmentType :json['appointmentType'], - arrivedOn :json['arrivedOn'], - clinicGroupId :json['clinicGroupId'], - companyName :json['companyName'], - dischargeStatus :json['dischargeStatus'], - doctorDetails :json['doctorDetails'], - endTime :json['endTime'], - episodeNo :json['episodeNo'] ?? json['EpisodeID'], - fallRiskScore :json['fallRiskScore'], - isSigned :json['isSigned'], - medicationOrders :json['medicationOrders'], - nationality :json['nationality']??json['NationalityNameN'], - patientMRN :json['patientMRN'] ?? json['PatientMRN'], - visitType :json['visitType'] ?? json['visitType'], - ); - + projectId: json["ProjectID"] ?? json["projectID"], + clinicId: json["ClinicID"] ?? json["clinicID"], + doctorId: json["DoctorID"] ?? json["doctorID"], + patientId: json["PatientID"] ?? + json["patientID"] ?? + json['patientMRN'] ?? + json['PatientMRN'], + doctorName: json["DoctorName"] ?? json["doctorName"], + doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], + firstName: json["FirstName"] ?? json["firstName"], + middleName: json["MiddleName"] ?? json["middleName"], + lastName: json["LastName"] ?? json["lastName"], + firstNameN: json["FirstNameN"] ?? json["firstNameN"], + middleNameN: json["MiddleNameN"] ?? json["middleNameN"], + lastNameN: json["LastNameN"] ?? json["lastNameN"], + gender: json["Gender"] ?? json["gender"], + dateofBirth: json["DateofBirth"] ?? json["dob"], + nationalityId: json["NationalityID"] ?? json["nationalityID"], + mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], + emailAddress: json["EmailAddress"] ?? json["emailAddress"], + patientIdentificationNo: json["PatientIdentificationNo"] ?? + json["patientIdentificationNo"], + patientType: json["PatientType"] ?? json["patientType"], + admissionNo: json["AdmissionNo"] ?? json["admissionNo"], + admissionDate: json["AdmissionDate"] ?? json["admissionDate"], + createdOn: json["CreatedOn"] ?? json["CreatedOn"], + roomId: json["RoomID"] ?? json["roomID"], + bedId: json["BedID"] ?? json["bedID"], + nursingStationId: + json["NursingStationID"] ?? json["nursingStationID"], + description: json["Description"] ?? json["description"], + clinicDescription: + json["ClinicDescription"] ?? json["clinicDescription"], + clinicDescriptionN: + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"] ?? + json["nationalityName"] ?? + json['NationalityName'], + nationalityNameN: json["NationalityNameN"] ?? + json["nationalityNameN"] ?? + json['NationalityNameN'], + age: json["Age"] ?? json["age"], + genderDescription: json["GenderDescription"], + nursingStationName: json["NursingStationName"], + appointmentDate: json["AppointmentDate"] ?? '', + startTime: json["startTime"], + appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], + appointmentType: json['appointmentType'], + arrivedOn: json['arrivedOn'], + clinicGroupId: json['clinicGroupId'], + companyName: json['companyName'], + dischargeStatus: json['dischargeStatus'], + doctorDetails: json['doctorDetails'], + endTime: json['endTime'], + episodeNo: json['episodeNo'] ?? json['EpisodeID'], + fallRiskScore: json['fallRiskScore'], + isSigned: json['isSigned'], + medicationOrders: json['medicationOrders'], + nationality: json['nationality'] ?? json['NationalityNameN'], + patientMRN: json['patientMRN'] ?? json['PatientMRN'], + visitType: json['visitType'] ?? json['visitType'], + nationalityFlagURL: + json['NationalityFlagURL'] ?? json['NationalityFlagURL'], + patientStatusType: + json['patientStatusType'] ?? json['patientStatusType']); } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 77bbe042..67218e02 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -753,7 +753,7 @@ class _DashboardScreenState extends State { SizedBox( height: 15, ), - sliderActiveIndex == 0 + sliderActiveIndex == 1 ? Column( children: [ Row( @@ -793,7 +793,7 @@ class _DashboardScreenState extends State { }))) ], ) - : sliderActiveIndex == 1 + : sliderActiveIndex == 0 ? Column( children: [ Row( @@ -988,7 +988,8 @@ class _DashboardScreenState extends State { Navigator.of(context) .pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, - "selectedType": "7" + "selectedType": "7", + "arrivalType": "1" }); }, ), @@ -1024,12 +1025,6 @@ class _DashboardScreenState extends State { builder: (context) => SearchMedicinePatientScreen(), )); - - // Navigator.of(context) - // .pushNamed(PATIENTS, arguments: { - // "patientSearchForm": _patientSearchFormValues, - // "selectedType": "7" - // }); }, ) ], @@ -1037,132 +1032,6 @@ class _DashboardScreenState extends State { SizedBox( height: 10, ), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceBetween, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // DashboardItem( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Center( - // child: Icon( - // DoctorApp.search_patient_1, - // size: 50, - // color: Colors.black, - // ), - // ), - // Column( - // children: [ - // AppText( - // TranslationBase.of(context).searchAbout, - // color: Colors.black, - // textAlign: TextAlign.center, - // ), - // AppText( - // TranslationBase.of(context).patient, - // color: Colors.black, - // textAlign: TextAlign.center, - // ) - // ], - // ) - // ], - // ), - // hasBorder: true, - // onTap: () { - // Navigator.of(context).pushNamed(PATIENT_SEARCH); - // }, - // ), - // DashboardItem( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Icon( - // DoctorApp.medicine_search, - // size: 50, - // color: Colors.black, - // ), - // AppText( - // TranslationBase.of(context).searchMedicine, - // color: Colors.black, - // textAlign: TextAlign.center, - // ) - // ], - // ), - // hasBorder: true, - // onTap: () { - // // Navigator.push( - // // context, - // // MaterialPageRoute( - // // builder: (context) => MedicineSearchScreen(), - // // ), - // // ); - // }, - // ), - // DashboardItem( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Icon( - // DoctorApp.leaves, - // size: 50, - // ), - // AppText( - // TranslationBase.of(context).rescheduleLeaves, - // color: Colors.black, - // textAlign: TextAlign.center, - // ) - // ], - // ), - // hasBorder: true, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => - // AddRescheduleLeavScreen(), - // // MyReferredPatient(), - // ), - // ); - // }, - // ), -// DashboardItem( -// child: Column( -// mainAxisAlignment: MainAxisAlignment.spaceAround, -// children: [ -// Icon( -// DoctorApp.qr_code, -// size: 50, -// color: Colors.black, -// ), -// Column( -// children: [ -// AppText( -// projectsProvider.isArabic -// ? TranslationBase.of(context).reader -// : TranslationBase.of(context).qr, -// color: Colors.black, -// textAlign: TextAlign.center, -// ), -// AppText( -// projectsProvider.isArabic -// ? TranslationBase.of(context).qr -// : TranslationBase.of(context).reader, -// color: Colors.black, -// textAlign: TextAlign.center, -// ), -// ], -// ) -// ], -// ), -// // imageName: '1.png', -// hasBorder: true, -// onTap: () { -// Navigator.of(context).pushNamed(QR_READER); -// }, -// ), - //], - //), SizedBox( height: 20, ), @@ -1173,41 +1042,6 @@ class _DashboardScreenState extends State { SizedBox( width: 8, ), - // DashboardItem( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Icon( - // DoctorApp.mail, - // size: 50, - // color: Colors.black, - // ), - // Column( - // children: [ - // AppText( - // TranslationBase.of(context).theDoctor, - // textAlign: TextAlign.center, - // color: Colors.black, - // ), - // AppText( - // TranslationBase.of(context).reply, - // textAlign: TextAlign.center, - // color: Colors.black, - // ), - // ], - // ) - // ], - // ), - // hasBorder: true, - // onTap: () { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => DoctorReplyScreen(), - // ), - // ); - // }, - // ) ], ), SizedBox( @@ -1224,41 +1058,6 @@ class _DashboardScreenState extends State { ); } - // static List> _createInpatientData(model) { - // final data = [ - // new GaugeSegment( - // model.dashboardItemsList[0].summaryoptions[0].kPIParameter, - // getValue(model.dashboardItemsList[0].summaryoptions[0].value), - // charts.MaterialPalette.blue.shadeDefault), - // new GaugeSegment( - // model.dashboardItemsList[0].summaryoptions[1].kPIParameter, - // getValue(model.dashboardItemsList[0].summaryoptions[1].value), - // charts.MaterialPalette.cyan.shadeDefault), - // new GaugeSegment( - // model.dashboardItemsList[0].summaryoptions[2].kPIParameter, - // getValue(model.dashboardItemsList[0].summaryoptions[2].value), - // charts.MaterialPalette.red.shadeDefault), - // new GaugeSegment( - // model.dashboardItemsList[0].summaryoptions[3].kPIParameter, - // getValue(model.dashboardItemsList[0].summaryoptions[3].value), - // charts.MaterialPalette.deepOrange.shadeDefault.lighter), - // new GaugeSegment( - // model.dashboardItemsList[0].summaryoptions[4].kPIParameter, - // getValue(model.dashboardItemsList[0].summaryoptions[4].value), - // charts.MaterialPalette.green.shadeDefault), - // ]; - - // return [ - // new charts.Series( - // id: 'Segments', - // domainFn: (GaugeSegment segment, _) => segment.segment, - // measureFn: (GaugeSegment segment, _) => segment.size, - // data: data, - // colorFn: (GaugeSegment segment, _) => segment.color, - // ) - // ]; - // } - static List> _createReferralData(model) { final data = [ new GaugeSegment( @@ -1290,71 +1089,6 @@ class _DashboardScreenState extends State { return value == 0 ? 1 : value; } - // showCupertinoPicker( - // {context, List actionList, decKey, onSelectFun}) { - // showModalBottomSheet( - // isDismissible: false, - // isScrollControlled: true, - // context: context, - // builder: (BuildContext builder) { - // return Container( - // // height: 500, - // height: SizeConfig.realScreenHeight * 0.4, - // color: Color(0xfff7f7f7), - // child: Column( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // Container( - // color: Color(0xfff7f7f7), - // child: Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // CupertinoButton( - // child: AppText(TranslationBase.of(context).cancel - // // style: TextStyle(context) - // ), - // onPressed: () { - // Navigator.pop(context); - // }, - // ), - // CupertinoButton( - // child: AppText(TranslationBase.of(context).done - // // style: textStyle(context), - // ), - // onPressed: () { - // Navigator.pop(context); - // // onSelectFun(cupertinoPickerIndex); - // }, - // ) - // ], - // ), - // ), - // Container( - // height: SizeConfig.realScreenHeight * 0.3, - // color: Color(0xfff7f7f7), - // child: Column( - // children: actionList - // .map((e) => Flexible( - // child: Container( - // height: 50, - // child: InkWell( - // onTap: () => changeClinic( - // e.clinicID, context, model), - // child: AppText( - // e.clinicName, - // fontSize: - // SizeConfig.textMultiplier * 1.9, - // )), - // ), - // )) - // .toList(), - // )) - // ], - // ), - // ); - // }); - // } - changeClinic(clinicId, BuildContext context, model) async { // Navigator.pop(context); changeIsLoading(true); @@ -1528,80 +1262,13 @@ class _DashboardScreenState extends State { margin: 5, child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[0]))), + child: getOutPatientStack(model.dashboardItemsList[1]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.32, margin: 5, child: Padding( padding: const EdgeInsets.all(5.0), - child: getOutPatientStack(model.dashboardItemsList[1]))), - // Column( - // mainAxisAlignment: MainAxisAlignment.spaceEvenly, - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // rowCount( - // model.dashboardItemsList[0] - // .summaryoptions[0].kPIParameter, - // model.dashboardItemsList[0] - // .summaryoptions[0].value, - // Colors.blue), - // rowCount( - // model.dashboardItemsList[0] - // .summaryoptions[1].kPIParameter, - // model.dashboardItemsList[0] - // .summaryoptions[1].value, - // Colors.cyan), - // rowCount( - // model.dashboardItemsList[0] - // .summaryoptions[2].kPIParameter, - // model.dashboardItemsList[0] - // .summaryoptions[2].value, - // Colors.red), - // rowCount( - // model.dashboardItemsList[0] - // .summaryoptions[3].kPIParameter, - // model.dashboardItemsList[0] - // .summaryoptions[3].value, - // Colors.orange), - // rowCount( - // model.dashboardItemsList[0] - // .summaryoptions[4].kPIParameter, - // model.dashboardItemsList[0] - // .summaryoptions[4].value, - // Colors.green), - // ], - // ))), - // Expanded( - // flex: 3, - // child: Stack(children: [ - // Container( - // child: GaugeChart(_createInpatientData(model))), - // Positioned( - // child: Center( - // child: Column( - // children: [ - // AppText( - // TranslationBase.of(context).inPatient, - // fontSize: 11, - // fontWeight: FontWeight.bold, - // ), - // AppText( - // getPatientCount(model.dashboardItemsList[0]) - // .toString(), - // fontSize: 18, - // fontWeight: FontWeight.bold, - // ) - // ], - // )), - // top: MediaQuery.of(context).size.height * 0.12, - // left: MediaQuery.of(context).size.width * 0.11) - // ])), - // ], - // ) - - // ), - //]) - //), + child: getOutPatientStack(model.dashboardItemsList[0]))), RoundedContainer( height: MediaQuery.of(context).size.height * 0.24, margin: 5, @@ -1653,18 +1320,6 @@ class _DashboardScreenState extends State { model.dashboardItemsList[2] .summaryoptions[2].value, Colors.red), - // rowCount( - // model.dashboardItemsList[2] - // .summaryoptions[3].kPIParameter, - // model.dashboardItemsList[2] - // .summaryoptions[3].value, - // Colors.orange), - // rowCount( - // model.dashboardItemsList[2] - // .summaryoptions[4].kPIParameter, - // model.dashboardItemsList[2] - // .summaryoptions[4].value, - // Colors.green), ], ), ) @@ -1679,12 +1334,6 @@ class _DashboardScreenState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.center, children: [ - // AppText( - // TranslationBase.of(context)., - // fontSize: 11, - // fontWeight: FontWeight.bold, - // textOverflow: TextOverflow.ellipsis, - // ), AppText( getPatientCount(model.dashboardItemsList[2]) .toString(), @@ -1701,154 +1350,6 @@ class _DashboardScreenState extends State { ], )), ])), - // RoundedContainer( - // height: MediaQuery.of(context).size.height * 0.24, - // margin: 5, - // child: Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // children: [ - // Padding( - // padding: EdgeInsets.all(10), - // child: AppText(TranslationBase.of(context).otherStatistic)), - // Row( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // crossAxisAlignment: CrossAxisAlignment.center, - // children: [ - // DashboardItem( - // width: MediaQuery.of(context).size.width * 0.25, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.18 - // : MediaQuery.of(context).size.height * 0.36, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Container( - // margin: EdgeInsets.only(top: 5), - // child: Icon( - // DoctorApp.lab_results, - // size: 40, - // color: Colors.black, - // ), - // ), - // Container( - // // margin: EdgeInsets.only(bottom: 10), - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[5]) - // : "", - // fontSize: SizeConfig.textMultiplier * 6, - // color: Colors.black, - // ), - // AppText( - // TranslationBase.of(context).targetPatient, - // textAlign: TextAlign.center, - // color: Colors.black, - // ) - // ], - // ), - // ), - // ], - // ), - // //imageName: '1.png', - // opacity: 0, - // ), - // Container( - // color: Colors.black12, - // height: MediaQuery.of(context).size.height * 0.18, - // width: 1, - // ), - // DashboardItem( - // width: MediaQuery.of(context).size.width * 0.25, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.18 - // : MediaQuery.of(context).size.height * 0.36, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Container( - // margin: EdgeInsets.only(top: 5), - // child: Icon( - // DoctorApp.radiology, - // size: 40, - // color: Colors.black, - // ), - // ), - // Container( - // margin: EdgeInsets.only(bottom: 5), - // child: Column( - // children: [ - // AppText( - // clinicName.length.toString(), - // fontSize: SizeConfig.textMultiplier * 6, - // color: Colors.black, - // ), - // AppText( - // TranslationBase.of(context).clinic, - // color: Colors.black, - // ) - // ], - // ), - // ), - // ], - // ), - // //imageName: '2.png', - // opacity: 0, - // ), - // Container( - // color: Colors.black12, - // height: MediaQuery.of(context).size.height * 0.18, - // width: 1, - // ), - // DashboardItem( - // width: MediaQuery.of(context).size.width * 0.25, - // height: MediaQuery.of(context).orientation == - // Orientation.portrait - // ? MediaQuery.of(context).size.height * 0.18 - // : MediaQuery.of(context).size.height * 0.36, - // child: Column( - // mainAxisAlignment: MainAxisAlignment.spaceAround, - // children: [ - // Container( - // margin: EdgeInsets.only(top: 5), - // child: Icon( - // DoctorApp.referral, - // size: 40, - // color: Colors.black, - // ), - // ), - // Container( - // margin: EdgeInsets.only(bottom: 5), - // child: Column( - // children: [ - // AppText( - // model.dashboardItemsList.length > 0 - // ? getPatientCount( - // model.dashboardItemsList[2]) - // : "", - // fontSize: SizeConfig.textMultiplier * 6, - // color: Colors.black, - // ), - // AppText( - // TranslationBase.of(context).referral, - // color: Colors.black, - // ) - // ], - // ), - // ), - // ], - // ), - // //imageName: '3.png', - // opacity: 0, - // ), - // ], - // ) - // ], - // )) ]; } } diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0febe68b..06a5d92d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -33,8 +33,12 @@ class PatientsScreen extends StatefulWidget { final patientSearchForm; final selectedType; final isAppbar; + final arrivalType; PatientsScreen( - {this.patientSearchForm, this.selectedType, this.isAppbar = true}); + {this.patientSearchForm, + this.selectedType, + this.isAppbar = true, + this.arrivalType}); @override _PatientsScreenState createState() => _PatientsScreenState(); } @@ -70,6 +74,7 @@ class _PatientsScreenState extends State { var selectedFilter = 1; bool _isError = false; String error = ""; + String arrivalType; ProjectViewModel projectsProvider; final _controller = TextEditingController(); @@ -85,8 +90,13 @@ class _PatientsScreenState extends State { for (var i = 0; i < responseModelList2.length; i++) { String firstName = responseModelList[i].firstName.toUpperCase(); String lastName = responseModelList[i].lastName.toUpperCase(); + String mobile = responseModelList[i].mobileNumber.toUpperCase(); + String patientID = responseModelList[i].patientId.toString(); + if (firstName.contains(str.toUpperCase()) || - lastName.contains(str.toUpperCase())) { + lastName.contains(str.toUpperCase()) || + mobile.contains(str) || + patientID.contains(str)) { filterData.add(responseModelList[i]); } } @@ -220,7 +230,9 @@ class _PatientsScreenState extends State { patientType = widget.selectedType != null ? widget.selectedType : routeArgs['selectedType']; - + arrivalType = widget.arrivalType != null + ? widget.arrivalType + : routeArgs['arrivalType']; if (routeArgs != null && routeArgs.containsKey("isSearch")) { isSearch = routeArgs['isSearch']; } @@ -355,7 +367,7 @@ class _PatientsScreenState extends State { Container( width: SizeConfig.screenWidth * 0.9, height: - SizeConfig.screenHeight * 0.07, + SizeConfig.screenHeight * 0.08, child: TextField( controller: _controller, onChanged: (String str) { @@ -364,21 +376,30 @@ class _PatientsScreenState extends State { decoration: buildInputDecoration( context, TranslationBase.of(context) - .searchPatient), + .searchPatientName), ), ), SizedBox( height: 10.0, ), if (int.parse(patientType) == 7) - ClinicList( - clinicId: clinicId, - onClinicChange: (newValue) { - clinicId = newValue; - changeClinic( - newValue, context, model); - }, - ), + Container( + padding: EdgeInsets.all(5), + decoration: BoxDecoration( + color: Colors.white, + border: Border.all( + color: Colors.grey), + borderRadius: + BorderRadius.circular( + 10)), + child: ClinicList( + clinicId: clinicId, + onClinicChange: (newValue) { + clinicId = newValue; + changeClinic( + newValue, context, model); + }, + )), Padding( padding: EdgeInsets.only( top: MediaQuery.of(context) @@ -482,6 +503,7 @@ class _PatientsScreenState extends State { return PatientCard( patientInfo: item, patientType: patientType, + arrivalType: arrivalType, onTap: () { Navigator.of(context) .pushNamed( @@ -494,7 +516,6 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, - "isSearch":isSearch }); }, ); @@ -574,6 +595,11 @@ class _PatientsScreenState extends State { } parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList.sort((a, b) { + var adate = a.arrivedOn; + var bdate = b.arrivedOn; //before -> var bdate = b.expiry; + return adate.compareTo(bdate); + }); responseModelList2 = responseModelList; _isError = false; } else { @@ -599,10 +625,10 @@ class _PatientsScreenState extends State { InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( suffixIcon: IconButton( - icon: new Image.asset("assets/images/filter-512.png"), + icon: Icon(DoctorApp.search_patient), color: Colors.grey, onPressed: () {}, - iconSize: 20, + iconSize: 30, ), filled: true, fillColor: Colors.white, diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 4f9543c1..8a4cfbd0 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -421,4 +421,8 @@ class Helpers { static hideKeyboard(BuildContext context) { FocusScope.of(context).unfocus(); } + + static String capitalize(str) { + return "${str[0].toUpperCase()}${str.substring(1).toLowerCase()}"; + } } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 8c8afde2..2df3339f 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -70,6 +70,8 @@ class TranslationBase { String get searchPatient => localizedValues['searchPatient'][locale.languageCode]; + String get searchPatientName => + localizedValues['searchPatient-name'][locale.languageCode]; String get searchAbout => localizedValues['searchAbout'][locale.languageCode]; @@ -1136,6 +1138,9 @@ class TranslationBase { String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; + String get reschedule => localizedValues['reschedule'][locale.languageCode]; + String get leaves => localizedValues['leaves'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 8839c47c..d7f6a816 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -695,7 +695,7 @@ class _VerificationMethodsState extends State { this.checkActivationCode(authProv, value: value); }, () => { - //Navigator.pop(context), + Navigator.pop(context), print('Faild..'), }, ).displayDialog(context); diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 98d2a8f5..997cb83d 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.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'; @@ -15,200 +16,275 @@ class PatientCard extends StatelessWidget { final PatiantInformtion patientInfo; final Function onTap; final String patientType; - const PatientCard({Key key, this.patientInfo, this.onTap, this.patientType}) + final String arrivalType; + const PatientCard( + {Key key, + this.patientInfo, + this.onTap, + this.patientType, + this.arrivalType}) : super(key: key); @override Widget build(BuildContext context) { return Container( - width: SizeConfig.screenWidth * 0.95, - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + width: SizeConfig.screenWidth * 0.9, + margin: EdgeInsets.all(6), + padding: EdgeInsets.only(left: 0, right: 5, bottom: 5, top: 5), 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, - ), - isToday(patientInfo.arrivedOn) == false - ? AppText(DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, 'mm-dd-yyyy hh:mm')) - : AppText(DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, 'hh:mm')) - ], - ) - : SizedBox(), - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Row(children: [ - AppText( - patientInfo.firstName + " " + patientInfo.lastName, - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - ), - patientInfo.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - AppText( - patientInfo.nationalityName ?? patientInfo.nationality, - fontWeight: FontWeight.bold, - ) - ], - )), - Row(children: [ - Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ + borderRadius: BorderRadius.circular(15), + color: Colors.white, + ), + child: Stack(children: [ + Container( + height: MediaQuery.of(context).size.height * .17, + width: 5, + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10)), + color: patientInfo.patientStatusType == 43 + ? Colors.green[500] + : Colors.red[800], + )), + Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + child: InkWell( + child: Column( + children: [ + SizedBox( + height: 10, + ), + SERVICES_PATIANT2[int.parse(patientType)] == + "patientArrivalList" + ? Padding( + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + patientInfo.patientStatusType == 43 + ? AppText( + TranslationBase.of(context).arrivedP, + color: Colors.green, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of(context).notArrived, + color: Colors.red[800], + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 12, + ), + this.arrivalType == '1' + ? AppText( + patientInfo.startTime != null + ? patientInfo.startTime + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + )) + : SizedBox(), 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) + padding: EdgeInsets.only(left: 12.0), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row(children: [ + AppText( + (Helpers.capitalize(patientInfo.firstName) + + " " + + Helpers.capitalize(patientInfo.lastName)), + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patientInfo.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + Row( + children: [ + AppText( + patientInfo.nationalityName ?? + patientInfo.nationality, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + patientInfo.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + patientInfo.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + ) ], - borderRadius: BorderRadius.all(Radius.circular(35.0)), - color: Color(0xffCCCCCC), - ), - width: 70, - height: 70, - child: Icon( - patientInfo.gender == 1 - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), - ), - ), - ], - ), - 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: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).age + " : ", + )), + 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), + // ), + width: 60, + height: 60, + child: Image.asset( + patientInfo.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), - new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", - style: TextStyle( - fontWeight: FontWeight.w700, - )), - ], + ), ), - ), + ], ), - 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: 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) + .fileNumber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientId.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - SizedBox( - width: 3.5, + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patientInfo.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), + ), + if (SERVICES_PATIANT2[int.parse(patientType)] == + "List_MyOutPatient") Container( - child: AppText( - convertDateFormat2( - patientInfo.appointmentDate.toString()), - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + 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, ), - ), - SizedBox( - height: 0.5, ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ) - ])) - ]), - ], - ), - onTap: onTap, - )); + ])) + ]), + ], + ), + onTap: onTap, + )) + ])); // ]), // TableRow(children: [ diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 7f4d0caf..590f09d6 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -142,8 +142,11 @@ class _AppDrawerState extends State { }, ), InkWell( - child: DrawerItem(TranslationBase.of(context).rescheduleLeaves, - DoctorApp.leaves), + child: DrawerItem( + TranslationBase.of(context).reschedule, + DoctorApp.leaves, + subTitle: TranslationBase.of(context).leaves, + ), onTap: () { Navigator.pop(context); diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 9696aa1f..83afb860 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -42,6 +42,7 @@ class _DrawerItemState extends State { AppText( widget.title, color: widget.color ?? Colors.black, + textOverflow: TextOverflow.ellipsis, // fontWeight: FontWeight.bold, // margin: 5, marginLeft: 5, diff --git a/pubspec.yaml b/pubspec.yaml index 6dd072f5..6bc1526a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -122,6 +122,15 @@ flutter: - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf - asset: assets/fonts/Work_Sans/WorkSans-Bold.ttf weight: 700 + + - family: Poppins + fonts: + - asset: assets/fonts/Poppins/Poppins-Regular.ttf + - asset: assets/fonts/Poppins/Poppins-Medium.ttf + - asset: assets/fonts/Poppins/Poppins-Bold.ttf + weight: 700 + + # - family: Trajan Pro # fonts: # - asset: fonts/TrajanPro.ttf From 93caeb38763fa96cb8588f667f1d583da0677562 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 22 Mar 2021 20:53:14 +0300 Subject: [PATCH 372/421] search screen updated --- lib/screens/medicine/medicine_search_screen.dart | 8 +++----- lib/screens/medicine/search_medicine_patient_screen.dart | 1 + lib/screens/patients/patient_search_screen.dart | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index ea891f3e..b56104d2 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -129,20 +129,18 @@ class _MedicineSearchState extends State { widthFactor: 0.97, child: SingleChildScrollView( child: Container( + color: Colors.white, // height: SizeConfig.screenHeight, child: Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - SizedBox( - height: SizeConfig.screenHeight * .16, - ), + SizedBox(height: 100), Column(children: [ FractionallySizedBox( widthFactor: 0.9, child: Column( children: [ Container( - // height: MediaQuery.of(context).size.height * 0.070, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -209,7 +207,7 @@ class _MedicineSearchState extends State { ) ]), SizedBox( - height: SizeConfig.screenHeight * .5, + height: SizeConfig.screenHeight * .55, ), Column( children: [ diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index d16bfc2c..0e4d7e86 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -52,6 +52,7 @@ class _SearchMedicinePatientScreen extends State height: 60.0, color: Colors.white, margin: EdgeInsets.only(top: 10.0), + width: MediaQuery.of(context).size.width, // 0.9, // decoration: BoxDecoration( // border: Border( diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 492e7d5e..5995355a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -510,7 +510,7 @@ class _PatientSearchScreenState extends State { ), ]) : SizedBox( - height: SizeConfig.screenHeight * .4, + height: SizeConfig.screenHeight * .45, ), ], ), From 3928165570b41440cc2bfe08b9042f1f6729dcb6 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 22 Mar 2021 23:08:26 +0200 Subject: [PATCH 373/421] get Prescription history fix --- .../profile/profile_medical_info_widget.dart | 190 +++++++++--------- pubspec.lock | 6 +- 2 files changed, 97 insertions(+), 99 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index fb0ef609..60a0154e 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -36,72 +36,70 @@ class ProfileMedicalInfoWidget extends StatelessWidget { childAspectRatio: 1.5, children: [ if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo != 0 ? true : false, - nameLine1: TranslationBase.of(context).createNew, - nameLine2: TranslationBase.of(context).episode, - route: CREATE_EPISODE, - onTap: () async { - PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, - patientMRN: patient.patientMRN); - await model.postEpisode(postEpisodeReqModel); - patient.episodeNo = model.episodeID; - Navigator.of(context) - .pushNamed(CREATE_EPISODE, arguments: {'patient': patient}); - }, - isLoading: model.state == ViewState.BusyLocal, - icon: 'create-episod.png'), + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo != 0 ? true : false, + nameLine1: TranslationBase.of(context).createNew, + nameLine2: TranslationBase.of(context).episode, + route: CREATE_EPISODE, + onTap: () async { + PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + await model.postEpisode(postEpisodeReqModel); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed(CREATE_EPISODE, + arguments: {'patient': patient}); + }, + isLoading: model.state == ViewState.BusyLocal, + icon: 'create-episod.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - isDisable: patient.episodeNo == 0 ? true : false, - nameLine1: TranslationBase.of(context).update, - nameLine2: TranslationBase.of(context).episode, - route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), - + PatientProfileButton( + key: key, + patient: patient, + isDisable: patient.episodeNo == 0 ? true : false, + nameLine1: TranslationBase.of(context).update, + nameLine2: TranslationBase.of(context).episode, + route: UPDATE_EPISODE, + icon: 'modilfy-episode.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'radiology-1.png'), + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'radiology-1.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'lab.png'), - + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - from: from, - to: to, - nameLine1: TranslationBase.of(context).vital, - nameLine2: TranslationBase.of(context).signs, - route: - VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN + PatientProfileButton( + key: key, + patient: patient, + from: from, + to: to, + nameLine1: TranslationBase.of(context).vital, + nameLine2: TranslationBase.of(context).signs, + route: + VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN */ - , - icon: 'heartbeat.png'), + , + icon: 'heartbeat.png'), if (selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: LAB_ORDERS, - nameLine1: TranslationBase.of(context).lab, - nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: LAB_ORDERS, + nameLine1: TranslationBase.of(context).lab, + nameLine2: TranslationBase.of(context).result, + icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, @@ -112,26 +110,26 @@ class ProfileMedicalInfoWidget extends StatelessWidget { if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) - PatientProfileButton( - key: key, - patient: patient, - route: PROGRESS_NOTE, - nameLine1: TranslationBase.of(context).progress, - nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PROGRESS_NOTE, + nameLine1: TranslationBase.of(context).progress, + nameLine2: TranslationBase.of(context).note, + icon: 'heartbeat.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_ADMISSION_REQUEST, - nameLine1: TranslationBase.of(context).admission, - nameLine2: TranslationBase.of(context).request, - icon: 'heartbeat.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ADMISSION_REQUEST, + nameLine1: TranslationBase.of(context).admission, + nameLine2: TranslationBase.of(context).request, + icon: 'heartbeat.png'), (int.parse(patientType) == 7 || int.parse(patientType) == 6) ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') @@ -151,29 +149,29 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine2: TranslationBase.of(context).procedures, icon: 'lab.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: REFER_PATIENT_TO_DOCTOR, - nameLine1: TranslationBase.of(context).myReferral, - nameLine2: TranslationBase.of(context).patient, - icon: 'note.png'), + PatientProfileButton( + key: key, + patient: patient, + route: REFER_PATIENT_TO_DOCTOR, + nameLine1: TranslationBase.of(context).myReferral, + nameLine2: TranslationBase.of(context).patient, + icon: 'note.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: ADD_SICKLEAVE, - nameLine1: TranslationBase.of(context).patientSick, - nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ADD_SICKLEAVE, + nameLine1: TranslationBase.of(context).patientSick, + nameLine2: TranslationBase.of(context).leave, + icon: 'sick_leaves_icons.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_UCAF_REQUEST, - nameLine1: TranslationBase.of(context).patient, - nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_UCAF_REQUEST, + nameLine1: TranslationBase.of(context).patient, + nameLine2: TranslationBase.of(context).ucaf, + icon: 'lab.png'), ], ), ); diff --git a/pubspec.lock b/pubspec.lock index d044f1fb..909670db 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.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -844,7 +844,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -986,5 +986,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From d0d8d81ae4e3524f9c7fd040861ea85e1b5da1b5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 23 Mar 2021 09:03:25 +0200 Subject: [PATCH 374/421] fix small issue in on search --- lib/screens/patients/patients_screen.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 06a5d92d..2900f56a 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -516,6 +516,7 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, + "isSearch":isSearch }); }, ); From 5903fdd8b82990817ac4ad61be3c9589f651ecd7 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 10:13:17 +0300 Subject: [PATCH 375/421] tab bar changes --- .../search_medicine_patient_screen.dart | 51 +++++++------------ .../referral/patient_referral_screen.dart | 1 + 2 files changed, 20 insertions(+), 32 deletions(-) diff --git a/lib/screens/medicine/search_medicine_patient_screen.dart b/lib/screens/medicine/search_medicine_patient_screen.dart index 0e4d7e86..245c0602 100644 --- a/lib/screens/medicine/search_medicine_patient_screen.dart +++ b/lib/screens/medicine/search_medicine_patient_screen.dart @@ -50,17 +50,15 @@ 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.9, - // decoration: BoxDecoration( - // border: Border( - // bottom: BorderSide( - // color: Theme.of(context).dividerColor, - // width: 0.9), //width: 0.7 - // ), - // color: Colors.white), + 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: TabBar( isScrollable: true, onTap: (index) { @@ -69,42 +67,31 @@ class _SearchMedicinePatientScreen extends State }); }, controller: _tabController, - indicatorWeight: 0.01, - indicatorSize: TabBarIndicatorSize.label, + indicatorWeight: 5.0, + indicatorSize: TabBarIndicatorSize.tab, + indicatorColor: Colors.red[800], labelColor: Theme.of(context).primaryColor, - indicatorColor: Colors.grey[800], - // labelPadding: - // EdgeInsets.only(top: 4.0, left: 35.0, right: 35.0), + 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)), + width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( TranslationBase.of(context).searchPatient, - color: activeIndex == 0 ? Colors.white : Colors.black, + color: Colors.black, fontWeight: FontWeight.bold, ), ), ), Container( - width: MediaQuery.of(context).size.width * 0.40, - decoration: BoxDecoration( - color: activeIndex == 1 - ? Colors.red[700] - : Colors.grey[200], - borderRadius: BorderRadius.circular(5)), + width: MediaQuery.of(context).size.width * 0.30, child: Center( child: AppText( - TranslationBase.of(context).searchMedicine, - fontWeight: FontWeight.bold, - color: activeIndex == 1 ? Colors.white : Colors.black, - ), + TranslationBase.of(context).searchMedicine, + fontWeight: FontWeight.bold, + color: Colors.black), ), ), ], diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index f4b04d02..80f30aad 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -55,6 +55,7 @@ class _PatientReferralScreen extends State child: TabBar( isScrollable: true, controller: _tabController, + indicatorColor: Colors.red[800], indicatorWeight: 5.0, indicatorSize: TabBarIndicatorSize.tab, labelColor: Theme.of(context).primaryColor, From 495898f8c84d90a1872c984fbdcfc72fc717b8ab Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 10:28:08 +0300 Subject: [PATCH 376/421] patient card --- lib/widgets/patients/PatientCard.dart | 35 +++++++++++++++------------ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 997cb83d..93a176ea 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -240,22 +240,25 @@ class PatientCard extends StatelessWidget { " : ", 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, - ), - ), + patientInfo.startTime != null + ? 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(), SizedBox( width: 3.5, ), From 0742d64428bc3a54619250796f6a08670be5cf59 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 23 Mar 2021 10:03:38 +0200 Subject: [PATCH 377/421] add lab result services --- lib/client/base_app_client.dart | 155 ++++++++++++ lib/config/config.dart | 18 ++ lib/config/localized_values.dart | 16 ++ lib/core/enum/filter_type.dart | 2 + lib/core/model/labs/LabOrderResult.dart | 88 +++++++ lib/core/model/labs/lab_result.dart | 98 ++++++++ lib/core/model/labs/patient_lab_orders.dart | 158 ++++++++++++ .../labs/patient_lab_special_result.dart | 32 +++ .../labs/request_patient_lab_orders.dart | 64 +++++ .../request_patient_lab_special_result.dart | 84 +++++++ .../labs/request_send_lab_report_email.dart | 112 +++++++++ lib/core/service/labs_service.dart | 136 ++++++++++ lib/core/viewModel/labs_view_model.dart | 175 +++++++++++++ lib/lookups/patient_lookup.dart | 2 +- .../patients/patient_search_screen.dart | 4 +- .../profile/lab_result/FlowChartPage.dart | 44 ++++ .../profile/lab_result/LabResultWidget.dart | 175 +++++++++++++ .../Lab_Result_details_wideget.dart | 119 +++++++++ .../profile/lab_result/LineChartCurved.dart | 229 +++++++++++++++++ .../lab_result_chart_and_detials.dart | 41 +++ .../lab_result/laboratory_result_page.dart | 55 ++++ .../lab_result/laboratory_result_widget.dart | 235 ++++++++++++++++++ .../profile/lab_result/labs_home_page.dart | 117 +++++++++ lib/util/date-utils.dart | 41 +++ lib/util/dr_app_shared_pref.dart | 7 + lib/util/translations_delegate_base.dart | 11 + lib/widgets/shared/StarRating.dart | 48 ++++ .../shared/app_expandable_notifier_new.dart | 126 ++++++++++ lib/widgets/shared/doctor_card.dart | 198 +++++++++++++++ pubspec.lock | 98 ++++++++ pubspec.yaml | 3 + 31 files changed, 2688 insertions(+), 3 deletions(-) create mode 100644 lib/core/enum/filter_type.dart create mode 100644 lib/core/model/labs/LabOrderResult.dart create mode 100644 lib/core/model/labs/lab_result.dart create mode 100644 lib/core/model/labs/patient_lab_orders.dart create mode 100644 lib/core/model/labs/patient_lab_special_result.dart create mode 100644 lib/core/model/labs/request_patient_lab_orders.dart create mode 100644 lib/core/model/labs/request_patient_lab_special_result.dart create mode 100644 lib/core/model/labs/request_send_lab_report_email.dart create mode 100644 lib/core/service/labs_service.dart create mode 100644 lib/core/viewModel/labs_view_model.dart create mode 100644 lib/screens/patients/profile/lab_result/FlowChartPage.dart create mode 100644 lib/screens/patients/profile/lab_result/LabResultWidget.dart create mode 100644 lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart create mode 100644 lib/screens/patients/profile/lab_result/LineChartCurved.dart create mode 100644 lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart create mode 100644 lib/screens/patients/profile/lab_result/laboratory_result_page.dart create mode 100644 lib/screens/patients/profile/lab_result/laboratory_result_widget.dart create mode 100644 lib/screens/patients/profile/lab_result/labs_home_page.dart create mode 100644 lib/widgets/shared/StarRating.dart create mode 100644 lib/widgets/shared/app_expandable_notifier_new.dart create mode 100644 lib/widgets/shared/doctor_card.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 559f7132..aefd3bb2 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -3,9 +3,12 @@ import 'dart:convert'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:http/http.dart' as http; +import 'dart:io' show Platform; + DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); @@ -120,6 +123,158 @@ class BaseAppClient { } } + postPatient(String endPoint, + {Map body, + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + PatiantInformtion patient, + bool isExternal = false}) async { + String url = BASE_URL + endPoint; + + try { + Map headers = { + 'Content-Type': 'application/json', + 'Accept': 'application/json' + }; + + String token = await sharedPref.getString(TOKEN); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_Language, 'ar'); + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } + + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; + + body['IPAdress'] = IP_ADDRESS; + body['generalid'] = GENERAL_ID; + body['PatientOutSA'] = body.containsKey('PatientOutSA') + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA_PATIENT_REQ + : PATIENT_OUT_SA_PATIENT_REQ; + + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } + + body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; + + + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null + ? body['PatientType'] + : patient.patientType!= null + ? patient.patientType + : PATIENT_TYPE + : PATIENT_TYPE; + + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null + ? body['PatientTypeID'] + : patient.patientType!= null + ? patient.patientType + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; + + body['TokenID'] = token; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : patient.patientId?? patient.patientMRN; + + body['PatientOutSA'] = 0;//user['OutSA']; //TODO change it + body['SessionID'] = SESSION_ID; //getSe + + + print("URL : $url"); + print("Body : ${json.encode(body)}"); + + if (await Helpers.checkConnection()) { + final response = await http.post(url.trim(), + body: json.encode(body), headers: headers); + final int statusCode = response.statusCode; + print("statusCode :$statusCode"); + if (statusCode < 200 || statusCode >= 400 || json == null) { + onFailure('Error While Fetching data', statusCode); + } else { + // var parsed = json.decode(response.body.toString()); + var parsed = json.decode(utf8.decode(response.bodyBytes)); + if (parsed['Response_Message'] != null) { + onSuccess(parsed, statusCode); + } else { + if (parsed['IsAuthenticated'] == null) { + if (parsed['isSMSSent'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 1) { + onSuccess(parsed, statusCode); + } else if (parsed['Result'] == 'OK') { + onSuccess(parsed, statusCode); + } else { + if (parsed != null) { + onSuccess(parsed, statusCode); + } else { + onFailure(getError(parsed), statusCode); + } + } + } else if (parsed['MessageStatus'] == 1 || + parsed['SMSLoginRequired'] == true) { + onSuccess(parsed, statusCode); + } else if (parsed['MessageStatus'] == 2 && + parsed['IsAuthenticated']) { + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); + } else { + if (parsed['message'] == null && + parsed['ErrorEndUserMessage'] == null) { + if (parsed['ErrorSearchMsg'] == null) { + onFailure("Server Error found with no available message", + statusCode); + } else { + onFailure(parsed['ErrorSearchMsg'], statusCode); + } + } else { + onFailure( + parsed['message'] ?? + parsed['ErrorEndUserMessage'] ?? + parsed['ErrorMessage'], + statusCode); + } + } + } else { + if (parsed['SameClinicApptList'] != null) { + onSuccess(parsed, statusCode); + } else { + if (parsed['message'] != null) { + onFailure(parsed['message'] ?? parsed['message'], statusCode); + } else { + onFailure( + parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], + statusCode); + } + } + } + } + } + } else { + onFailure('Please Check The Internet Connection', -1); + } + } catch (e) { + print(e); + onFailure(e.toString(), -1); + } + } + String getError(parsed) { //TODO change this fun String error = parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage']; diff --git a/lib/config/config.dart b/lib/config/config.dart index 4ba98b6b..a512d136 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -143,6 +143,17 @@ const POST_PROCEDURE_LIST = 'Services/DoctorApplication.svc/REST/PostProcedure'; const GET_PATIENT_ARRIVAL_LIST = 'Services/DoctorApplication.svc/REST/PatientArrivalList'; +///Lab Order +const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; +const GET_Patient_LAB_SPECIAL_RESULT = + 'Services/Patients.svc/REST/GetPatientLabSpecialResults'; +const SEND_LAB_RESULT_EMAIL = + 'Services/Notifications.svc/REST/SendLabReportEmail'; +const GET_Patient_LAB_RESULT = + 'Services/Patients.svc/REST/GetPatientLabResults'; +const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; + + // SOAP const GET_ALLERGIES = 'Services/DoctorApplication.svc/REST/GetAllergies'; @@ -274,6 +285,13 @@ const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; const PATIENT_OUT_SA = false; +const IS_DENTAL_ALLOWED_BACKEND = false; +const PATIENT_OUT_SA_PATIENT_REQ = 0; +const SETUP_ID = '91877'; +const GENERAL_ID = 'Cs2020@2016\$2958'; +const PATIENT_TYPE = 1; +const PATIENT_TYPE_ID = 1; + /// Timer Info const TIMER_MIN = 10; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 356c321d..b2ab19b9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -748,4 +748,20 @@ const Map> localizedValues = { }, 'appointmentDate': {'en': "Appointment Date", 'ar': "تاريخ الموعد"}, 'arrived_p': {'en': "Arrived", 'ar': "وصل"}, + 'details': {'en': 'Details', 'ar': 'التفاصيل'}, + "liveCare": {"en": "Live Care", "ar": "لايف كير"}, + "out-patient": {"en": "Out Patient", "ar": "عيادات خارجية"}, + "BillNo": {"en": "Bill No :", "ar": "رقم الفاتورة"}, + "labResults": {"en": "Lab Result", "ar": "نتيجة المختبر"}, + "sendSuc": { + "en": "A copy has been sent to the email", + "ar": "تم إرسال نسخة إلى البريد الإلكتروني" + }, + "SpecialResult": {"en": " Special Result", "ar": "نتيجة خاصة"}, + "noDataAvailable": { + "en": "No data available", + "ar": " لا يوجد بيانات متاحة " + }, + "show-more-btn": {"en": "Flow Chart", "ar": "النتائج التراكمية"}, + }; diff --git a/lib/core/enum/filter_type.dart b/lib/core/enum/filter_type.dart new file mode 100644 index 00000000..4591e023 --- /dev/null +++ b/lib/core/enum/filter_type.dart @@ -0,0 +1,2 @@ +enum FilterType { Clinic, Hospital } + diff --git a/lib/core/model/labs/LabOrderResult.dart b/lib/core/model/labs/LabOrderResult.dart new file mode 100644 index 00000000..ecb4ae65 --- /dev/null +++ b/lib/core/model/labs/LabOrderResult.dart @@ -0,0 +1,88 @@ +class LabOrderResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + dynamic notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + String verifiedOnDateTime; + + LabOrderResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabOrderResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} diff --git a/lib/core/model/labs/lab_result.dart b/lib/core/model/labs/lab_result.dart new file mode 100644 index 00000000..2deb13f3 --- /dev/null +++ b/lib/core/model/labs/lab_result.dart @@ -0,0 +1,98 @@ +class LabResult { + String description; + dynamic femaleInterpretativeData; + int gender; + int lineItemNo; + dynamic maleInterpretativeData; + String notes; + String packageID; + int patientID; + String projectID; + String referanceRange; + String resultValue; + String sampleCollectedOn; + String sampleReceivedOn; + String setupID; + dynamic superVerifiedOn; + String testCode; + String uOM; + String verifiedOn; + dynamic verifiedOnDateTime; + + LabResult( + {this.description, + this.femaleInterpretativeData, + this.gender, + this.lineItemNo, + this.maleInterpretativeData, + this.notes, + this.packageID, + this.patientID, + this.projectID, + this.referanceRange, + this.resultValue, + this.sampleCollectedOn, + this.sampleReceivedOn, + this.setupID, + this.superVerifiedOn, + this.testCode, + this.uOM, + this.verifiedOn, + this.verifiedOnDateTime}); + + LabResult.fromJson(Map json) { + description = json['Description']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + gender = json['Gender']; + lineItemNo = json['LineItemNo']; + maleInterpretativeData = json['MaleInterpretativeData']; + notes = json['Notes']; + packageID = json['PackageID']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + referanceRange = json['ReferanceRange']; + resultValue = json['ResultValue']; + sampleCollectedOn = json['SampleCollectedOn']; + sampleReceivedOn = json['SampleReceivedOn']; + setupID = json['SetupID']; + superVerifiedOn = json['SuperVerifiedOn']; + testCode = json['TestCode']; + uOM = json['UOM']; + verifiedOn = json['VerifiedOn']; + verifiedOnDateTime = json['VerifiedOnDateTime']; + } + + Map toJson() { + final Map data = new Map(); + data['Description'] = this.description; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['Gender'] = this.gender; + data['LineItemNo'] = this.lineItemNo; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['Notes'] = this.notes; + data['PackageID'] = this.packageID; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ReferanceRange'] = this.referanceRange; + data['ResultValue'] = this.resultValue; + data['SampleCollectedOn'] = this.sampleCollectedOn; + data['SampleReceivedOn'] = this.sampleReceivedOn; + data['SetupID'] = this.setupID; + data['SuperVerifiedOn'] = this.superVerifiedOn; + data['TestCode'] = this.testCode; + data['UOM'] = this.uOM; + data['VerifiedOn'] = this.verifiedOn; + data['VerifiedOnDateTime'] = this.verifiedOnDateTime; + return data; + } +} + + +class LabResultList { + String filterName = ""; + List patientLabResultList = List(); + + LabResultList({this.filterName, LabResult lab}) { + patientLabResultList.add(lab); + } +} diff --git a/lib/core/model/labs/patient_lab_orders.dart b/lib/core/model/labs/patient_lab_orders.dart new file mode 100644 index 00000000..07044b0e --- /dev/null +++ b/lib/core/model/labs/patient_lab_orders.dart @@ -0,0 +1,158 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class PatientLabOrders { + int actualDoctorRate; + String clinicDescription; + String clinicDescriptionEnglish; + Null clinicDescriptionN; + int clinicID; + int doctorID; + String doctorImageURL; + String doctorName; + String doctorNameEnglish; + Null doctorNameN; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + String invoiceNo; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isRead; + String nationalityFlagURL; + int noOfPatientsRate; + DateTime orderDate; + String orderNo; + String patientID; + String projectID; + String projectName; + Null projectNameN; + String qR; + String setupID; + List speciality; + bool isLiveCareAppointment; + PatientLabOrders( + {this.actualDoctorRate, + this.clinicDescription, + this.clinicDescriptionEnglish, + this.clinicDescriptionN, + this.clinicID, + this.doctorID, + this.doctorImageURL, + this.doctorName, + this.doctorNameEnglish, + this.doctorNameN, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.invoiceNo, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isRead, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderDate, + this.orderNo, + this.patientID, + this.projectID, + this.projectName, + this.projectNameN, + this.qR, + this.setupID, + this.speciality,this.isLiveCareAppointment}); + + PatientLabOrders.fromJson(Map json) { + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionEnglish = json['ClinicDescriptionEnglish']; + clinicDescriptionN = json['ClinicDescriptionN']; + clinicID = json['ClinicID']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorNameEnglish = json['DoctorNameEnglish']; + doctorNameN = json['DoctorNameN']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + invoiceNo = json['InvoiceNo']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isRead = json['IsRead']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderDate = DateUtils.convertStringToDate(json['OrderDate']); + orderNo = json['OrderNo']; + patientID = json['PatientID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + projectNameN = json['ProjectNameN']; + qR = json['QR']; + setupID = json['SetupID']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['ClinicID'] = this.clinicID; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorNameEnglish'] = this.doctorNameEnglish; + data['DoctorNameN'] = this.doctorNameN; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['InvoiceNo'] = this.invoiceNo; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsRead'] = this.isRead; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderDate'] = this.orderDate; + data['OrderNo'] = this.orderNo; + data['PatientID'] = this.patientID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['ProjectNameN'] = this.projectNameN; + data['QR'] = this.qR; + data['SetupID'] = this.setupID; + data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + return data; + } +} + +class PatientLabOrdersList { + String filterName = ""; + List patientLabOrdersList = List(); + + PatientLabOrdersList( + {this.filterName, PatientLabOrders patientDoctorAppointment}) { + patientLabOrdersList.add(patientDoctorAppointment); + } +} diff --git a/lib/core/model/labs/patient_lab_special_result.dart b/lib/core/model/labs/patient_lab_special_result.dart new file mode 100644 index 00000000..2fbcb832 --- /dev/null +++ b/lib/core/model/labs/patient_lab_special_result.dart @@ -0,0 +1,32 @@ +class PatientLabSpecialResult { + String invoiceNo; + String moduleID; + String resultData; + String resultDataHTML; + Null resultDataTxt; + + PatientLabSpecialResult( + {this.invoiceNo, + this.moduleID, + this.resultData, + this.resultDataHTML, + this.resultDataTxt}); + + PatientLabSpecialResult.fromJson(Map json) { + invoiceNo = json['InvoiceNo']; + moduleID = json['ModuleID']; + resultData = json['ResultData']; + resultDataHTML = json['ResultDataHTML']; + resultDataTxt = json['ResultDataTxt']; + } + + Map toJson() { + final Map data = new Map(); + data['InvoiceNo'] = this.invoiceNo; + data['ModuleID'] = this.moduleID; + data['ResultData'] = this.resultData; + data['ResultDataHTML'] = this.resultDataHTML; + data['ResultDataTxt'] = this.resultDataTxt; + return data; + } +} diff --git a/lib/core/model/labs/request_patient_lab_orders.dart b/lib/core/model/labs/request_patient_lab_orders.dart new file mode 100644 index 00000000..ce9263ef --- /dev/null +++ b/lib/core/model/labs/request_patient_lab_orders.dart @@ -0,0 +1,64 @@ +class RequestPatientLabOrders { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientLabOrders( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientLabOrders.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/labs/request_patient_lab_special_result.dart b/lib/core/model/labs/request_patient_lab_special_result.dart new file mode 100644 index 00000000..bdeb3930 --- /dev/null +++ b/lib/core/model/labs/request_patient_lab_special_result.dart @@ -0,0 +1,84 @@ +class RequestPatientLabSpecialResult { + String invoiceNo; + String orderNo; + String setupID; + String projectID; + int clinicID; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientLabSpecialResult( + {this.invoiceNo, + this.orderNo, + this.setupID, + this.projectID, + this.clinicID, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientLabSpecialResult.fromJson(Map json) { + invoiceNo = json['InvoiceNo']; + orderNo = json['OrderNo']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['InvoiceNo'] = this.invoiceNo; + data['OrderNo'] = this.orderNo; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/labs/request_send_lab_report_email.dart b/lib/core/model/labs/request_send_lab_report_email.dart new file mode 100644 index 00000000..118da906 --- /dev/null +++ b/lib/core/model/labs/request_send_lab_report_email.dart @@ -0,0 +1,112 @@ +class RequestSendLabReportEmail { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + String to; + String dateofBirth; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + String setupID; + String projectName; + String clinicName; + String doctorName; + String projectID; + String invoiceNo; + String orderDate; + + RequestSendLabReportEmail( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.to, + this.dateofBirth, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.setupID, + this.projectName, + this.clinicName, + this.doctorName, + this.projectID, + this.invoiceNo, + this.orderDate}); + + RequestSendLabReportEmail.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + to = json['To']; + dateofBirth = json['DateofBirth']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + setupID = json['SetupID']; + projectName = json['ProjectName']; + clinicName = json['ClinicName']; + doctorName = json['DoctorName']; + projectID = json['ProjectID']; + invoiceNo = json['InvoiceNo']; + orderDate = json['OrderDate']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['To'] = this.to; + data['DateofBirth'] = this.dateofBirth; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['SetupID'] = this.setupID; + data['ProjectName'] = this.projectName; + data['ClinicName'] = this.clinicName; + data['DoctorName'] = this.doctorName; + data['ProjectID'] = this.projectID; + data['InvoiceNo'] = this.invoiceNo; + data['OrderDate'] = this.orderDate; + return data; + } +} diff --git a/lib/core/service/labs_service.dart b/lib/core/service/labs_service.dart new file mode 100644 index 00000000..1a641d1f --- /dev/null +++ b/lib/core/service/labs_service.dart @@ -0,0 +1,136 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/request_patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/request_send_lab_report_email.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import 'base/base_service.dart'; + +class LabsService extends BaseService { + List patientLabOrdersList = List(); + + Future getPatientLabOrdersList(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS, patient: patient, + onSuccess: (dynamic response, int statusCode) { + patientLabOrdersList.clear(); + response['ListPLO'].forEach((hospital) { + patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPatientLabSpecialResult _requestPatientLabSpecialResult = + RequestPatientLabSpecialResult(); + + List patientLabSpecialResult = List(); + List labResultList = List(); + List labOrdersResultsList = List(); + + Future getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient}) async { + hasError = false; + _requestPatientLabSpecialResult.projectID = projectID; + _requestPatientLabSpecialResult.clinicID = clinicID; + _requestPatientLabSpecialResult.invoiceNo = invoiceNo; + _requestPatientLabSpecialResult.orderNo = orderNo; + + await baseAppClient.postPatient(GET_Patient_LAB_SPECIAL_RESULT, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + response['ListPLSR'].forEach((hospital) { + patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPatientLabSpecialResult.toJson()); + } + + Future getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + await baseAppClient.postPatient(GET_Patient_LAB_RESULT, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + patientLabSpecialResult.clear(); + labResultList.clear(); + response['ListPLR'].forEach((lab) { + labResultList.add(LabResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientLabOrdersResults( + {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + hasError = false; + Map body = Map(); + body['InvoiceNo'] = patientLabOrder.invoiceNo; + body['OrderNo'] = patientLabOrder.orderNo; + body['isDentalAllowedBackend'] = false; + body['SetupID'] = patientLabOrder.setupID; + body['ProjectID'] = patientLabOrder.projectID; + body['ClinicID'] = patientLabOrder.clinicID; + body['Procedure'] = procedure; + await baseAppClient.postPatient(GET_Patient_LAB_ORDERS_RESULT, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + labOrdersResultsList.clear(); + response['ListPLR'].forEach((lab) { + labOrdersResultsList.add(LabOrderResult.fromJson(lab)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestSendLabReportEmail _requestSendLabReportEmail = + RequestSendLabReportEmail(); + + Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { + // _requestSendLabReportEmail.projectID = patientLabOrder.projectID; + // _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; + // _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; + // _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; + // _requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName; + // _requestSendLabReportEmail.patientIditificationNum = + // user.patientIdentificationNo; + // _requestSendLabReportEmail.dateofBirth = user.dateofBirth; + // _requestSendLabReportEmail.to = user.emailAddress; + // _requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}'; + // _requestSendLabReportEmail.patientMobileNumber = user.mobileNumber; + // _requestSendLabReportEmail.projectName = patientLabOrder.projectName; + // _requestSendLabReportEmail.setupID = user.setupID; + // + // await baseAppClient.post(SEND_LAB_RESULT_EMAIL, + // onSuccess: (dynamic response, int statusCode) { + // + // }, onFailure: (String error, int statusCode) { + // hasError = true; + // super.error = error; + // }, body: _requestSendLabReportEmail.toJson()); + } +} diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart new file mode 100644 index 00000000..3f457956 --- /dev/null +++ b/lib/core/viewModel/labs_view_model.dart @@ -0,0 +1,175 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; +import 'package:doctor_app_flutter/core/service/labs_service.dart'; +import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; + +import 'base_view_model.dart'; + +class LabsViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + LabsService _labsService = locator(); + + List get labOrdersResultsList => + _labsService.labOrdersResultsList; + + List _patientLabOrdersListClinic = List(); + List _patientLabOrdersListHospital = List(); + + List get patientLabOrdersList => + filterType == FilterType.Clinic + ? _patientLabOrdersListClinic + : _patientLabOrdersListHospital; + + void getLabs(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersList(patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.patientLabOrdersList.forEach((element) { + List patientLabOrdersClinic = + _patientLabOrdersListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + _patientLabOrdersListClinic[_patientLabOrdersListClinic + .indexOf(patientLabOrdersClinic[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListClinic.add(PatientLabOrdersList( + filterName: element.clinicDescription, + patientDoctorAppointment: element)); + } + + // doctor list sort via project + List patientLabOrdersHospital = + _patientLabOrdersListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (patientLabOrdersHospital.length != 0) { + _patientLabOrdersListHospital[_patientLabOrdersListHospital + .indexOf(patientLabOrdersHospital[0])] + .patientLabOrdersList + .add(element); + } else { + _patientLabOrdersListHospital.add(PatientLabOrdersList( + filterName: element.projectName, + patientDoctorAppointment: element)); + } + }); + + setState(ViewState.Idle); + } + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + List get patientLabSpecialResult => + _labsService.patientLabSpecialResult; + + List get labResultList => _labsService.labResultList; + + List labResultLists = List(); + + getLaboratoryResult( + {String projectID, + int clinicID, + String invoiceNo, + String orderNo, + PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getLaboratoryResult( + invoiceNo: invoiceNo, + orderNo: orderNo, + projectID: projectID, + clinicID: clinicID, + patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + getPatientLabResult({PatientLabOrders patientLabOrder,PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabResult(patientLabOrder: patientLabOrder,patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + _labsService.labResultList.forEach((element) { + List patientLabOrdersClinic = labResultLists + .where( + (elementClinic) => elementClinic.filterName == element.testCode) + .toList(); + + if (patientLabOrdersClinic.length != 0) { + var value = + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .where((e) => + e.sampleCollectedOn == element.sampleCollectedOn && + e.resultValue == element.resultValue) + .toList(); + if (value.isEmpty) + labResultLists[labResultLists.indexOf(patientLabOrdersClinic[0])] + .patientLabResultList + .add(element); + } else { + labResultLists + .add(LabResultList(filterName: element.testCode, lab: element)); + } + }); + setState(ViewState.Idle); + } + } + + getPatientLabOrdersResults( + {PatientLabOrders patientLabOrder, String procedure,PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _labsService.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, procedure: procedure,patient: patient); + if (_labsService.hasError) { + error = _labsService.error; + setState(ViewState.Error); + } else { + bool isShouldClear = false; + if (_labsService.labOrdersResultsList.length == 1) { + labOrdersResultsList.forEach((element) { + if (element.resultValue.contains('/') || + element.resultValue.contains('*') || + element.resultValue.isEmpty) isShouldClear = true; + }); + } + if (isShouldClear) _labsService.labOrdersResultsList.clear(); + setState(ViewState.Idle); + } + } + + sendLabReportEmail({PatientLabOrders patientLabOrder, String mes}) async { + await _labsService.sendLabReportEmail(patientLabOrder: patientLabOrder); + if (_labsService.hasError) { + error = _labsService.error; + } else + DrAppToastMsg.showSuccesToast(mes); + } +} diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 08b6471f..5418c357 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -1,4 +1,4 @@ -const PATIENT_TYPE = const [ +const PATIENT_TYPE_Des = const [ {"text": "Outpatient", "text_ar": "المريض الخارجي", "val": "0"}, {"text": "Inpatient", "text_ar": "المريض المنوم", "val": "1"}, {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 492e7d5e..7e8302c9 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -263,7 +263,7 @@ class _PatientSearchScreenState extends State { elevation: 16, selectedItemBuilder: (BuildContext context) { - return PATIENT_TYPE.map((item) { + return PATIENT_TYPE_Des.map((item) { return Row( mainAxisSize: MainAxisSize.max, @@ -292,7 +292,7 @@ class _PatientSearchScreenState extends State { int.parse(_selectedType); }) }, - items: PATIENT_TYPE.map((item) { + items: PATIENT_TYPE_Des.map((item) { !projectsProvider.isArabic ? itemText = item['text'] : itemText = diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart new file mode 100644 index 00000000..772391b0 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -0,0 +1,44 @@ +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.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/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; + +import 'package:flutter/cupertino.dart'; + +import 'lab_result_chart_and_detials.dart'; + +class FlowChartPage extends StatelessWidget { + final PatientLabOrders patientLabOrder; + final String filterName; + final PatiantInformtion patient; + FlowChartPage({this.patientLabOrder, this.filterName, this.patient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getPatientLabOrdersResults( + patientLabOrder: patientLabOrder, procedure: filterName,patient: patient), + builder: (context, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: filterName, + baseViewModel: model, + body: SingleChildScrollView( + child: model.labOrdersResultsList.isNotEmpty + ? Container( + child: LabResultChartAndDetails( + name: filterName, + labResult: model.labOrdersResultsList, + ), + ) + : Container( + child: Center( + child: Texts('no Data'), + ), + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart new file mode 100644 index 00000000..57b4614d --- /dev/null +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -0,0 +1,175 @@ +import 'package:doctor_app_flutter/core/model/labs/lab_result.dart'; +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/FlowChartPage.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/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + + +class LabResultWidget extends StatelessWidget { + + final String filterName ; + final List patientLabResultList; + final PatientLabOrders patientLabOrder; + final PatiantInformtion patient; + LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + ProjectViewModel projectViewModel; + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + + return Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Texts(filterName), + InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: FlowChartPage( + filterName: filterName, + patientLabOrder: patientLabOrder, + patient: patient, + ), + ), + ); + }, + child: Texts( + TranslationBase.of(context).showMoreBtn, + textDecoration: TextDecoration.underline, + color: Colors.blue, + ), + ), + ], + ), + Table( + border: TableBorder.symmetric( + inside: BorderSide( + width: 2.0, color: Colors.grey[300]), + ), + children: fullData(patientLabResultList,context), + ), + ], + ), + ); + } + List fullData(List labResultList,context) { + List tableRow = []; + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + topRight: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + ), + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.white), + ), + height: 60), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(10.0) + : Radius.circular(0.0), + topRight: projectViewModel.isArabic + ? Radius.circular(0.0) + : Radius.circular(10.0), + ), + ), + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.white), + ), + height: 60), + ), + ], + ), + ); + labResultList.forEach((lab) { + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.resultValue+" "+lab.uOM, + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + lab.referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ), + ], + ), + ); + }); + return tableRow; + } + +} + + diff --git a/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart new file mode 100644 index 00000000..9da22707 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/Lab_Result_details_wideget.dart @@ -0,0 +1,119 @@ +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_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:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:provider/provider.dart'; + +class LabResultDetailsWidget extends StatefulWidget { + final List labResult; + + LabResultDetailsWidget({ + this.labResult, + }); + + @override + _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); +} + +class _VitalSignDetailsWidgetState extends State { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + decoration: BoxDecoration( + color: Colors.transparent, + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)), + border: Border.all(color: Colors.grey, width: 1), + ), + margin: EdgeInsets.all(20), + child: Container( + color: Colors.transparent, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 2.0, color: Colors.grey[300]), + ), + children: fullData(projectViewModel), + ), + ], + ), + ), + ); + } + + List fullData(ProjectViewModel projectViewModel) { + List tableRow = []; + tableRow.add(TableRow(children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + ), + ), + child: Center( + child: Texts( + TranslationBase.of(context).date, + color: Colors.white, + ), + ), + height: 60, + ), + ), + Container( + child: Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), + topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), + ), + ), + child: Center( + child: Texts(TranslationBase.of(context).labResult, color: Colors.white), + ), + height: 60), + ) + ])); + widget.labResult.forEach((vital) { + var date = DateUtils.convertStringToDate(vital.verifiedOnDateTime); + tableRow.add(TableRow(children: [ + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${projectViewModel.isArabic? DateUtils.getWeekDayArabic(date.weekday): DateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic? DateUtils.getMonthArabic(date.month) : DateUtils.getMonth(date.month)} ${date.year}', + textAlign: TextAlign.center, + ), + ), + ), + ), + Container( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${vital.resultValue}', + textAlign: TextAlign.center, + ), + ), + ), + ), + ])); + }); + return tableRow; + } +} diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart new file mode 100644 index 00000000..f5558a61 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -0,0 +1,229 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:fl_chart/fl_chart.dart'; +import 'package:flutter/material.dart'; + +import '../../../../core/model/labs/LabOrderResult.dart'; + +class LineChartCurved extends StatefulWidget { + final String title; + final List labResult; + + LineChartCurved({this.title, this.labResult}); + + @override + State createState() => LineChartCurvedState(); +} + +class LineChartCurvedState extends State { + bool isShowingMainData; + List xAxixs = List(); + int indexes = 0; + + @override + void initState() { + super.initState(); + getXaxix(); + isShowingMainData = true; + } + + getXaxix() { + indexes = widget.labResult.length ~/ 3.5; + for (int index = 0; index < widget.labResult.length; index++) { + int mIndex = indexes * index; + if (mIndex < widget.labResult.length) { + xAxixs.add(mIndex); + } + } + } + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 1.23, + child: Container( + decoration: const BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(18)), + // color: Colors.white, + ), + child: Stack( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox( + height: 4, + ), + Text( + widget.title, + style: TextStyle( + color: Colors.black, + fontSize: 32, + fontWeight: FontWeight.bold, + letterSpacing: 2), + textAlign: TextAlign.center, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.only(right: 16.0, left: 6.0), + child: LineChart( + sampleData1(), + swapAnimationDuration: const Duration(milliseconds: 250), + ), + ), + ), + const SizedBox( + height: 10, + ), + ], + ), + ], + ), + ), + ); + } + + LineChartData sampleData1() { + return LineChartData( + lineTouchData: LineTouchData( + touchTooltipData: LineTouchTooltipData( + tooltipBgColor: Colors.white, + ), + touchCallback: (LineTouchResponse touchResponse) {}, + handleBuiltInTouches: true, + ), + gridData: FlGridData( + show: true, drawVerticalLine: true, drawHorizontalLine: true), + titlesData: FlTitlesData( + bottomTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontSize: 12, + ), + margin: 22, + rotateAngle:-65, + getTitles: (value) { + print(value); + DateTime date = DateUtils.convertStringToDate(widget.labResult[value.toInt()].verifiedOnDateTime); + if (widget.labResult.length < 8) { + if (widget.labResult.length > value.toInt()) { + return '${date.day}/ ${date.year}'; + } else + return ''; + } else { + if (value.toInt() == 0) + return '${date.day}/ ${date.year}'; + if (value.toInt() == widget.labResult.length - 1) + return '${date.day}/ ${date.year}'; + if (xAxixs.contains(value.toInt())) { + return '${date.day}/ ${date.year}'; + } + } + + + + return ''; + }, + ), + leftTitles: SideTitles( + showTitles: true, + getTextStyles: (value) => const TextStyle( + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 10, + ), + getTitles: (value) { + return '${value.toInt()}'; + }, + margin: 8, + //reservedSize: 30, + ), + ), + borderData: FlBorderData( + show: true, + border: const Border( + bottom: BorderSide( + color: Colors.black, + width: 0.5, + ), + left: BorderSide( + color: Colors.black, + ), + right: BorderSide( + color: Colors.black, + ), + top: BorderSide( + color: Colors.transparent, + ), + ), + ), + minX: 0, + maxX: (widget.labResult.length - 1).toDouble(), + maxY: getMaxY(), + minY: getMinY(), + lineBarsData: getData(), + ); + } + + double getMaxY() { + double max = 0; + widget.labResult.forEach((element) { + try{ + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble > max) max = resultValueDouble;} + catch(e){ + print(e); + } + }); + + return max.roundToDouble(); + } + + double getMinY() { + double min = 0; + try{ + min = double.parse(widget.labResult[0].resultValue); + + widget.labResult.forEach((element) { + double resultValueDouble = double.parse(element.resultValue); + if (resultValueDouble < min) min = resultValueDouble; + });}catch(e){ + print(e); + } + int value = min.toInt(); + + return value.toDouble(); + } + + List getData() { + List spots = List(); + for (int index = 0; index < widget.labResult.length; index++) { + try{ + var resultValueDouble = double.parse(widget.labResult[index].resultValue); + spots.add(FlSpot(index.toDouble(), resultValueDouble)); + }catch(e){ + print(e); + spots.add(FlSpot(index.toDouble(), 0.0)); + + } + } + + final LineChartBarData lineChartBarData1 = LineChartBarData( + spots: spots, + isCurved: true, + colors: [Theme.of(context).primaryColor], + barWidth: 5, + isStrokeCapRound: true, + dotData: FlDotData( + show: false, + ), + belowBarData: BarAreaData( + show: false, + ), + ); + + return [ + lineChartBarData1, + ]; + } +} diff --git a/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart new file mode 100644 index 00000000..6c4ebf36 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/lab_result_chart_and_detials.dart @@ -0,0 +1,41 @@ + +import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; +import 'package:flutter/material.dart'; + +import 'package:charts_flutter/flutter.dart' as charts; + +import 'Lab_Result_details_wideget.dart'; +import 'LineChartCurved.dart'; + + +class LabResultChartAndDetails extends StatelessWidget { + LabResultChartAndDetails({ + Key key, + @required this.labResult, + @required this.name, + }) : super(key: key); + + final List labResult; + final String name; + + + @override + Widget build(BuildContext context) { + return Column( + children: [ + AppExpandableNotifier( + headerWidget: Padding( + padding: const EdgeInsets.all(8.0), + child: LineChartCurved(title: name,labResult:labResult,), + ), + bodyWidget: LabResultDetailsWidget( + labResult: labResult.reversed.toList(), + ), + isExpand: true, + ), + ], + ); + } + +} diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart new file mode 100644 index 00000000..398479c4 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -0,0 +1,55 @@ +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import 'laboratory_result_widget.dart'; + +class LaboratoryResultPage extends StatefulWidget { + final PatientLabOrders patientLabOrders; + final PatiantInformtion patient; + + LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); + + @override + _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); +} + +class _LaboratoryResultPageState extends State { + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getLaboratoryResult( + invoiceNo: widget.patientLabOrders.invoiceNo, + clinicID: widget.patientLabOrders.clinicID, + projectID: widget.patientLabOrders.projectID, + orderNo: widget.patientLabOrders.orderNo, + patient: widget.patient), + builder: (_, model, w) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).labResults, + baseViewModel: model, + body: Scaffold( + body: ListView.builder( + itemBuilder: (context, index) => LaboratoryResultWidget( + onTap: () async { + + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + ), + itemCount: model.patientLabSpecialResult.length, + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart new file mode 100644 index 00000000..25663fa6 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -0,0 +1,235 @@ +import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/LabResultWidget.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/network_base_view.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_html/flutter_html.dart'; + +import 'package:provider/provider.dart'; + +class LaboratoryResultWidget extends StatefulWidget { + final GestureTapCallback onTap; + final String billNo; + final String details; + final String orderNo; + final PatientLabOrders patientLabOrder; + final PatiantInformtion patient; + const LaboratoryResultWidget( + {Key key, + this.onTap, + this.billNo, + this.details, + this.orderNo, + this.patientLabOrder, this.patient}) + : super(key: key); + + @override + _LaboratoryResultWidgetState createState() => _LaboratoryResultWidgetState(); +} + +class _LaboratoryResultWidgetState extends State { + bool _isShowMore = true; + bool _isShowMoreGeneral = true; + ProjectViewModel projectViewModel; + + @override + Widget build(BuildContext context) { + projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => + model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + builder: (_, model, w) => NetworkBaseView( + baseViewModel: model, + child: Container( + margin: EdgeInsets.all(15), + child: Column( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.all(8), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(TranslationBase.of(context).invoiceNo), + Texts(widget.billNo), + ], + ), + ), + ), + ], + ), + ), + SizedBox( + height: 12, + ), + if (model.labResultLists.isNotEmpty) + Container( + child: Column( + children: [ + InkWell( + onTap: () { + setState( + () { + _isShowMoreGeneral = !_isShowMoreGeneral; + }, + ); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded( + child: Texts(TranslationBase.of(context) + .generalResult)), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor), + child: Icon( + _isShowMoreGeneral + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMoreGeneral) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + ), + ), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ...List.generate( + model.labResultLists.length, + (index) => LabResultWidget( + patientLabOrder: widget.patientLabOrder, + filterName: model + .labResultLists[index].filterName, + patientLabResultList: model + .labResultLists[index] + .patientLabResultList, + patient:widget.patient, + ), + ) + ], + ), + ), + ), + ], + ), + ), + SizedBox( + height: 10, + ), + InkWell( + onTap: () { + setState(() { + _isShowMore = !_isShowMore; + }); + }, + child: Container( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(5.0), + )), + child: Row( + children: [ + Expanded( + child: Texts( + TranslationBase.of(context).specialResult)), + Container( + width: 25, + height: 25, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor), + child: Icon( + _isShowMore + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 22, + ), + ) + ], + ), + ), + ), + if (_isShowMore) + AnimatedContainer( + padding: EdgeInsets.all(10.0), + margin: EdgeInsets.only(left: 5, right: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(5.0), + bottomRight: Radius.circular(5.0), + )), + duration: Duration(milliseconds: 7000), + child: Container( + width: double.infinity, + child: Html( + data: widget.details ?? + TranslationBase.of(context).noDataAvailable, + )), + ), + ], + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart new file mode 100644 index 00000000..c0118e5f --- /dev/null +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -0,0 +1,117 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/laboratory_result_page.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class LabsHomePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getLabs(patient), + builder: (context, LabsViewModel model, widget) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).labOrders, + body: SingleChildScrollView( + physics: BouncingScrollPhysics(), + child: FractionallySizedBox( + widthFactor: 1.0, + child: Center( + child: Column( + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) => + model.setFilterType(value), + ), + ), + ), + ) + ], + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => AppExpandableNotifier( + title: model.patientLabOrdersList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, + ), + ), + ), + isInOutPatient: labOrder.isInOutPatient, + name: labOrder.doctorName, + billNo: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + subName: labOrder.projectName, + isLiveCareAppointment: + labOrder.isLiveCareAppointment, + date: projectViewModel.isArabic + ? DateUtils.getMonthDayYearDateFormattedAr( + labOrder.orderDate) + : DateUtils.getMonthDayYearDateFormatted( + labOrder.orderDate), + ); + }).toList(), + ), + ), + ) + ], + ), + ), + ), + ), + ), + ); + } +} diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index af90acf6..8e6cd17c 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -217,6 +217,47 @@ class DateUtils { } } + static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + if (date != null) { + const start = "/Date("; + const end = "+0300)"; + final startIndex = date.indexOf(start); + final endIndex = date.indexOf(end, startIndex + start.length); + return DateTime.fromMillisecondsSinceEpoch( + int.parse( + date.substring(startIndex + start.length, endIndex), + ), + ); + } else + return DateTime.now(); + } + + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted Arabic + static String getMonthDayYearDateFormattedAr(DateTime dateTime) { + if (dateTime != null) + return getMonthArabic(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted + static String getMonthDayYearDateFormatted(DateTime dateTime) { + if (dateTime != null) + return getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + ", " + + dateTime.year.toString(); + else + return ""; + } + static String getAgeByBirthday(dynamic birthday, BuildContext context){ // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/util/dr_app_shared_pref.dart b/lib/util/dr_app_shared_pref.dart index 54c8cc45..2f6f3232 100644 --- a/lib/util/dr_app_shared_pref.dart +++ b/lib/util/dr_app_shared_pref.dart @@ -37,6 +37,13 @@ class DrAppSharedPreferances { return prefs.getString(key); } + /// Get String [key] the key was saved + getStringWithDefaultValue(String key, String defaultVal) async { + final SharedPreferences prefs = await _prefs; + String value = prefs.getString(key); + return value == null ? defaultVal : value; + } + setObj(String key, value) async { final SharedPreferences prefs = await _prefs; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 8c8afde2..dcba4c84 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1136,6 +1136,17 @@ class TranslationBase { String get appointmentDate => localizedValues['appointmentDate'][locale.languageCode]; String get arrivedP => localizedValues['arrived_p'][locale.languageCode]; + + String get details => localizedValues['details'][locale.languageCode]; + String get liveCare => localizedValues['liveCare'][locale.languageCode]; + String get outpatient => localizedValues['out-patient'][locale.languageCode]; + String get billNo => localizedValues['BillNo'][locale.languageCode]; + String get labResults => localizedValues['labResults'][locale.languageCode]; + String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; + String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/shared/StarRating.dart b/lib/widgets/shared/StarRating.dart new file mode 100644 index 00000000..10c12fa5 --- /dev/null +++ b/lib/widgets/shared/StarRating.dart @@ -0,0 +1,48 @@ +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/material.dart'; + +import 'Text.dart'; + +class StarRating extends StatelessWidget { + final double totalAverage; + final double size; + final int totalCount; + final bool forceStars; + + StarRating( + {Key key, + this.totalAverage: 0.0, + this.size: 16.0, + this.totalCount = 5, + this.forceStars = false}) + : super(key: key); + + @override + Widget build(BuildContext context) { + return Row(mainAxisAlignment: MainAxisAlignment.start, children: [ + if (!forceStars && (totalAverage == null || totalAverage == 0)) + Texts("New", style: "caption"), + if (forceStars || (totalAverage != null && totalAverage > 0)) + ...List.generate( + 5, + (index) => Padding( + padding: EdgeInsets.only(right: 1.0), + child: Icon( + (index + 1) <= (totalAverage ?? 0) + ? EvaIcons.star + : EvaIcons.starOutline, + size: size, + color: (index + 1) <= (totalAverage ?? 0) + ? Color.fromRGBO(255, 186, 0, 1.0) + : Theme.of(context).hintColor), + )), + if (totalCount != null) SizedBox(width: 9.0), + if (totalCount != null) + Texts( + "(" + totalCount.toString() + ")", + style: "overline", + color: Colors.grey[400], + ) + ]); + } +} diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart new file mode 100644 index 00000000..ea5777a5 --- /dev/null +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -0,0 +1,126 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:expandable/expandable.dart'; +import 'package:flutter/material.dart'; + + +/// App Expandable Notifier with animation +/// [headerWidget] widget want to show in the header +/// [bodyWidget] widget want to show in the body +/// [title] the widget title +/// [collapsed] The widget shown in the collapsed state +class AppExpandableNotifier extends StatefulWidget { + final Widget headerWidget; + final Widget bodyWidget; + final String title; + final Widget collapsed; + final bool isExpand; + bool expandFlag = false; + var controller = new ExpandableController(); + AppExpandableNotifier( + {this.headerWidget, + this.bodyWidget, + this.title, + this.collapsed, + this.isExpand = false}); + + _AppExpandableNotifier createState() => _AppExpandableNotifier(); +} + +class _AppExpandableNotifier extends State { + + @override + void initState() { + setState(() { + if (widget.isExpand) { + widget.expandFlag = widget.isExpand; + widget.controller.expanded = true; + } + }); + super.initState(); + } + + @override + Widget build(BuildContext context) { + + return ExpandableNotifier( + child: Padding( + padding: const EdgeInsets.only(left: 10, right: 10, top: 4), + child: Card( + clipBehavior: Clip.antiAlias, + child: Column( + children: [ + SizedBox( + child: widget.headerWidget, + ), + ScrollOnExpand( + scrollOnExpand: true, + scrollOnCollapse: false, + child: ExpandablePanel( + hasIcon: false, + theme: const ExpandableThemeData( + headerAlignment: ExpandablePanelHeaderAlignment.center, + tapBodyToCollapse: true, + ), + header: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Padding( + padding: EdgeInsets.all(10), + child: Text( + widget.title ?? TranslationBase.of(context).details, + style: TextStyle( + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + ), + ), + ), + ), + IconButton( + icon: new Container( + height: 28.0, + width: 30.0, + decoration: new BoxDecoration( + color: Theme.of(context).primaryColor, + shape: BoxShape.circle, + ), + child: new Center( + child: new Icon( + widget.expandFlag + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down, + color: Colors.white, + size: 30.0, + ), + ), + ), + onPressed: () { + setState(() { + widget.expandFlag = !widget.expandFlag; + widget.controller.expanded = widget.expandFlag; + }); + }), + ]), + collapsed: widget.collapsed ?? Container(), + expanded: widget.bodyWidget, + builder: (_, collapsed, expanded) { + return Padding( + padding: EdgeInsets.only(left: 5, right: 5, bottom: 5), + child: Expandable( + controller: widget.controller, + collapsed: collapsed, + expanded: expanded, + theme: const ExpandableThemeData(crossFadePoint: 0), + ), + ); + }, + ), + ), + ], + ), + ), + ), + ); + } +} diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart new file mode 100644 index 00000000..080a4fab --- /dev/null +++ b/lib/widgets/shared/doctor_card.dart @@ -0,0 +1,198 @@ + +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; + +import 'StarRating.dart'; +import 'Text.dart'; + +class DoctorCard extends StatelessWidget { + final String name; + final String subName; + final double rat; + final String date; + final String profileUrl; + final String billNo; + final Function onTap; + final Function onEmailTap; + final bool isInOutPatient; + final bool isLiveCareAppointment; + + DoctorCard( + {this.name, + this.subName, + this.rat, + this.date, + this.profileUrl, + this.billNo, + this.onTap, + this.onEmailTap, + this.isInOutPatient, + this.isLiveCareAppointment = false}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 0.5, + color: Theme.of(context).primaryColor, + ), + borderRadius: BorderRadius.all( + Radius.circular(8.0), + ), + color: Colors.white), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + width: projectViewModel.isArabic ? 27 : 20, + height: date == null + ? projectViewModel.isArabic + ? 185 + : 100 + : 180, + decoration: BoxDecoration( + //Colors.red[900] Color(0xff404545) + color: isLiveCareAppointment + ? Color(0xff404545) + : !isInOutPatient + ? Colors.red[900] + : Theme.of(context).primaryColor, + borderRadius: BorderRadius.only( + topLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + bottomLeft: projectViewModel.isArabic + ? Radius.circular(0) + : Radius.circular(8), + topRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + bottomRight: projectViewModel.isArabic + ? Radius.circular(8) + : Radius.circular(0), + ), + ), + child: RotatedBox( + quarterTurns: 3, + child: Center( + child: Text( + isLiveCareAppointment + ? TranslationBase.of(context) + .liveCare + .toUpperCase() + : !isInOutPatient + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), + style: TextStyle(color: Colors.white), + ), + )), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.all(10.0), + child: Row( + children: [ + Expanded( + flex: 1, + child: LargeAvatar( + name: name, + url: profileUrl, + ), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).dr + + " " + + name, + bold: true, + ), + Texts( + subName, + ), + if (billNo != null) + Row( + children: [ + Texts( + '${TranslationBase.of(context).billNo}: ', + ), + Texts( + billNo, + ) + ], + ), + if (rat != null) + StarRating( + totalAverage: rat, forceStars: true), + ], + ), + ), + ), + if (onEmailTap != null) + InkWell( + onTap: onEmailTap, + child: Icon( + Icons.email, + color: Theme.of(context).primaryColor, + ), + ), + ], + ), + ), + if (date != null) + Divider( + height: 8, + color: Colors.grey[400], + ), + if (date != null) + Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + 'assets/images/Icon-awesome-calendar.png', + width: 30, + height: 30, + ), + Expanded( + child: Texts( + date, + variant: 'bodyText', + ), + ) + ], + ) + ], + ), + ) + ], + ), + ], + ), + ), + ); + } +} diff --git a/pubspec.lock b/pubspec.lock index d044f1fb..4a3f9c9e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -169,6 +169,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.4" + chewie: + dependency: transitive + description: + name: chewie + url: "https://pub.dartlang.org" + source: hosted + version: "0.9.10" + chewie_audio: + dependency: transitive + description: + name: chewie_audio + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.0+1" cli_util: dependency: transitive description: @@ -239,6 +253,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.5" + css_colors: + dependency: transitive + description: + name: css_colors + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" csslib: dependency: transitive description: @@ -398,6 +419,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.1" + flutter_html: + dependency: "direct main" + description: + name: flutter_html + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" flutter_localizations: dependency: "direct main" description: flutter @@ -417,6 +445,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.11" + flutter_svg: + dependency: transitive + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "0.18.1" flutter_swiper: dependency: "direct main" description: @@ -602,6 +637,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + open_iconic_flutter: + dependency: transitive + description: + name: open_iconic_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.0" package_config: dependency: transitive description: @@ -679,6 +721,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.1" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.0" platform: dependency: transitive description: @@ -756,6 +805,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.0.4+3" + screen: + dependency: transitive + description: + name: screen + url: "https://pub.dartlang.org" + source: hosted + version: "0.0.5" shared_preferences: dependency: "direct main" description: @@ -950,6 +1006,34 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.1.0-nullsafety.3" + video_player: + dependency: transitive + description: + name: video_player + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.12+5" + video_player_platform_interface: + dependency: transitive + description: + name: video_player_platform_interface + url: "https://pub.dartlang.org" + source: hosted + version: "2.2.0" + video_player_web: + dependency: transitive + description: + name: video_player_web + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+1" + wakelock: + dependency: transitive + description: + name: wakelock + url: "https://pub.dartlang.org" + source: hosted + version: "0.1.4+2" watcher: dependency: transitive description: @@ -964,6 +1048,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.2.0" + webview_flutter: + dependency: transitive + description: + name: webview_flutter + url: "https://pub.dartlang.org" + source: hosted + version: "0.3.24" win32: dependency: transitive description: @@ -978,6 +1069,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.2" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "4.5.1" yaml: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 6dd072f5..8c3825e1 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -76,6 +76,9 @@ dependencies: # Html html: ^0.14.0+4 + # Flutter Html View + flutter_html: 1.0.2 + #speech to text From 7dae41513f208d7a0f10ff9740dfab2a386d0365 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 23 Mar 2021 10:53:28 +0200 Subject: [PATCH 378/421] Add insurance approval services --- ios/Podfile.lock | 30 ++ lib/client/base_app_client.dart | 2 +- lib/config/config.dart | 2 + lib/config/localized_values.dart | 10 + lib/core/model/insurance_approval.dart | 140 ++++++ lib/core/service/InsuranceCardService.dart | 45 ++ lib/core/viewModel/InsuranceViewModel.dart | 31 ++ lib/locator.dart | 8 + lib/routes.dart | 9 +- .../insurance_approval_screen_patient.dart | 428 ++++++++++++++++++ lib/util/translations_delegate_base.dart | 7 + .../profile_medical_info_widget_search.dart | 4 +- lib/widgets/shared/Text.dart | 141 +++--- lib/widgets/shared/doctor_card.dart | 8 +- pubspec.lock | 6 +- 15 files changed, 798 insertions(+), 73 deletions(-) create mode 100644 lib/core/model/insurance_approval.dart create mode 100644 lib/core/service/InsuranceCardService.dart create mode 100644 lib/core/viewModel/InsuranceViewModel.dart create mode 100644 lib/screens/patients/insurance_approval_screen_patient.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 46d7599e..19ebd328 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -103,6 +103,8 @@ PODS: - PromisesObjC (1.2.11) - Protobuf (3.13.0) - Reachability (3.2) + - screen (0.0.1): + - Flutter - shared_preferences (0.0.1): - Flutter - shared_preferences_linux (0.0.1): @@ -128,6 +130,14 @@ PODS: - Flutter - url_launcher_windows (0.0.1): - Flutter + - video_player (0.0.1): + - Flutter + - video_player_web (0.0.1): + - Flutter + - wakelock (0.0.1): + - Flutter + - webview_flutter (0.0.1): + - Flutter DEPENDENCIES: - Alamofire @@ -150,6 +160,7 @@ DEPENDENCIES: - path_provider_linux (from `.symlinks/plugins/path_provider_linux/ios`) - path_provider_windows (from `.symlinks/plugins/path_provider_windows/ios`) - permission_handler (from `.symlinks/plugins/permission_handler/ios`) + - screen (from `.symlinks/plugins/screen/ios`) - shared_preferences (from `.symlinks/plugins/shared_preferences/ios`) - shared_preferences_linux (from `.symlinks/plugins/shared_preferences_linux/ios`) - shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`) @@ -161,6 +172,10 @@ DEPENDENCIES: - url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`) - url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`) - url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`) + - video_player (from `.symlinks/plugins/video_player/ios`) + - video_player_web (from `.symlinks/plugins/video_player_web/ios`) + - wakelock (from `.symlinks/plugins/wakelock/ios`) + - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) SPEC REPOS: trunk: @@ -219,6 +234,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/path_provider_windows/ios" permission_handler: :path: ".symlinks/plugins/permission_handler/ios" + screen: + :path: ".symlinks/plugins/screen/ios" shared_preferences: :path: ".symlinks/plugins/shared_preferences/ios" shared_preferences_linux: @@ -241,6 +258,14 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/url_launcher_web/ios" url_launcher_windows: :path: ".symlinks/plugins/url_launcher_windows/ios" + video_player: + :path: ".symlinks/plugins/video_player/ios" + video_player_web: + :path: ".symlinks/plugins/video_player_web/ios" + wakelock: + :path: ".symlinks/plugins/wakelock/ios" + webview_flutter: + :path: ".symlinks/plugins/webview_flutter/ios" SPEC CHECKSUMS: Alamofire: 85e8a02c69d6020a0d734f6054870d7ecb75cf18 @@ -276,6 +301,7 @@ SPEC CHECKSUMS: PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 + screen: abd91ca7bf3426e1cc3646d27e9b2358d6bf07b0 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087 @@ -289,6 +315,10 @@ SPEC CHECKSUMS: url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313 url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5 + video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e + video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7 + wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4 + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index aefd3bb2..ae355a3f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -139,7 +139,7 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'ar'); + await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); if (body.containsKey('SetupID')) { body['SetupID'] = body.containsKey('SetupID') ? body['SetupID'] != null diff --git a/lib/config/config.dart b/lib/config/config.dart index a512d136..a944a0a1 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -226,6 +226,8 @@ const GET_BOX_QUANTITY = ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; +const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d1db1a1f..4f64d5ee 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -773,4 +773,14 @@ const Map> localizedValues = { }, 'reschedule': {'en': 'Reschedule', 'ar': 'إعادة الجدولة'}, 'leaves': {'en': 'Leaves', 'ar': 'يغادر'}, + "totalApproval": { + "en": "Total approval unused", + "ar": "اجمالي الموافقات الغير مستخدمة" + }, + "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, + "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, + "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, + "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, + "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + }; diff --git a/lib/core/model/insurance_approval.dart b/lib/core/model/insurance_approval.dart new file mode 100644 index 00000000..894fad46 --- /dev/null +++ b/lib/core/model/insurance_approval.dart @@ -0,0 +1,140 @@ +class InsuranceApprovalDetails { + String procedureName; + String status; + String isInvoicedDesc; + + InsuranceApprovalDetails({ + this.procedureName, + this.status, + this.isInvoicedDesc, + }); + + InsuranceApprovalDetails.fromJson(Map json) { + try { + isInvoicedDesc = json['IsInvoicedDesc']; + status = json['Status']; + procedureName = json['ProcedureName']; + } catch (e) { + print(e); + } + } +} + +class InsuranceApprovalModel { + InsuranceApprovalDetails approvalDetails; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int eXuldAPPNO; + int projectID; + String doctorName; + String clinicName; + String patientDescription; + int approvalNo; + String approvalStatusDescption; + int unUsedCount; + + //String companyName; + String expiryDate; + String rceiptOn; + int appointmentNo; + + InsuranceApprovalModel( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.eXuldAPPNO, + this.projectID, + this.doctorName, + this.clinicName, + this.patientDescription, + this.approvalNo, + this.approvalStatusDescption, + this.unUsedCount, + //this.companyName, + this.expiryDate, + this.rceiptOn, + this.approvalDetails, + this.appointmentNo}); + + InsuranceApprovalDetails x = InsuranceApprovalDetails(); + + InsuranceApprovalModel.fromJson(Map json) { + try { + rceiptOn = json['ReceiptOn']; + expiryDate = json['ExpiryDate']; + //companyName = json['CompanyName']; + unUsedCount = json['TotaUnUsedCount']; + approvalStatusDescption = json['ApprovalStatusDescption']; + approvalNo = json['ApprovalNo']; + patientDescription = json['IsInOutPatientDescription']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + eXuldAPPNO = json['EXuldAPPNO']; + projectID = json['ProjectID']; + doctorName = json['DoctorName']; + clinicName = json['ClinicName']; + approvalDetails = + InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); + appointmentNo = json['AppointmentNo']; + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + if (appointmentNo == null) { + data['EXuldAPPNO'] = this.eXuldAPPNO; + data['ProjectID'] = this.projectID; + } + if (appointmentNo != null) { + data['AppointmentNo'] = this.appointmentNo; + } + return data; + } +} diff --git a/lib/core/service/InsuranceCardService.dart b/lib/core/service/InsuranceCardService.dart new file mode 100644 index 00000000..43c0e811 --- /dev/null +++ b/lib/core/service/InsuranceCardService.dart @@ -0,0 +1,45 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/service/base/base_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +class InsuranceCardService extends BaseService { + InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel( + isDentalAllowedBackend: false, + patientTypeID: 1, + patientType: 1, + eXuldAPPNO: 0, + projectID: 0); + + List _insuranceApproval = List(); + + List get insuranceApproval => _insuranceApproval; + + Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { + hasError = false; + // _cardList.clear(); + if (appointmentNo != null) { + _insuranceApprovalModel.appointmentNo = appointmentNo; + _insuranceApprovalModel.eXuldAPPNO = null; + _insuranceApprovalModel.projectID = null; + } else { + _insuranceApprovalModel.appointmentNo = null; + _insuranceApprovalModel.eXuldAPPNO = 0; + _insuranceApprovalModel.projectID = 0; + } + + await baseAppClient.postPatient(GET_PAtIENTS_INSURANCE_APPROVALS, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + print(response['HIS_Approval_List'].length); + _insuranceApproval.clear(); + _insuranceApproval.length = 0; + response['HIS_Approval_List'].forEach((item) { + _insuranceApproval.add(InsuranceApprovalModel.fromJson(item)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _insuranceApprovalModel.toJson()); + } +} diff --git a/lib/core/viewModel/InsuranceViewModel.dart b/lib/core/viewModel/InsuranceViewModel.dart new file mode 100644 index 00000000..b08469ef --- /dev/null +++ b/lib/core/viewModel/InsuranceViewModel.dart @@ -0,0 +1,31 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/insurance_approval.dart'; +import 'package:doctor_app_flutter/core/service/InsuranceCardService.dart'; +import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; + +import '../../locator.dart'; + +class InsuranceViewModel extends BaseViewModel{ + + InsuranceCardService _insuranceCardService = locator(); + + + List get insuranceApproval => + _insuranceCardService.insuranceApproval; + + Future getInsuranceApproval(PatiantInformtion patient,{int appointmentNo}) async { + error = ""; + setState(ViewState.Busy); + if (appointmentNo != null) + await _insuranceCardService.getInsuranceApproval(patient, + appointmentNo: appointmentNo); + else + await _insuranceCardService.getInsuranceApproval(patient); + if (_insuranceCardService.hasError) { + error = _insuranceCardService.error; + setState(ViewState.ErrorLocal); + } else + setState(ViewState.Idle); + } +} \ No newline at end of file diff --git a/lib/locator.dart b/lib/locator.dart index 3a5b94b2..68daa9d1 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -15,8 +15,10 @@ 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/InsuranceCardService.dart'; import 'core/service/PatientMuseService.dart'; import 'core/service/SOAP_service.dart'; +import 'core/service/labs_service.dart'; import 'core/service/patient-admission-request-service.dart'; import 'core/service/doctor_reply_service.dart'; import 'core/service/medicine_service.dart'; @@ -26,9 +28,11 @@ 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/InsuranceViewModel.dart'; import 'core/viewModel/PatientMuseViewModel.dart'; import 'core/viewModel/SOAP_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart'; +import 'core/viewModel/labs_view_model.dart'; import 'core/viewModel/medicine_view_model.dart'; import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; @@ -61,6 +65,8 @@ void setupLocator() { locator.registerLazySingleton(() => UcafService()); locator.registerLazySingleton(() => AuthService()); locator.registerLazySingleton(() => PatientMuseService()); + locator.registerLazySingleton(() => LabsService()); + locator.registerLazySingleton(() => InsuranceCardService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -81,4 +87,6 @@ void setupLocator() { locator.registerFactory(() => UcafViewModel()); locator.registerFactory(() => MedicalFileViewModel()); locator.registerFactory(() => PatientMuseViewModel()); + locator.registerFactory(() => LabsViewModel()); + locator.registerFactory(() => InsuranceViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index 210396fe..c3930da2 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -2,9 +2,11 @@ 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/insurance_approval_screen_patient.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'; +import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart'; @@ -79,6 +81,7 @@ const String SERVICES = 'services'; const String SETTINGS = 'settings'; const String VITAL_SIGN = 'patients/vital-sign'; const String LAB_ORDERS = 'patients/lab_orders'; +const String LAB_RESULT = 'patients/lab_result'; const String PRESCRIPTIONS = 'patients/prescription'; const String MEDICAL_FILE = 'patients/radiology'; const String PROGRESS_NOTE = 'patients/progress-note'; @@ -86,8 +89,8 @@ const String REFER_PATIENT = 'patients/refer-patient'; const String MY_REFERRAL_DETAIL = 'my_referral_detail'; const String REFER_PATIENT_TO_DOCTOR = 'patients/refer-to-doctor'; const String PATIENT_ORDERS = 'patients/patient_orders'; -const String PATIENT_INSURANCE_APPROVALS = - 'patients/patient_insurance_approvals'; +const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; +const String PATIENT_INSURANCE_APPROVALS_NEW = 'patients/patient_insurance_approvals_new'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String PATIENT_VITAL_SIGN = 'patients/vital-sign-data'; const String CREATE_EPISODE = 'patients/create-episode'; @@ -136,6 +139,7 @@ var routes = { MESSAGES: (_) => MessagesScreen(), SERVICES: (_) => ServicesScreen(), LAB_ORDERS: (_) => LabOrdersScreen(), + LAB_RESULT: (_) => LabsHomePage(), PRESCRIPTIONS: (_) => PrescriptionScreen(), MEDICAL_FILE: (_) => MedicalFilePage(), PROGRESS_NOTE: (_) => ProgressNoteScreen(), @@ -143,6 +147,7 @@ var routes = { REFER_PATIENT_TO_DOCTOR: (_) => PatientMakeReferralScreen(), PATIENT_ORDERS: (_) => PatientsOrdersScreen(), PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), + PATIENT_INSURANCE_APPROVALS_NEW: (_) => InsuranceApprovalScreenNew(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), RADIOLOGY: (_) => RadiologyScreen(), diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart new file mode 100644 index 00000000..91ed13b2 --- /dev/null +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -0,0 +1,428 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.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_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +import '../base/base_view.dart'; + +class InsuranceApprovalScreenNew extends StatefulWidget { + final int appointmentNo; + + InsuranceApprovalScreenNew({this.appointmentNo}); + + @override + _InsuranceApprovalScreenNewState createState() => _InsuranceApprovalScreenNewState(); +} + +class _InsuranceApprovalScreenNewState extends State { + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + return BaseView( + onModelReady: widget.appointmentNo != null + ? (model) => + model.getInsuranceApproval(patient,appointmentNo: widget.appointmentNo) + : (model) => model.getInsuranceApproval(patient), + builder: (BuildContext context, InsuranceViewModel model, Widget child) => + AppScaffold( + isShowAppBar: true, + baseViewModel: model, + appBarTitle: TranslationBase.of(context).approvals, + + body: SingleChildScrollView( + child: Container( + margin: EdgeInsets.only( + left: SizeConfig.screenWidth * 0.004, + right: SizeConfig.screenWidth * 0.004, + top: SizeConfig.screenWidth * 0.04, + ), + child: Column( + children: [ + Container( + width: double.infinity, + height: SizeConfig.screenHeight * 0.09, + color: Color(0xffEEEEEE), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Texts( + TranslationBase.of(context).totalApproval, + color: Color(0xff60688B), + fontSize: 19.0, + fontWeight: FontWeight.w600, + ), + if (model.insuranceApproval.length > 0) + Container( + width: 60, + height: 40, + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(19.0)), + child: Center( + child: Texts( + model.insuranceApproval[0].unUsedCount + .toString(), + color: Colors.white, fontSize: 17.0, + ), + )) + ], + )), + ...List.generate( + model.insuranceApproval.length, + (index) => RoundedContainer( + backgroundColor: Colors.white, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + ExpansionTile( + title: Container( + //height: 120.0, + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + model.insuranceApproval[index].patientDescription == "In Patient" + ? Container( + decoration: BoxDecoration( + color: Theme.of(context).primaryColor, + borderRadius: + BorderRadius.circular( + 16.0)), + width: 115.0, + padding: + EdgeInsets.only(left: 11.5), + child: Center( + child: Texts( + TranslationBase.of(context).inPatient, + color: Colors.white, + ), + ), + ) + : Container( + decoration: BoxDecoration( + color: Color(0xff505A5D), + borderRadius: + BorderRadius.circular( + 16.0)), + width: 115.0, + padding: + EdgeInsets.only(left: 11.5), + child: Center( + child: Texts( + TranslationBase.of(context).outpatient, + color: Colors.white, + ), + ), + ), + Padding( + padding: EdgeInsets.symmetric( + vertical: 10.0), + child: Texts( + model.insuranceApproval[index] + .clinicName, + fontSize: 20.0, + color: Color(0xff60686B), + fontWeight: FontWeight.w600, + ), + ), + Texts( + model.insuranceApproval[index] + .doctorName, + fontSize: 17.0, + ), + ], + ), + ), + children: [ + Padding( + padding: EdgeInsets.symmetric( + vertical: 12.0, horizontal: 12.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Texts( + TranslationBase.of(context).approvalNo, + fontSize: 18.0, + ), + Texts(model.insuranceApproval[index].approvalNo.toString(), + fontSize: 18.0, + fontWeight: FontWeight.w600,), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).procedureStatus , + fontSize: 17.5, + ), + SizedBox(width: 12,), + Expanded( + child: Texts( + model.insuranceApproval[index].approvalStatusDescption, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).unusedCount, + fontSize: 17.5, + ), + Texts( + model.insuranceApproval[index].unUsedCount.toString(), + fontSize: 17.5, + fontWeight: FontWeight.w600, + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), +// Text( +// 'Company Name: ' + +// model.insuranceApproval[index] +// .companyName == +// null +// ? '000' +// : model +// .insuranceApproval[index].companyName, +// style: TextStyle( +// fontSize: 17.5, +// fontWeight: FontWeight.w600), +// ), + Texts( + TranslationBase.of(context).companyName, + fontWeight: FontWeight.w600, + fontSize: 17.5, + ), + + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).receiptOn , + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].rceiptOn), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + Row( + children: [ + Texts( + TranslationBase.of(context).expiryDate, + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + Texts( + convertDateFormat(model.insuranceApproval[index].expiryDate), + fontSize: 17.5, + fontWeight: FontWeight.w600, + + ), + ], + ), + Divider( + color: Colors.black, + height: 55.0, + thickness: 1.2, + ), + IntrinsicHeight( + child: Row( + crossAxisAlignment: + CrossAxisAlignment.center, + children: [ + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureName), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .procedureName, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 15.5), + ), + ), + ], + ), + ), + VerticalDivider( + width: 10.0, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .procedureStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .status, + style: TextStyle( + fontSize: 17.5, + fontWeight: + FontWeight + .w600), + ), + ), + ], + ), + ), + VerticalDivider( + width: 2.3, + thickness: 1.2, + color: Colors.black, + ), + Expanded( + flex: 1, + child: Column( + children: [ + Text(TranslationBase.of( + context) + .usageStatus), + Padding( + padding: EdgeInsets.only( + top: SizeConfig + .heightMultiplier * + 3.0), + child: Text( + model + .insuranceApproval[ + index] + .approvalDetails == + null + ? '' + : model + .insuranceApproval[ + index] + .approvalDetails + .isInvoicedDesc, + style: TextStyle( + fontWeight: + FontWeight.w600, + fontSize: 17.5), + ), + ), + ], + ), + ), + ], + ), + ), + Divider( + color: Colors.black, + height: 25.0, + thickness: 1.0, + ), + ], + ), + ), + ], + ), + ], + ), + )), + ], + ), + ), + ), + ), + ); + } + + convertDateFormat(String Date) { + const start = "/Date("; + const end = "+0300)"; + + final startIndex = Date.indexOf(start); + final endIndex = Date.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(Date.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "-" + + date.month.toString().padLeft(2, '0') + + "-" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 3861c822..868ad086 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1154,6 +1154,13 @@ class TranslationBase { String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; + String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; + String get companyName => localizedValues['companyName'][locale.languageCode]; + String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + } class TranslationBaseDelegate extends LocalizationsDelegate { 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 98487523..883b3e4b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -36,7 +36,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_INSURANCE_APPROVALS, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'lab.png'), @@ -44,7 +44,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: LAB_ORDERS, + route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'lab.png'), diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index f2e663bf..4f2c4271 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class Texts extends StatefulWidget { - final String text; final String variant; final Color color; @@ -16,13 +15,26 @@ class Texts extends StatefulWidget { final bool readMore; final String style; final bool allowExpand; - final TextDecoration textDecoration; + final double fontSize; + final FontWeight fontWeight; + final TextDecoration textDecoration; - Texts(this.text, {Key key, this.variant, this.color, - this.bold, this.regular, this.medium, this.allowExpand = true, - this.italic:false, this.textAlign, this.maxLength=60, - this.maxLines, this.readMore=false, this.style, this.textDecoration - }) : super(key: key); + Texts(this.text, + {Key key, + this.variant, + this.color, + this.bold, + this.regular, + this.medium, + this.allowExpand = true, + this.italic: false, + this.textAlign, + this.maxLength = 60, + this.maxLines, + this.readMore = false, + this.style, + this.textDecoration, this.fontSize, this.fontWeight}) + : super(key: key); @override _TextsState createState() => _TextsState(); @@ -35,7 +47,7 @@ class _TextsState extends State { @override void didUpdateWidget(Texts oldWidget) { setState(() { - if (widget.style=="overline") + if (widget.style == "overline") text = widget.text.toUpperCase(); else { text = widget.text; @@ -47,7 +59,7 @@ class _TextsState extends State { @override void initState() { hidden = widget.readMore; - if (widget.style=="overline") + if (widget.style == "overline") text = widget.text.toUpperCase(); else { text = widget.text; @@ -55,7 +67,7 @@ class _TextsState extends State { super.initState(); } - double _getFontSize () { + double _getFontSize() { switch (widget.variant) { case "heading0": return 40.0; @@ -92,16 +104,15 @@ class _TextsState extends State { } } - FontWeight _getFontWeight () { + FontWeight _getFontWeight() { if (widget.bold ?? false) { return FontWeight.w900; } else if (widget.regular ?? false) { return FontWeight.w500; } else if (widget.medium ?? false) { return FontWeight.w800; - } - else { - if (widget.style==null) { + } else { + if (widget.style == null) { switch (widget.variant) { case "heading": return FontWeight.w900; @@ -137,14 +148,12 @@ class _TextsState extends State { } else { return null; } - } } @override Widget build(BuildContext context) { - - TextStyle _getFontStyle () { + TextStyle _getFontStyle() { switch (widget.style) { case "headline2": return Theme.of(context).textTheme.headline2; @@ -168,7 +177,7 @@ class _TextsState extends State { return Theme.of(context).textTheme.overline; case "button": return Theme.of(context).textTheme.button; - default : + default: return TextStyle(); } } @@ -179,61 +188,71 @@ class _TextsState extends State { children: [ Stack( children: [ - Text(!hidden ? text : (text.substring(0, text.length > widget.maxLength ? widget.maxLength : text.length)), - textAlign: widget.textAlign, - overflow: widget.maxLines!=null ? ((widget.maxLines > 1) ? TextOverflow.fade : TextOverflow.ellipsis) : null, - maxLines: widget.maxLines ?? null, - style: widget.style != null ? _getFontStyle().copyWith( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color!=null ? widget.color : null, - fontWeight: _getFontWeight(), - ) : TextStyle( - fontStyle: widget.italic ? FontStyle.italic : null, - color: widget.color!=null ? widget.color : Colors.black, - fontSize: _getFontSize(), - letterSpacing: widget.variant=="overline" ? 1.5 : null, - fontWeight: _getFontWeight(), - decoration: widget.textDecoration//TextDecoration.lineThrough - ) - ), + Text( + !hidden + ? text + : (text.substring( + 0, + text.length > widget.maxLength + ? widget.maxLength + : text.length)), + textAlign: widget.textAlign, + overflow: widget.maxLines != null + ? ((widget.maxLines > 1) + ? TextOverflow.fade + : TextOverflow.ellipsis) + : null, + maxLines: widget.maxLines ?? null, + style: widget.style != null + ? _getFontStyle().copyWith( + fontStyle: widget.italic ? FontStyle.italic : null, + color: widget.color != null ? widget.color : null, + fontWeight: widget.fontWeight ?? _getFontWeight(), + ) + : TextStyle( + fontStyle: widget.italic ? FontStyle.italic : null, + color: + widget.color != null ? widget.color : Colors.black, + fontSize:widget.fontSize?? _getFontSize(), + letterSpacing: + widget.variant == "overline" ? 1.5 : null, + fontWeight: _getFontWeight(), + decoration: + widget.textDecoration //TextDecoration.lineThrough + )), if (widget.readMore && text.length > widget.maxLength && hidden) - Positioned( - bottom: 0, - left: 0, - right: 0, - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - colors: [ - Theme.of(context).backgroundColor, - Theme.of(context).backgroundColor.withOpacity(0), - ], - begin: Alignment.bottomCenter, - end: Alignment.topCenter - ) + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient(colors: [ + Theme.of(context).backgroundColor, + Theme.of(context).backgroundColor.withOpacity(0), + ], begin: Alignment.bottomCenter, end: Alignment.topCenter)), + height: 30, ), - height: 30, - ), - ) + ) ], ), - if (widget.allowExpand && widget.readMore && text.length > widget.maxLength) + if (widget.allowExpand && + widget.readMore && + text.length > widget.maxLength) Padding( padding: EdgeInsets.only(top: 8.0, right: 8.0, bottom: 8.0), child: InkWell( onTap: () { setState(() { - hidden=!hidden; + hidden = !hidden; }); }, child: Text(hidden ? "Read More" : "Read less", - style: _getFontStyle().copyWith( - color: HexColor('#FF0000'), - fontWeight: FontWeight.w800, - fontFamily: "WorkSans", - - ) - ), + style: _getFontStyle().copyWith( + color: HexColor('#FF0000'), + fontWeight: FontWeight.w800, + fontFamily: "WorkSans", + )), ), ), ], diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 080a4fab..6493c916 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -172,10 +172,10 @@ class DoctorCard extends StatelessWidget { Row( crossAxisAlignment: CrossAxisAlignment.center, children: [ - Image.asset( - 'assets/images/Icon-awesome-calendar.png', - width: 30, - height: 30, + Icon( + Icons.calendar_today_outlined, + size: 30, + color: Colors.red, ), Expanded( child: Texts( diff --git a/pubspec.lock b/pubspec.lock index 5333d889..4a3f9c9e 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -608,7 +608,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: @@ -900,7 +900,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: @@ -1084,5 +1084,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 c16b7ffca0e0677480fa3a665717eefdf92cf377 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 12:46:32 +0300 Subject: [PATCH 379/421] arrival page updated --- assets/images/type-booked.png | Bin 0 -> 388 bytes assets/images/type-livecare.png | Bin 0 -> 594 bytes assets/images/type-walkin.png | Bin 0 -> 639 bytes lib/models/patient/patiant_info_model.dart | 7 +- lib/widgets/patients/PatientCard.dart | 112 ++++++--------------- 5 files changed, 36 insertions(+), 83 deletions(-) create mode 100644 assets/images/type-booked.png create mode 100644 assets/images/type-livecare.png create mode 100644 assets/images/type-walkin.png diff --git a/assets/images/type-booked.png b/assets/images/type-booked.png new file mode 100644 index 0000000000000000000000000000000000000000..c42945cf1d442c369098ac6171a8641eb9d11542 GIT binary patch literal 388 zcmV-~0ek+5P)pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10TD?= zK~y-6t&}lJ15p%3&yzt-5jBuPTT3^Q)Pk+z3T!OgfKA*@D#Zo33>yVYL5zYXMh9{% z@&yUW%)rd8{(t|y!@u`40}E0I>R_>6wJ%GD2S6Wa1Ba&8@Fo zJr4B|*e|nKQ4gWo5DZ|p)*uWZvb1<%9&8=8fi5Y~UQHNkPi@q40F(mNb@f6$tAs7H ztZt{C*Ah-&on-|Ln?MWLN~KUcY5f@y`Lekp%jdudcuM0TEJJRw?G%TqA2WQZ2*_RGwPmt iqfTo4T*vCQy88?3SuGtE3Z%*a0000P000gM1^@s6+B&yD00009a7bBm000id z000id0mpBsWB>pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10pCeP zK~y-6rIbHtQ(+Xve=jdxlxRf+?I40+mY{<;IjA5`QZ2!$EL8L31V>#e3RTgmOF^NVl!%3zzNF3jIpjTgz9tg!!p8@Pd(XM|p6@->9qJSHhr`FR zdW~U2ee@6H`Iz_%?!458b_ zD9Y9>0#)D`a1NNE=i}=^B3a{411|xBFr>S(LR72KnV-kb?JMzW@LL literal 0 HcmV?d00001 diff --git a/assets/images/type-walkin.png b/assets/images/type-walkin.png new file mode 100644 index 0000000000000000000000000000000000000000..555023b3a7ee53b0374c41420f77d329dfa29b11 GIT binary patch literal 639 zcmV-_0)YLAP)A`f`00009a7bBm000id z000id0mpBsWB>pF8FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H10t`t+ zK~y-6mDJs9k8v2s@$Y7~Wl>I)gAp2XLY%O6U=AF3DEw=1Q8EUd?MjNl8p zvE*Mqim@fj~LH)CHKso$9vD4b?R=b#_0XpiC-&^QxNr}AqEYo`n93a4JI%RHMi zzygkxYQiL_DwEm;ROR#v{KQi{i*rwK7CSLN3+jmj-LY>(bq@F#&ryfdc$~f^I0}WA@mH3UmgpP3R#Bw~!{H-MiJC$oj0k7lxSY=9SvNIo3O7~Mr zt5QlGWqQ;X@BWlhdrIkAN@*gcG?-HANmz`5pnt+fG{wHRMBT20wxwJr>v0nGu|J$i z<$=uD!9sk+JJgf}=HQnU$4^@ncQhLbTH;3s{|Bm99E5jczdankV^P>@@d58kMyGfw z_v4%55ZoK~-I2`g;>9fBeCP)<(G6h`wRza;sMABm;dnKi zN3jcY@Jew6HAKWiai+OcbgdyyM5^boAfq>hHXi4OaRO6^EN0^t?qNfj2DQbtIF7ok Z_7^n)RX;#$J=y>O002ovPDHLkV1n#u8@vDj literal 0 HcmV?d00001 diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 7b54af8a..dc3c8b4e 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -55,6 +55,7 @@ class PatiantInformtion { String visitType; String nationalityFlagURL; int patientStatusType; + int visitTypeId; PatiantInformtion( {this.list, this.projectId, @@ -109,7 +110,8 @@ class PatiantInformtion { this.patientMRN, this.visitType, this.nationalityFlagURL, - this.patientStatusType}); + this.patientStatusType, + this.visitTypeId}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -177,5 +179,6 @@ class PatiantInformtion { nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], patientStatusType: - json['patientStatusType'] ?? json['patientStatusType']); + json['patientStatusType'] ?? json['patientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId']); } diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 93a176ea..a7e058ac 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -36,7 +36,7 @@ class PatientCard extends StatelessWidget { ), child: Stack(children: [ Container( - height: MediaQuery.of(context).size.height * .17, + height: MediaQuery.of(context).size.height * .20, width: 5, decoration: BoxDecoration( borderRadius: BorderRadius.only( @@ -47,7 +47,7 @@ class PatientCard extends StatelessWidget { : Colors.red[800], )), Container( - padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + padding: EdgeInsets.only(left: 10, right: 0, bottom: 0), child: InkWell( child: Column( children: [ @@ -153,16 +153,6 @@ class PatientCard extends StatelessWidget { 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), - // ), width: 60, height: 60, child: Image.asset( @@ -283,79 +273,39 @@ class PatientCard extends StatelessWidget { ) ])) ]), + SERVICES_PATIANT2[int.parse(patientType)] == + "patientArrivalList" + ? Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(4), + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomRight: Radius.circular(8), + topLeft: Radius.circular(8), + ), + color: Colors.red, + ), + child: Image.asset( + patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? 'assets/images/type-livecare.png' + : patientInfo.appointmentType == + 'Walkin' + ? 'assets/images/type-walkin.png' + : 'assets/images/type-booked.png', + height: 25, + width: 35, + )), + ]) + : SizedBox() ], ), 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) { From 7702495e690d6640bdf24c92fd2a86fd488319de Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 23 Mar 2021 16:04:51 +0200 Subject: [PATCH 380/421] fix referral detail screen bug --- assets/images/patient/Order_Procedures.png | Bin 0 -> 942 bytes assets/images/patient/Progress_notes.png | Bin 0 -> 765 bytes assets/images/patient/admission_req.png | Bin 0 -> 549 bytes assets/images/patient/arrow_forward.png | Bin 0 -> 232 bytes assets/images/patient/health_summary.png | Bin 0 -> 616 bytes assets/images/patient/lab_results.png | Bin 0 -> 1007 bytes assets/images/patient/order_prescription.png | Bin 0 -> 819 bytes assets/images/patient/patient_sick_leave.png | Bin 0 -> 631 bytes assets/images/patient/refer_patient.png | Bin 0 -> 988 bytes assets/images/patient/ucaf.png | Bin 0 -> 652 bytes assets/images/patient/vital_signs.png | Bin 0 -> 940 bytes .../profile/patient_profile_screen.dart | 147 +++++++++++++++++- .../referral/my-referral-detail-screen.dart | 2 +- pubspec.yaml | 1 + 14 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 assets/images/patient/Order_Procedures.png create mode 100644 assets/images/patient/Progress_notes.png create mode 100644 assets/images/patient/admission_req.png create mode 100644 assets/images/patient/arrow_forward.png create mode 100644 assets/images/patient/health_summary.png create mode 100644 assets/images/patient/lab_results.png create mode 100644 assets/images/patient/order_prescription.png create mode 100644 assets/images/patient/patient_sick_leave.png create mode 100644 assets/images/patient/refer_patient.png create mode 100644 assets/images/patient/ucaf.png create mode 100644 assets/images/patient/vital_signs.png diff --git a/assets/images/patient/Order_Procedures.png b/assets/images/patient/Order_Procedures.png new file mode 100644 index 0000000000000000000000000000000000000000..a3cd8ae0f6eb9b61803ddf798641144884322932 GIT binary patch literal 942 zcmeAS@N?(olHy`uVBq!ia0vp^ia;#Q!3-pi-WHq2z`&Rt;1l8sqf)xObg_#c#1RIO23}h@!J(vNu9VQ4i8RQaVEokij z|NjRw70dyKb$LmUUoZnB6ALRlC%1s0kg%wjq?ELboT8GlimIBHww|G>g^iQ5i>sTL zub+QlaA;g|N=9y8c|~P)Op1u1H96WUR z$k8)r&z-+|{l=}^ckbSQ^z8YIm#<#G{qW`Mx9>lH{rUT^>)C2Kpc5FAyxmOMyXnQEW!PUf6aJsryeW*P}y)~O0(gfZ_(G*_h0YWv2_0RM4f<;3CB-ah>I;%ubtg>yJU`^RL$0~ z>TAqvs_uzr*2lU}-MhYVRb)^1{7~7%$imYO;hs~=5)2}2xu2JbY`xq*v0|;eM0l{o zTVZbRYln_xO0j+Ee5`s{%6DeX!BgoL1#Zz1xy1`-9olL3N-j$-+pX}jL~H#+)t<@9 z<+0bp=h(lqiJxq zvI4W#t!w@GzC7a!TQ_}K)Ql$;uca0!#_H%sE=`iMC~e*4xz{t{OSnkr%l4lS;)FcH zzieW!SiM7Z$6xnuS%+`!P5E(=?o(~^{eRU-zNm`|^*(69E8Dku;SS#8l6Nn^Q)n-0 uT+|d8ae23%Qk&h6O@F>SANYAvFmTW?GgH>HQa7|#)3?+%wo%u!Q!%#E(6`Yxv{g4U*EF`!FtP#38dzx> zS!)L3MHAYC9sK;j^CfFeK!SOly9ECN(%2$Thq5CtIhK+_N`5SCQhF{Z{f1#D_5;qyJ6$j?K^kvKYZlW>2v2VUA=q% z!K24dp1pYW_T7h1pTB(l_UE74OKn}CMT|+_?k;gG*AjOF*{Yr{jv*3~wFf!PnGz*f zA4I2U`*=7_aXdMz^n_8Qc65#C(%=98x83nnt7x=Y~omvHH(^tM>>k2ACjy>sQ}9bmUEd%!6dc-l#3)9Scl(-#`fI+wr3 zzW(T{%Xi&ngVR~A1=l4{2JhIm!SQXP;Wgz#|4-^%$4^JB@T#9)utMhAiwsenz>G_q zxqP=SV=BM$?ZQ@Xe^VZZk1QA2PJVyeb7F7c9TrB{WfPO+D;*|&&3v=DUq|HR@rwrx z|4v=FLbSb^+cREJ!)l$<3-^nkqkd+yKAN*nYV(IbOlbjILV^os*ntwUr>mdKI;Vst E0CWrhAOHXW literal 0 HcmV?d00001 diff --git a/assets/images/patient/admission_req.png b/assets/images/patient/admission_req.png new file mode 100644 index 0000000000000000000000000000000000000000..b233508324fe6758b91754dd15adcfdfff68ecfc GIT binary patch literal 549 zcmeAS@N?(olHy`uVBq!ia0vp^ia;#K!3-p)inXf(sbc{?A+A6g1VTd{92|^|jdgWx zv@I<)%*=Gm&9zNU)$}d3jcwFSZM2OnwGC}GjBL~mtu+iSH4QC*40U5mbt7waBP&fq zOATWXL&L~g)5sDit^tIIq!(gijLssPIV|Np<;-=Cj>zHlfB@(X5QVrF3#6cQGfkd{+Y(K0r%ckv62j){v; zOwZ0QDJ`q0X=!cmm@swW(iJOLZP~f!$ni55FI~TL_uj+DPhYmo2p73mr zWSDnthTOX4uIgO#WCKOMi>+f&&u2KPqtCm4O7y23rzLqceMVn}yC)Vt_-H%hWYYTI z2`jI!3il}+uE;Wk^Vlzd7i!c(Q}ixp82qo%hq|R zv7px(AmuFvZ@uf6l>Xu44}QD9qUL*lI`GJQ#W_K)PH btKaiUUF>q7!X^6>=oto2S3j3^P6EIeHtLpZJ{Cp0jJF`BWN95|uhp?K_w z`U%fH65QfO55$C0(jN%AG4J6yGh-FUjQ-G;<^``4>sT0A`C05d{64<`n!(`d>gTe~ HDWM4f9%(^h literal 0 HcmV?d00001 diff --git a/assets/images/patient/health_summary.png b/assets/images/patient/health_summary.png new file mode 100644 index 0000000000000000000000000000000000000000..fe374ebcdc97663adbb41013d810755fb70a05eb GIT binary patch literal 616 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)j!3-ol&c;6kQXc|*LR^6~2!w{pSX!!>o9pV@ zXj@t;>shH;I%yhOX&RWTn^>zETdEpaXdBw98QN$YSZNwtXc*b38(M1^T4@Ptz|Lwf{RY3pxl?3?(GcYo9@(BuwNz1FMYiMfe8yFdz zSlZe-IJ(mRHxbcl7j6n>lyhl9d~F?%uQaz^T(`E?l~N_x^*2j~>5x z`Ret%k6*w4`1QB7N9!QaWX2?KcNhP>G)GS$=ZvR|V~EE2sh6(vH5rIBB+7J1vx?^x zE_`%vhxxjF{~u>)Bt>@|{Qu3{-~UpOi0F(p6SDYTMe{E(J^F(E#|ehzuQbM2=f(GP!dQ}XFKp4iP;u;l&$O9$KZJ;LuM~_D5|)40_;i(lr18 literal 0 HcmV?d00001 diff --git a/assets/images/patient/lab_results.png b/assets/images/patient/lab_results.png new file mode 100644 index 0000000000000000000000000000000000000000..20e6b5ff8c52947071aaca6489ff1ef4519fef96 GIT binary patch literal 1007 zcmeAS@N?(olHy`uVBq!ia0vp^(m*WB!3-pGf}dA0FfdLE@Ck7RazP+8)WN~Q*w|QG zTU$lNQvuA@)6-M8wl*+u(ABlkwzSkRGgC3NRo1i8F*jE?v{uu%RM9inF}2e+w$U`S z(lD@4Gquq)FxSwxQ8zMIGqlk*u+lWP&@i$AD%LW#(K51DH?~$cveGoM)-VQPFU@Km|rt8bCFMKyfP#BZMqa3Zw;S3rLHVhM^_UOihp)FdJy55yS+L zE|3+5K&wG2A!>jmNDyQoPyx_hutpdcYzRmk$N(#Y$Revjh^T|~f>eT$CDaXI13_$v z^FR!U0+>pm%b{9;42Uz3MG)-&|Nn1s@_Yk~k(QDmzhDMNW)@a9b`CCXUI9TNVNo%0 zDQOv5Ie7&oRW&_*10!P-b6ZCzS2wSKpy1H3@R<0dwDg?Z{KDe$iiXCfme#h;uKo#= z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P literal 0 HcmV?d00001 diff --git a/assets/images/patient/refer_patient.png b/assets/images/patient/refer_patient.png new file mode 100644 index 0000000000000000000000000000000000000000..ac3aea6e55e8814bfefad752df4e99eb4d5564b3 GIT binary patch literal 988 zcmeAS@N?(olHy`uVBq!ia0vp^G9b*s3?yAI>n~$qU~CKU32_B-As{p~)WN~Q*w|QG zTU$lNQ^CQ(($W&h)zj0{)^<==w+6Cxb#1h@Ej7%{jEx-(4Q+LF%yo3^w2f^H4Xq3e zEP%2)##VZI*1E=)Kv_LKD_vbn9V2rC11o)fOC3XN2t!ZLM$gDv*U(DGz!Id`5GZR6 zRIF!Y2~?m9LY6@FdWKd&1ZG?78d&QCxdzs{`anTzAOobp0IUG0*T52}OW)8^A0!22 zfK>vG1&RaJ0}TX=gBUbv4|BjD24S~_nP!i-9%)rRR%)-jX&cVsW z&BMztC?qT*DlRK0ub`x?uA!x)t7l+nVrph?VQFP+=ji0&?H>>r915>Wo>l7cW`1YR$U!8#Zm;vUU6ZgNKhCJ$~ZUnX~84U$}Jn`mMVU z9zA~Y?9JPEA3uNn_WkFt-+%ulzjamvx`i>x+ufy6XxF-bKz4pdpB=Q zz1H@tQ)FR*=hyDJ zvG~BsTP{x5{;|K(pSrA`d8_%-&Fr83Y7CYxySS>WB~RwrswlbI%LWTyyYG?P>ay;o z-NItoy|*;Z)}OZCa#DL%(XBO$n@rzjaBuwceCsctu-k=OdP}zN`t^(NMNyEnWx1VO z(bnYO`~0@0?wNPlcyHFtpE7Ym^D{k|k zbKf5i*Qt@R*KIb;2}oeNZ*A*$^b~67C8yS~ s-aR}cjN$a(2Gg&y$zhD!jI>|N3;bOc`L}d3J1CEOy85}Sb4q9e0M9I7f&c&j literal 0 HcmV?d00001 diff --git a/assets/images/patient/ucaf.png b/assets/images/patient/ucaf.png new file mode 100644 index 0000000000000000000000000000000000000000..f7293599c02d2363d1e2ff49456ecd6037bdf259 GIT binary patch literal 652 zcmeAS@N?(olHy`uVBq!ia0vp^av;pX3?zB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umber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patient.patientId.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + + ], + ) + ], + ), + ) + ], + crossAxisAlignment: CrossAxisAlignment.start, + ), + ], + ), + ), + ], + ), + ),*/ ], ), ), diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 8a919709..7449d970 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -33,7 +33,7 @@ class MyReferralDetailScreen extends StatelessWidget { return BaseView( onModelReady: (model) => model.getPatientDetails( DateUtils.convertStringToDateFormat( - DateTime.now().subtract(Duration(days: 350)).toString(), + DateTime.now()/*.subtract(Duration(days: 350))*/.toString(), "yyyy-MM-dd"), DateUtils.convertStringToDateFormat( DateTime.now().toString(), "yyyy-MM-dd"), diff --git a/pubspec.yaml b/pubspec.yaml index 6bc1526a..1865d370 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -103,6 +103,7 @@ flutter: - assets/images/ - assets/images/dashboard/ - assets/images/login/ + - assets/images/patient/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From 567334931073efb9992bcf475c04cf2df47da815 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 23 Mar 2021 16:06:08 +0200 Subject: [PATCH 381/421] pupsc lock --- pubspec.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/pubspec.lock b/pubspec.lock index 909670db..94eaf451 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -70,7 +70,7 @@ packages: name: build url: "https://pub.dartlang.org" source: hosted - version: "1.6.1" + version: "1.6.2" build_config: dependency: transitive description: @@ -84,35 +84,35 @@ packages: name: build_daemon url: "https://pub.dartlang.org" source: hosted - version: "2.1.6" + version: "2.1.7" build_modules: dependency: transitive description: name: build_modules url: "https://pub.dartlang.org" source: hosted - version: "3.0.3" + version: "3.0.4" build_resolvers: dependency: transitive description: name: build_resolvers url: "https://pub.dartlang.org" source: hosted - version: "1.5.2" + version: "1.5.3" build_runner: dependency: "direct dev" description: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.11.0" + version: "1.11.1" build_runner_core: dependency: transitive description: name: build_runner_core url: "https://pub.dartlang.org" source: hosted - version: "6.1.6" + version: "6.1.7" build_web_compilers: dependency: "direct dev" description: @@ -189,7 +189,7 @@ packages: name: code_builder url: "https://pub.dartlang.org" source: hosted - version: "3.6.0" + version: "3.7.0" collection: dependency: transitive description: @@ -287,14 +287,14 @@ packages: name: dropdown_search url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" equatable: dependency: transitive description: name: equatable url: "https://pub.dartlang.org" source: hosted - version: "1.2.5" + version: "1.2.6" eva_icons_flutter: dependency: "direct main" description: @@ -371,7 +371,7 @@ packages: name: fl_chart url: "https://pub.dartlang.org" source: hosted - version: "0.12.2" + version: "0.12.3" flutter: dependency: "direct main" description: flutter @@ -440,7 +440,7 @@ packages: name: font_awesome_flutter url: "https://pub.dartlang.org" source: hosted - version: "8.11.0" + version: "8.12.0" get_it: dependency: "direct main" description: @@ -524,14 +524,14 @@ packages: name: io url: "https://pub.dartlang.org" source: hosted - version: "0.3.4" + version: "0.3.5" js: dependency: transitive description: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3-nullsafety.1" + version: "0.6.2" json_annotation: dependency: transitive description: @@ -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: @@ -664,21 +664,21 @@ packages: name: percent_indicator url: "https://pub.dartlang.org" source: hosted - version: "2.1.9" + version: "2.1.9+1" permission_handler: dependency: "direct main" description: name: permission_handler url: "https://pub.dartlang.org" source: hosted - version: "5.0.1+1" + version: "5.1.0+2" permission_handler_platform_interface: dependency: transitive description: name: permission_handler_platform_interface url: "https://pub.dartlang.org" source: hosted - version: "2.0.1" + version: "2.0.2" platform: dependency: transitive description: @@ -720,7 +720,7 @@ packages: name: protobuf url: "https://pub.dartlang.org" source: hosted - version: "1.1.0" + version: "1.1.3" provider: dependency: "direct main" description: @@ -741,7 +741,7 @@ packages: name: pubspec_parse url: "https://pub.dartlang.org" source: hosted - version: "0.1.7" + version: "0.1.8" quiver: dependency: transitive description: @@ -797,7 +797,7 @@ packages: name: shared_preferences_windows url: "https://pub.dartlang.org" source: hosted - version: "0.0.2+2" + version: "0.0.2+3" shelf: dependency: transitive description: @@ -811,7 +811,7 @@ packages: name: shelf_web_socket url: "https://pub.dartlang.org" source: hosted - version: "0.2.3" + version: "0.2.4+1" sky_engine: dependency: transitive description: flutter @@ -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: @@ -935,7 +935,7 @@ packages: name: url_launcher_web url: "https://pub.dartlang.org" source: hosted - version: "0.1.5+1" + version: "0.1.5+3" url_launcher_windows: dependency: transitive description: @@ -970,7 +970,7 @@ packages: name: win32 url: "https://pub.dartlang.org" source: hosted - version: "1.7.4" + version: "1.7.4+1" xdg_directories: 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 12dc63716356ea40c550a2427912c52577f1bb74 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 23 Mar 2021 21:33:19 +0300 Subject: [PATCH 382/421] bug fixes --- lib/config/config.dart | 12 +- lib/core/service/sickleave_service.dart | 5 + lib/models/patient/patiant_info_model.dart | 137 +++++++++--------- .../add-rescheduleleave.dart | 33 ++--- lib/util/date-utils.dart | 23 +-- lib/widgets/auth/verification_methods.dart | 2 +- lib/widgets/patients/PatientCard.dart | 11 +- lib/widgets/shared/app_drawer_widget.dart | 1 + 8 files changed, 118 insertions(+), 106 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index a944a0a1..81dea160 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -//const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = @@ -151,8 +151,8 @@ const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail'; const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults'; -const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; - +const GET_Patient_LAB_ORDERS_RESULT = + 'Services/Patients.svc/REST/GetPatientLabOrdersResults'; // SOAP @@ -226,7 +226,8 @@ const GET_BOX_QUANTITY = ///GET ECG const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; -const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_PAtIENTS_INSURANCE_APPROVALS = + "Services/Patients.svc/REST/GetApprovalStatus"; var selectedPatientType = 1; @@ -294,7 +295,6 @@ const GENERAL_ID = 'Cs2020@2016\$2958'; const PATIENT_TYPE = 1; const PATIENT_TYPE_ID = 1; - /// Timer Info const TIMER_MIN = 10; diff --git a/lib/core/service/sickleave_service.dart b/lib/core/service/sickleave_service.dart index 3ef8229f..8a5babd5 100644 --- a/lib/core/service/sickleave_service.dart +++ b/lib/core/service/sickleave_service.dart @@ -114,6 +114,11 @@ class SickLeaveService extends BaseService { response['requisitionList']['entityList'].forEach((v) { _getReScheduleLeave.add(GetRescheduleLeavesResponse.fromJson(v)); }); + _getReScheduleLeave.sort((a, b) { + var adate = a.dateTimeFrom; //before -> var adate = a.date; + var bdate = b.dateTimeFrom; //var bdate = b.date; + return -adate.compareTo(bdate); + }); }, onFailure: (String error, int statusCode) { hasError = true; diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index dc3c8b4e..2c3bb2b2 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -56,6 +56,7 @@ class PatiantInformtion { String nationalityFlagURL; int patientStatusType; int visitTypeId; + String startTimes; PatiantInformtion( {this.list, this.projectId, @@ -111,74 +112,76 @@ class PatiantInformtion { this.visitType, this.nationalityFlagURL, this.patientStatusType, - this.visitTypeId}); + this.visitTypeId, + this.startTimes}); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( - projectId: json["ProjectID"] ?? json["projectID"], - clinicId: json["ClinicID"] ?? json["clinicID"], - doctorId: json["DoctorID"] ?? json["doctorID"], - patientId: json["PatientID"] ?? - json["patientID"] ?? - json['patientMRN'] ?? - json['PatientMRN'], - doctorName: json["DoctorName"] ?? json["doctorName"], - doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], - firstName: json["FirstName"] ?? json["firstName"], - middleName: json["MiddleName"] ?? json["middleName"], - lastName: json["LastName"] ?? json["lastName"], - firstNameN: json["FirstNameN"] ?? json["firstNameN"], - middleNameN: json["MiddleNameN"] ?? json["middleNameN"], - lastNameN: json["LastNameN"] ?? json["lastNameN"], - gender: json["Gender"] ?? json["gender"], - dateofBirth: json["DateofBirth"] ?? json["dob"], - nationalityId: json["NationalityID"] ?? json["nationalityID"], - mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], - emailAddress: json["EmailAddress"] ?? json["emailAddress"], - patientIdentificationNo: json["PatientIdentificationNo"] ?? - json["patientIdentificationNo"], - patientType: json["PatientType"] ?? json["patientType"], - admissionNo: json["AdmissionNo"] ?? json["admissionNo"], - admissionDate: json["AdmissionDate"] ?? json["admissionDate"], - createdOn: json["CreatedOn"] ?? json["CreatedOn"], - roomId: json["RoomID"] ?? json["roomID"], - bedId: json["BedID"] ?? json["bedID"], - nursingStationId: - json["NursingStationID"] ?? json["nursingStationID"], - description: json["Description"] ?? json["description"], - clinicDescription: - json["ClinicDescription"] ?? json["clinicDescription"], - clinicDescriptionN: - json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], - nationalityName: json["NationalityName"] ?? - json["nationalityName"] ?? - json['NationalityName'], - nationalityNameN: json["NationalityNameN"] ?? - json["nationalityNameN"] ?? - json['NationalityNameN'], - age: json["Age"] ?? json["age"], - genderDescription: json["GenderDescription"], - nursingStationName: json["NursingStationName"], - appointmentDate: json["AppointmentDate"] ?? '', - startTime: json["startTime"], - appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], - appointmentType: json['appointmentType'], - arrivedOn: json['arrivedOn'], - clinicGroupId: json['clinicGroupId'], - companyName: json['companyName'], - dischargeStatus: json['dischargeStatus'], - doctorDetails: json['doctorDetails'], - endTime: json['endTime'], - episodeNo: json['episodeNo'] ?? json['EpisodeID'], - fallRiskScore: json['fallRiskScore'], - isSigned: json['isSigned'], - medicationOrders: json['medicationOrders'], - nationality: json['nationality'] ?? json['NationalityNameN'], - patientMRN: json['patientMRN'] ?? json['PatientMRN'], - visitType: json['visitType'] ?? json['visitType'], - nationalityFlagURL: - json['NationalityFlagURL'] ?? json['NationalityFlagURL'], - patientStatusType: - json['patientStatusType'] ?? json['patientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId']); + projectId: json["ProjectID"] ?? json["projectID"], + clinicId: json["ClinicID"] ?? json["clinicID"], + doctorId: json["DoctorID"] ?? json["doctorID"], + patientId: json["PatientID"] ?? + json["patientID"] ?? + json['patientMRN'] ?? + json['PatientMRN'], + doctorName: json["DoctorName"] ?? json["doctorName"], + doctorNameN: json["DoctorNameN"] ?? json["doctorNameN"], + firstName: json["FirstName"] ?? json["firstName"], + middleName: json["MiddleName"] ?? json["middleName"], + lastName: json["LastName"] ?? json["lastName"], + firstNameN: json["FirstNameN"] ?? json["firstNameN"], + middleNameN: json["MiddleNameN"] ?? json["middleNameN"], + lastNameN: json["LastNameN"] ?? json["lastNameN"], + gender: json["Gender"] ?? json["gender"], + dateofBirth: json["DateofBirth"] ?? json["dob"], + nationalityId: json["NationalityID"] ?? json["nationalityID"], + mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], + emailAddress: json["EmailAddress"] ?? json["emailAddress"], + patientIdentificationNo: + json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], + patientType: json["PatientType"] ?? json["patientType"], + admissionNo: json["AdmissionNo"] ?? json["admissionNo"], + admissionDate: json["AdmissionDate"] ?? json["admissionDate"], + createdOn: json["CreatedOn"] ?? json["CreatedOn"], + roomId: json["RoomID"] ?? json["roomID"], + bedId: json["BedID"] ?? json["bedID"], + nursingStationId: json["NursingStationID"] ?? json["nursingStationID"], + description: json["Description"] ?? json["description"], + clinicDescription: + json["ClinicDescription"] ?? json["clinicDescription"], + clinicDescriptionN: + json["ClinicDescriptionN"] ?? json["clinicDescriptionN"], + nationalityName: json["NationalityName"] ?? + json["nationalityName"] ?? + json['NationalityName'], + nationalityNameN: json["NationalityNameN"] ?? + json["nationalityNameN"] ?? + json['NationalityNameN'], + age: json["Age"] ?? json["age"], + genderDescription: json["GenderDescription"], + nursingStationName: json["NursingStationName"], + appointmentDate: json["AppointmentDate"] ?? '', + startTime: json["startTime"], + appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], + appointmentType: json['appointmentType'], + arrivedOn: json['arrivedOn'], + clinicGroupId: json['clinicGroupId'], + companyName: json['companyName'], + dischargeStatus: json['dischargeStatus'], + doctorDetails: json['doctorDetails'], + endTime: json['endTime'], + episodeNo: json['episodeNo'] ?? json['EpisodeID'], + fallRiskScore: json['fallRiskScore'], + isSigned: json['isSigned'], + medicationOrders: json['medicationOrders'], + nationality: json['nationality'] ?? json['NationalityNameN'], + patientMRN: json['patientMRN'] ?? json['PatientMRN'], + visitType: json['visitType'] ?? json['visitType'], + nationalityFlagURL: + json['NationalityFlagURL'] ?? json['NationalityFlagURL'], + patientStatusType: + json['patientStatusType'] ?? json['patientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId'], + startTimes: json['StartTime'] ?? json['StartTime'], + ); } diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index d5760cc0..0dab0226 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -1,22 +1,16 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/leave_rechdule_response.dart'; -import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_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/sickleave/get_all_sickleave_response.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/reschedule-leaves/reschedule_leave.dart'; -import 'package:doctor_app_flutter/screens/sick-leave/sick_leave.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; class AddRescheduleLeavScreen extends StatelessWidget { ProjectViewModel projectsProvider; @@ -161,16 +155,21 @@ class AddRescheduleLeavScreen extends StatelessWidget { children: [ Flexible( child: Text( - item.dateTimeFrom + - ' ' + - TranslationBase.of( - context) - .to + - ' ' + - item.dateTimeTo, - // overflow: - // TextOverflow.ellipsis, - )) + DateUtils.convertStringToDateFormat( + item + .dateTimeFrom, + 'yyyy-MM-dd HH:mm') + + ' ' + + TranslationBase.of( + context) + .to + + ' ' + + DateUtils.convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm') + // overflow: + // TextOverflow.ellipsis, + )) ], ), SizedBox( diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 8e6cd17c..4ef21844 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -3,7 +3,6 @@ import 'package:flutter/cupertino.dart'; import 'package:intl/intl.dart'; class DateUtils { - static String convertDateToFormat(DateTime dateTime, String dateFormat) { return DateFormat(dateFormat).format(dateTime); } @@ -34,7 +33,8 @@ class DateUtils { return date; } - static String differenceBetweenDateAndCurrentInYearMonthDay(DateTime firstDate, BuildContext context) { + static String differenceBetweenDateAndCurrentInYearMonthDay( + DateTime firstDate, BuildContext context) { DateTime now = DateTime.now(); // now = now.add(Duration(days: 400, minutes: 0)); var difference = firstDate.difference(now); @@ -54,13 +54,15 @@ class DateUtils { return "$days ${TranslationBase.of(context).days}, $months ${TranslationBase.of(context).months}, $years ${TranslationBase.of(context).years}"; } - static String differenceBetweenDateAndCurrent(DateTime firstDate, BuildContext context) { + static String differenceBetweenDateAndCurrent( + DateTime firstDate, BuildContext context) { DateTime now = DateTime.now(); // DateTime now = nows.add(Duration(days: 400, minutes: 25, hours: 0)); var difference = now.difference(firstDate); int minutesInDays = difference.inMinutes; - int hoursInDays = minutesInDays ~/ 60; // ~/ : truncating division to make the result int + int hoursInDays = + minutesInDays ~/ 60; // ~/ : truncating division to make the result int int minutes = minutesInDays % 60; int days = hoursInDays ~/ 24; int hours = hoursInDays % 24; @@ -70,7 +72,8 @@ class DateUtils { return "$days ${TranslationBase.of(context).days}, $hours ${TranslationBase.of(context).hr}, $minutes ${TranslationBase.of(context).min}"; } - static String differenceBetweenServerDateAndCurrent(String str, BuildContext context) { + static String differenceBetweenServerDateAndCurrent( + String str, BuildContext context) { const start = "/Date("; const end = "+0300)"; @@ -217,7 +220,8 @@ class DateUtils { } } - static DateTime convertStringToDate(String date) { // /Date(1585774800000+0300)/ + static DateTime convertStringToDate(String date) { + // /Date(1585774800000+0300)/ if (date != null) { const start = "/Date("; const end = "+0300)"; @@ -258,11 +262,11 @@ class DateUtils { return ""; } - static String getAgeByBirthday(dynamic birthday, BuildContext context){ + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart - DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); + DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); final now = DateTime.now(); - int years = now.year - birthDate .year; + int years = now.year - birthDate.year; int months = now.month - birthDate.month; int days = now.day - birthDate.day; if (months < 0 || (months == 0 && days < 0)) { @@ -276,4 +280,3 @@ class DateUtils { return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } } - diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index d7f6a816..5e8d7674 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -695,7 +695,7 @@ class _VerificationMethodsState extends State { this.checkActivationCode(authProv, value: value); }, () => { - Navigator.pop(context), + widget.changeLoadingStata(false), print('Faild..'), }, ).displayDialog(context); diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index a7e058ac..f067e161 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -230,7 +230,7 @@ class PatientCard extends StatelessWidget { " : ", fontSize: 14, ), - patientInfo.startTime != null + patientInfo.startTimes != null ? Container( height: 15, width: 60, @@ -240,7 +240,7 @@ class PatientCard extends StatelessWidget { color: HexColor("#20A169"), ), child: AppText( - patientInfo.startTime, + patientInfo.startTimes, color: Colors.white, fontSize: 1.5 * SizeConfig.textMultiplier, @@ -254,9 +254,10 @@ class PatientCard extends StatelessWidget { ), Container( child: AppText( - convertDateFormat2(patientInfo - .appointmentDate - .toString()), + DateUtils.convertDateFromServerFormat( + patientInfo.appointmentDate + .toString(), + 'yyyy-MM-dd'), fontSize: 1.5 * SizeConfig.textMultiplier, fontWeight: FontWeight.bold, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 590f09d6..84144f49 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -126,6 +126,7 @@ class _AppDrawerState extends State { onPressed: () async { Navigator.pop(context); await helpers.logout(); + projectsProvider.isLogin = false; }, ), ], From 1ac94d9ec86f97cc5787d7d5f94099b9d17c3fa4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 24 Mar 2021 10:53:32 +0300 Subject: [PATCH 383/421] bug fixes --- lib/config/config.dart | 3 ++ lib/core/service/patient_service.dart | 57 +++++++++++++++------------ 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 81dea160..56fe8bff 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -53,6 +53,9 @@ const GET_PRESCRIPTION_REPORT = const GT_MY_PATIENT_QUESTION = 'Services/DoctorApplication.svc/REST/GtMyPatientsQuestions'; +const PRM_SEARCH_PATIENT = + 'Services/Patients.svc/REST/GetPatientInformation_PRM'; + const GET_PATIENT = 'Services/DoctorApplication.svc/REST/'; const GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT = diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index f18a9360..8370287a 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -87,13 +87,18 @@ class PatientService extends BaseService { ClinicByProjectIdRequest(); ReferToDoctorRequest _referToDoctorRequest; - Future getPatientList( patient, patientType) async { + Future getPatientList(patient, patientType, {isView}) async { hasError = false; int val = int.parse(patientType); - + var url; + if (isView == false && patientType == '1') { + url = PRM_SEARCH_PATIENT; + } else { + url = GET_PATIENT + SERVICES_PATIANT[val]; + } dynamic localRes; await baseAppClient.post( - GET_PATIENT + SERVICES_PATIANT[val], + url, onSuccess: (dynamic response, int statusCode) { localRes = response; }, @@ -101,28 +106,30 @@ class PatientService extends BaseService { hasError = true; super.error = error; }, - body:val ==7?patient: { - "ProjectID": patient.ProjectID, - "ClinicID": patient.ClinicID, - "DoctorID": patient.DoctorID, - "FirstName": patient.FirstName, - "MiddleName": patient.MiddleName, - "LastName": patient.LastName, - "PatientMobileNumber": patient.PatientMobileNumber, - "PatientIdentificationID": patient.PatientIdentificationID, - "PatientID": patient.PatientID, - "From": patient.From, - "To": patient.To, - "LanguageID": patient.LanguageID, - "stamp": patient.stamp, - "IPAdress": patient.IPAdress, - "VersionID": patient.VersionID, - "Channel": patient.Channel, - "TokenID": patient.TokenID, - "SessionID": patient.SessionID, - "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, - "PatientOutSA": patient.PatientOutSA - }, + body: val == 7 + ? patient + : { + "ProjectID": patient.ProjectID, + "ClinicID": patient.ClinicID, + "DoctorID": patient.DoctorID, + "FirstName": patient.FirstName, + "MiddleName": patient.MiddleName, + "LastName": patient.LastName, + "PatientMobileNumber": patient.PatientMobileNumber, + "PatientIdentificationID": patient.PatientIdentificationID, + "PatientID": patient.PatientID, + "From": patient.From, + "To": patient.To, + "LanguageID": patient.LanguageID, + "stamp": patient.stamp, + "IPAdress": patient.IPAdress, + "VersionID": patient.VersionID, + "Channel": patient.Channel, + "TokenID": patient.TokenID, + "SessionID": patient.SessionID, + "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, + "PatientOutSA": patient.PatientOutSA + }, ); return Future.value(localRes); From 10ef8f79548df08a92fc7ba3841b88967d4f35d6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 24 Mar 2021 10:53:48 +0300 Subject: [PATCH 384/421] bug fixes --- lib/core/viewModel/patient_view_model.dart | 10 +- .../patients/patient_search_screen.dart | 120 ++++++++++++------ lib/screens/patients/patients_screen.dart | 37 +++++- lib/widgets/patients/PatientCard.dart | 9 +- 4 files changed, 123 insertions(+), 53 deletions(-) diff --git a/lib/core/viewModel/patient_view_model.dart b/lib/core/viewModel/patient_view_model.dart index 70bf0899..5f4b6c9a 100644 --- a/lib/core/viewModel/patient_view_model.dart +++ b/lib/core/viewModel/patient_view_model.dart @@ -49,23 +49,21 @@ class PatientViewModel extends BaseViewModel { _patientService.referalFrequancyList; Future getPatientList(patient, patientType, - - {bool isBusyLocal = false}) async { - var localRes ; + {bool isBusyLocal = false, isView}) async { + var localRes; if (isBusyLocal) { setState(ViewState.BusyLocal); } else { setState(ViewState.Busy); } - localRes = await _patientService.getPatientList(patient, patientType); + localRes = await _patientService.getPatientList(patient, patientType, + isView: isView); if (_patientService.hasError) { error = _patientService.error; setState(ViewState.Error); - } return localRes; - } Future getPatientVitalSign(patient) async { diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 8b34c50d..d1a8cd22 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -93,6 +93,7 @@ class _PatientSearchScreenState extends State { "patientSearchForm": _patientSearchFormValues, "selectedType": _selectedType, "isSearch": true, + "isView": isView }); } } else { @@ -180,7 +181,7 @@ class _PatientSearchScreenState extends State { padding: EdgeInsets.all(10), child: AppTextFormField( labelText: - TranslationBase.of(context).phoneNumber, + TranslationBase.of(context).patientID, borderColor: Colors.white, textInputType: TextInputType.number, textInputAction: TextInputAction.done, @@ -188,15 +189,14 @@ class _PatientSearchScreenState extends State { focusNode: _nodeText1, onSaved: (value) { value == null || value == '' - ? _patientSearchFormValues - .setPatientMobileNumber = "0" - : _patientSearchFormValues - .setPatientMobileNumber = value; + ? _patientSearchFormValues.setPatientID = + 0 + : _patientSearchFormValues.setPatientID = + int.parse(value); if (value != null && value.toString().trim().isEmpty) { - _patientSearchFormValues - .setPatientMobileNumber = "0"; + _patientSearchFormValues.setPatientID = 0; } }, ), @@ -263,7 +263,8 @@ class _PatientSearchScreenState extends State { elevation: 16, selectedItemBuilder: (BuildContext context) { - return PATIENT_TYPE_Des.map((item) { + return PATIENT_TYPE_Des.map( + (item) { return Row( mainAxisSize: MainAxisSize.max, @@ -292,7 +293,8 @@ class _PatientSearchScreenState extends State { int.parse(_selectedType); }) }, - items: PATIENT_TYPE_Des.map((item) { + items: + PATIENT_TYPE_Des.map((item) { !projectsProvider.isArabic ? itemText = item['text'] : itemText = @@ -347,35 +349,39 @@ class _PatientSearchScreenState extends State { 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( + if (_selectedType != '7') + 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, + .phoneNumber, borderColor: Colors.white, + textInputType: TextInputType.number, + textInputAction: TextInputAction.done, + inputFormatter: ONLY_NUMBERS, + focusNode: _nodeText1, onSaved: (value) { value == null || value == '' ? _patientSearchFormValues - .setMiddleName = "0" + .setPatientMobileNumber = "0" : _patientSearchFormValues - .setMiddleName = value; + .setPatientMobileNumber = + value; + if (value != null && value.toString().trim().isEmpty) { _patientSearchFormValues - .setMiddleName = "0"; + .setPatientMobileNumber = "0"; } }, - // validator: (value) { - // return TextValidator().validateName(value); - // }, - inputFormatter: ONLY_LETTERS), - ), + ), + ), SizedBox( height: 10, ), @@ -389,20 +395,23 @@ class _PatientSearchScreenState extends State { padding: EdgeInsets.all(10), child: AppTextFormField( labelText: TranslationBase.of(context) - .lastName, + .middleName, borderColor: Colors.white, onSaved: (value) { value == null || value == '' ? _patientSearchFormValues - .setLastName = "0" + .setMiddleName = "0" : _patientSearchFormValues - .setLastName = value; + .setMiddleName = value; if (value != null && value.toString().trim().isEmpty) { _patientSearchFormValues - .setLastName = "0"; + .setMiddleName = "0"; } }, + // validator: (value) { + // return TextValidator().validateName(value); + // }, inputFormatter: ONLY_LETTERS), ), SizedBox( @@ -418,25 +427,54 @@ class _PatientSearchScreenState extends State { padding: EdgeInsets.all(10), child: AppTextFormField( labelText: TranslationBase.of(context) - .patientID, + .lastName, borderColor: Colors.white, - textInputType: TextInputType.number, - inputFormatter: ONLY_NUMBERS, - focusNode: _nodeText2, onSaved: (value) { value == null || value == '' ? _patientSearchFormValues - .setPatientID = 0 + .setLastName = "0" : _patientSearchFormValues - .setPatientID = - int.parse(value); + .setLastName = value; if (value != null && - value.trim().toString().isEmpty) { + value.toString().trim().isEmpty) { _patientSearchFormValues - .setPatientID = 0; + .setLastName = "0"; } - }), + }, + 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) + // .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, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 2900f56a..acd5dfa9 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -24,6 +24,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import '../../config/size_config.dart'; @@ -34,11 +35,13 @@ class PatientsScreen extends StatefulWidget { final selectedType; final isAppbar; final arrivalType; + final isView; PatientsScreen( {this.patientSearchForm, this.selectedType, this.isAppbar = true, - this.arrivalType}); + this.arrivalType, + this.isView}); @override _PatientsScreenState createState() => _PatientsScreenState(); } @@ -261,7 +264,8 @@ class _PatientsScreenState extends State { val2 == 7 ? getPatientArrivalListRequestModel.toJson() : patient, - patientType) + patientType, + isView: widget.isView) .then((res) { setState(() { if (res != null && res['MessageStatus'] == 1) { @@ -289,6 +293,20 @@ class _PatientsScreenState extends State { } parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; + responseModelList.sort((a, b) { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + }); + responseModelList2 = responseModelList; _isError = false; } else { @@ -516,7 +534,8 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, - "isSearch":isSearch + "isSearch": + isSearch }); }, ); @@ -597,8 +616,16 @@ class _PatientsScreenState extends State { parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; responseModelList.sort((a, b) { - var adate = a.arrivedOn; - var bdate = b.arrivedOn; //before -> var bdate = b.expiry; + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; return adate.compareTo(bdate); }); responseModelList2 = responseModelList; diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index f067e161..5e34e7b9 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -286,7 +286,14 @@ class PatientCard extends StatelessWidget { bottomRight: Radius.circular(8), topLeft: Radius.circular(8), ), - color: Colors.red, + color: patientInfo.appointmentType == + 'Regular' && + patientInfo.visitTypeId == 100 + ? HexColor('#D02127') + : patientInfo.appointmentType == + 'Walkin' + ? HexColor('#28323A') + : HexColor('#6C7379'), ), child: Image.asset( patientInfo.appointmentType == From 96d285daa6334a842897144f95cd01e9fafe01a6 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 24 Mar 2021 10:26:35 +0200 Subject: [PATCH 385/421] patient profile new design --- lib/screens/patients/patients_screen.dart | 3 +- .../profile/patient_profile_screen.dart | 171 ++++++++++++++++-- 2 files changed, 159 insertions(+), 15 deletions(-) diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 2900f56a..feec4b53 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -516,7 +516,8 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, - "isSearch":isSearch + "isSearch": isSearch, + "arrivalType" :arrivalType, }); }, ); diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ff07c4cf..6adf2eee 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -14,6 +14,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; /* @@ -65,7 +67,7 @@ class PatientProfileScreen extends StatelessWidget { SliverList( delegate: SliverChildListDelegate( [ - Column( + /* Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( @@ -560,8 +562,8 @@ class PatientProfileScreen extends StatelessWidget { ), ), ], - ), - /* Container( + ),*/ + Container( // margin: EdgeInsets.all(6), padding: EdgeInsets.only( left: 0, right: 5, bottom: 5, top: 5), @@ -661,47 +663,151 @@ class PatientProfileScreen extends StatelessWidget { ], )) : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of( + context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient + .startTime, + color: Colors + .white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: + TextAlign + .center, + fontWeight: + FontWeight + .bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2( + patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), Row( mainAxisAlignment: - MainAxisAlignment - .spaceBetween, + MainAxisAlignment + .spaceBetween, children: [ RichText( text: new TextSpan( style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: 2.0 * + SizeConfig + .textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase.of(context) + text: TranslationBase + .of(context) .fileNumber, style: TextStyle( fontSize: 14, - fontFamily: 'Poppins')), + fontFamily: + 'Poppins')), new TextSpan( - text: patient.patientId.toString(), + text: patient + .patientId + .toString(), style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', + fontWeight: + FontWeight + .w700, + fontFamily: + 'Poppins', fontSize: 15)), ], ), ), - + Expanded(child: Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 14, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius.circular(20.0), + child: Image.network( + patient.nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: (BuildContext context, + Object exception, + StackTrace stackTrace) { + return Text('No Image'); + }, + )) + : SizedBox() + ], + )) ], ) ], ), ) ], - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, ), ], ), ), ], ), - ),*/ + ), ], ), ), @@ -749,3 +855,40 @@ class AvatarWidget extends StatelessWidget { ); } } + +convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); +} + + +isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); +} + +myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); +} From 56d3f6a9bb7a20c5fa1ff316d82e392f4d670ec5 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 24 Mar 2021 13:06:01 +0200 Subject: [PATCH 386/421] fix issue --- lib/models/patient/patiant_info_model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2c3bb2b2..205cfb0a 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -139,7 +139,8 @@ class PatiantInformtion { emailAddress: json["EmailAddress"] ?? json["emailAddress"], patientIdentificationNo: json["PatientIdentificationNo"] ?? json["patientIdentificationNo"], - patientType: json["PatientType"] ?? json["patientType"], + //TODO make 7 dynamic when the backend retrun it in patient arrival + patientType: json["PatientType"] ?? json["patientType"]??7, admissionNo: json["AdmissionNo"] ?? json["admissionNo"], admissionDate: json["AdmissionDate"] ?? json["admissionDate"], createdOn: json["CreatedOn"] ?? json["CreatedOn"], From 091234ad773cc35fb9fc0c9971930eed440549ec Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 24 Mar 2021 14:14:37 +0300 Subject: [PATCH 387/421] bug fix --- lib/config/config.dart | 4 +- lib/core/service/patient_service.dart | 2 +- lib/models/patient/patient_model.dart | 98 +++++++++++------------ lib/screens/patients/patients_screen.dart | 42 ++++++---- 4 files changed, 77 insertions(+), 69 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 56fe8bff..56cd8d6c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index 8370287a..4f190ff8 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -128,7 +128,7 @@ class PatientService extends BaseService { "TokenID": patient.TokenID, "SessionID": patient.SessionID, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, - "PatientOutSA": patient.PatientOutSA + "PatientOutSA": patient.PatientOutSA, }, ); diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index c6f4602d..08b5d1d0 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -1,4 +1,3 @@ - /* *@author:Modified by amjad add getter and setter Amjad Amireh *@Date:11/5/2020 @@ -29,91 +28,88 @@ class PatientModel { String SessionID; bool IsLoginForDoctorApp; bool PatientOutSA; + int Searchtype; + int get getProjectID => ProjectID; - int get getProjectID => ProjectID; - - set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + set setProjectID(int ProjectID) => this.ProjectID = ProjectID; - int get getClinicID => ClinicID; + int get getClinicID => ClinicID; - set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + set setClinicID(int ClinicID) => this.ClinicID = ClinicID; - int get getDoctorID => DoctorID; + int get getDoctorID => DoctorID; - set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; + set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; String get getFirstName => FirstName; - set setFirstName(String FirstName) => this.FirstName = FirstName; + set setFirstName(String FirstName) => this.FirstName = FirstName; - String get getMiddleName => MiddleName; + String get getMiddleName => MiddleName; - set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; - String get getLastName => LastName; + String get getLastName => LastName; - set setLastName(String LastName) => this.LastName = LastName; + set setLastName(String LastName) => this.LastName = LastName; - String get getPatientMobileNumber => PatientMobileNumber; + String get getPatientMobileNumber => PatientMobileNumber; - set setPatientMobileNumber(String PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; + set setPatientMobileNumber(String PatientMobileNumber) => + this.PatientMobileNumber = PatientMobileNumber; // String get getPatientIdentificationID => PatientIdentificationID; // set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; - int get getPatientID => PatientID; - - set setPatientID(int PatientID) => this.PatientID = PatientID; - - String get getFrom => From; + int get getPatientID => PatientID; - set setFrom(String From) => this.From = From; + set setPatientID(int PatientID) => this.PatientID = PatientID; - String get getTo => To; + String get getFrom => From; - set setTo(String To) => this.To = To; + set setFrom(String From) => this.From = From; - int get getLanguageID => LanguageID; + String get getTo => To; - set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + set setTo(String To) => this.To = To; - String get getStamp => stamp; + int get getLanguageID => LanguageID; - set setStamp(String stamp) => this.stamp = stamp; + set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; - String get getIPAdress => IPAdress; + String get getStamp => stamp; - set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + set setStamp(String stamp) => this.stamp = stamp; - double get getVersionID => VersionID; + String get getIPAdress => IPAdress; - set setVersionID(double VersionID) => this.VersionID = VersionID; + set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; - int get getChannel => Channel; + double get getVersionID => VersionID; - set setChannel(int Channel) => this.Channel = Channel; + set setVersionID(double VersionID) => this.VersionID = VersionID; - String get getTokenID => TokenID; + int get getChannel => Channel; - set setTokenID(String TokenID) => this.TokenID = TokenID; + set setChannel(int Channel) => this.Channel = Channel; - String get getSessionID => SessionID; + String get getTokenID => TokenID; - set setSessionID(String SessionID) => this.SessionID = SessionID; + set setTokenID(String TokenID) => this.TokenID = TokenID; - bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; - - set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; - - bool get getPatientOutSA => PatientOutSA; - - set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + String get getSessionID => SessionID; + set setSessionID(String SessionID) => this.SessionID = SessionID; + bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => + this.IsLoginForDoctorApp = IsLoginForDoctorApp; + bool get getPatientOutSA => PatientOutSA; + set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; PatientModel( {this.ProjectID, @@ -135,15 +131,13 @@ class PatientModel { this.TokenID, this.SessionID, this.IsLoginForDoctorApp, - this.PatientOutSA}); - + this.PatientOutSA, + this.Searchtype}); - factory PatientModel.fromJson(Map json) => PatientModel( - + factory PatientModel.fromJson(Map json) => PatientModel( FirstName: json["FirstName"], - LastName: json["LasttName"], - - ); + LastName: json["LasttName"], + ); Map toJson() { final Map data = new Map(); data['ProjectID'] = this.ProjectID; @@ -167,8 +161,8 @@ class PatientModel { data['SessionID'] = this.SessionID; data['IsLoginForDoctorApp'] = this.IsLoginForDoctorApp; data['PatientOutSA'] = this.PatientOutSA; + data['Searchtype'] = this.Searchtype; return data; } } //*************************** - \ No newline at end of file diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index acd5dfa9..56935a8e 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -79,7 +79,7 @@ class _PatientsScreenState extends State { String error = ""; String arrivalType; ProjectViewModel projectsProvider; - + var isView; final _controller = TextEditingController(); PatientModel patient; @@ -239,6 +239,10 @@ class _PatientsScreenState extends State { if (routeArgs != null && routeArgs.containsKey("isSearch")) { isSearch = routeArgs['isSearch']; } + if (routeArgs != null && routeArgs.containsKey("isSearch")) { + isView = routeArgs['isView']; + patient.Searchtype = 1; + } if (!projectsProvider.isArabic) patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -265,7 +269,7 @@ class _PatientsScreenState extends State { ? getPatientArrivalListRequestModel.toJson() : patient, patientType, - isView: widget.isView) + isView: isView) .then((res) { setState(() { if (res != null && res['MessageStatus'] == 1) { @@ -289,24 +293,34 @@ class _PatientsScreenState extends State { lItems = localList; } } else { + if (isView == false && val2 == 1) { + lItems = res['GetPatientFileInformation_PRMList']; + } lItems = res[SERVICES_PATIANT2[val2]]; } parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; + //if (val2 == 7) { responseModelList.sort((a, b) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); + if (b.startTime != null && b.startTime != null) { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + } else { + var adate = convertDateFormat(a.appointmentDate); + var bdate = convertDateFormat(b.appointmentDate); + return bdate.compareTo(adate); + } }); - + //} responseModelList2 = responseModelList; _isError = false; } else { From 17f8b05748436cc189d166b0fa9f5a7fefa4ea02 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 24 Mar 2021 13:17:11 +0200 Subject: [PATCH 388/421] Add prescriptions and radiology from the patient app --- ios/Podfile.lock | 4 +- lib/client/base_app_client.dart | 5 +- lib/config/config.dart | 19 +- lib/config/localized_values.dart | 5 + .../model/Prescriptions/Prescriptions.dart | 158 +++++++++++++++ .../Prescriptions/perscription_pharmacy.dart | 108 ++++++++++ .../Prescriptions/prescription_report.dart | 191 ++++++++++++++++++ .../prescription_report_enh.dart | 144 +++++++++++++ .../Prescriptions/prescriptions_order.dart | 134 ++++++++++++ ...t_get_list_pharmacy_for_prescriptions.dart | 60 ++++++ .../request_prescription_report.dart | 88 ++++++++ .../request_prescription_report_enh.dart | 86 ++++++++ lib/core/model/radiology/final_radiology.dart | 190 +++++++++++++++++ .../request_patient_rad_orders_details.dart | 92 +++++++++ .../request_send_rad_report_email.dart | 116 +++++++++++ lib/core/service/prescriptions_service.dart | 182 +++++++++++++++++ lib/core/service/radiology_service.dart | 48 +++++ .../viewModel/prescriptions_view_model.dart | 145 +++++++++++++ lib/core/viewModel/radiology_view_model.dart | 88 ++++++++ lib/locator.dart | 8 + lib/routes.dart | 3 + .../radiology/radiology_details_page.dart | 79 ++++++++ .../radiology/radiology_home_page.dart | 114 +++++++++++ .../prescription_details_page.dart | 168 +++++++++++++++ .../prescription/prescription_items_page.dart | 182 +++++++++++++++++ .../prescription/prescriptions_page.dart | 122 +++++++++++ lib/util/translations_delegate_base.dart | 4 + .../profile/profile_medical_info_widget.dart | 7 + .../profile_medical_info_widget_search.dart | 10 +- 29 files changed, 2549 insertions(+), 11 deletions(-) create mode 100644 lib/core/model/Prescriptions/Prescriptions.dart create mode 100644 lib/core/model/Prescriptions/perscription_pharmacy.dart create mode 100644 lib/core/model/Prescriptions/prescription_report.dart create mode 100644 lib/core/model/Prescriptions/prescription_report_enh.dart create mode 100644 lib/core/model/Prescriptions/prescriptions_order.dart create mode 100644 lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart create mode 100644 lib/core/model/Prescriptions/request_prescription_report.dart create mode 100644 lib/core/model/Prescriptions/request_prescription_report_enh.dart create mode 100644 lib/core/model/radiology/final_radiology.dart create mode 100644 lib/core/model/radiology/request_patient_rad_orders_details.dart create mode 100644 lib/core/model/radiology/request_send_rad_report_email.dart create mode 100644 lib/core/service/prescriptions_service.dart create mode 100644 lib/core/service/radiology_service.dart create mode 100644 lib/core/viewModel/prescriptions_view_model.dart create mode 100644 lib/core/viewModel/radiology_view_model.dart create mode 100644 lib/screens/patients/profile/radiology/radiology_details_page.dart create mode 100644 lib/screens/patients/profile/radiology/radiology_home_page.dart create mode 100644 lib/screens/prescription/prescription_details_page.dart create mode 100644 lib/screens/prescription/prescription_items_page.dart create mode 100644 lib/screens/prescription/prescriptions_page.dart diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 19ebd328..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -98,7 +98,7 @@ PODS: - Flutter - path_provider_windows (0.0.1): - Flutter - - "permission_handler (5.0.1+1)": + - "permission_handler (5.1.0+2)": - Flutter - PromisesObjC (1.2.11) - Protobuf (3.13.0) @@ -297,7 +297,7 @@ SPEC CHECKSUMS: OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b - permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + permission_handler: ccb20a9fad0ee9b1314a52b70b76b473c5f8dab0 PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index ae355a3f..722aa533 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'dart:io' show Platform; @@ -85,7 +86,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - + String asd= json.encode(body); if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), @@ -127,7 +128,7 @@ class BaseAppClient { {Map body, Function(dynamic response, int statusCode) onSuccess, Function(String error, int statusCode) onFailure, - PatiantInformtion patient, + @required PatiantInformtion patient, bool isExternal = false}) async { String url = BASE_URL + endPoint; diff --git a/lib/config/config.dart b/lib/config/config.dart index 56fe8bff..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = @@ -232,6 +232,21 @@ const GET_ECG = "Services/Patients.svc/REST/HIS_GetPatientMuseResults"; const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus"; +const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; +const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; +///Prescriptions +const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; +const GET_PRESCRIPTIONS_ALL_ORDERS = + 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; +const GET_PRESCRIPTION_REPORT_NEW = + 'Services/Patients.svc/REST/INP_GetPrescriptionReport'; +const SEND_PRESCRIPTION_EMAIL = + 'Services/Notifications.svc/REST/SendPrescriptionEmail'; +const GET_PRESCRIPTION_REPORT_ENH = + 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; +const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; + + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4f64d5ee..eb860669 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -782,5 +782,10 @@ const Map> localizedValues = { "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, + "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, + "notes": {"en": "Notes", "ar": "ملاحظات"}, + "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + + }; diff --git a/lib/core/model/Prescriptions/Prescriptions.dart b/lib/core/model/Prescriptions/Prescriptions.dart new file mode 100644 index 00000000..78bc9105 --- /dev/null +++ b/lib/core/model/Prescriptions/Prescriptions.dart @@ -0,0 +1,158 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class Prescriptions { + String setupID; + int projectID; + int patientID; + int appointmentNo; + String appointmentDate; + String doctorName; + String clinicDescription; + String name; + int episodeID; + int actualDoctorRate; + int admission; + int clinicID; + String companyName; + String despensedStatus; + DateTime dischargeDate; + int dischargeNo; + int doctorID; + String doctorImageURL; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isDoctorAllowVedioCall; + bool isExecludeDoctor; + bool isInOutPatient; + bool isLiveCareAppointment; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + bool isInsurancePatient; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + List speciality; + + Prescriptions( + {this.setupID, + this.projectID, + this.patientID, + this.appointmentNo, + this.appointmentDate, + this.doctorName, + this.clinicDescription, + this.name, + this.episodeID, + this.actualDoctorRate, + this.admission, + this.clinicID, + this.companyName, + this.despensedStatus, + this.dischargeDate, + this.dischargeNo, + this.doctorID, + this.doctorImageURL, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isDoctorAllowVedioCall, + this.isExecludeDoctor, + this.isInOutPatient, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.isInsurancePatient, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.speciality,this.isLiveCareAppointment}); + + Prescriptions.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + appointmentNo = json['AppointmentNo']; + appointmentDate = json['AppointmentDate']; + doctorName = json['DoctorName']; + clinicDescription = json['ClinicDescription']; + name = json['Name']; + episodeID = json['EpisodeID']; + actualDoctorRate = json['ActualDoctorRate']; + admission = json['Admission']; + clinicID = json['ClinicID']; + companyName = json['CompanyName']; + despensedStatus = json['Despensed_Status']; + dischargeDate = DateUtils.convertStringToDate(json['DischargeDate']); + dischargeNo = json['DischargeNo']; + doctorID = json['DoctorID']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatient = json['IsInOutPatient']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + isInsurancePatient = json['IsInsurancePatient']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + // speciality = json['Speciality'].cast(); + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['AppointmentNo'] = this.appointmentNo; + data['AppointmentDate'] = this.appointmentDate; + data['DoctorName'] = this.doctorName; + data['ClinicDescription'] = this.clinicDescription; + data['Name'] = this.name; + data['EpisodeID'] = this.episodeID; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['Admission'] = this.admission; + data['ClinicID'] = this.clinicID; + data['CompanyName'] = this.companyName; + data['Despensed_Status'] = this.despensedStatus; + data['DischargeDate'] = this.dischargeDate; + data['DischargeNo'] = this.dischargeNo; + data['DoctorID'] = this.doctorID; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatient'] = this.isInOutPatient; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['IsInsurancePatient'] = this.isInsurancePatient; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['Speciality'] = this.speciality; + data['IsLiveCareAppointment'] = this.isLiveCareAppointment; + return data; + } +} + +class PrescriptionsList { + String filterName = ""; + List prescriptionsList = List(); + + PrescriptionsList({this.filterName, Prescriptions prescriptions}) { + prescriptionsList.add(prescriptions); + } +} diff --git a/lib/core/model/Prescriptions/perscription_pharmacy.dart b/lib/core/model/Prescriptions/perscription_pharmacy.dart new file mode 100644 index 00000000..3adaef7e --- /dev/null +++ b/lib/core/model/Prescriptions/perscription_pharmacy.dart @@ -0,0 +1,108 @@ +class PharmacyPrescriptions { + String expiryDate; + dynamic sellingPrice; + int quantity; + int itemID; + int locationID; + int projectID; + String setupID; + String locationDescription; + Null locationDescriptionN; + String itemDescription; + Null itemDescriptionN; + String alias; + int locationTypeID; + int barcode; + Null companybarcode; + int cityID; + String cityName; + int distanceInKilometers; + String latitude; + int locationType; + String longitude; + String phoneNumber; + String projectImageURL; + Null sortOrder; + + PharmacyPrescriptions( + {this.expiryDate, + this.sellingPrice, + this.quantity, + this.itemID, + this.locationID, + this.projectID, + this.setupID, + this.locationDescription, + this.locationDescriptionN, + this.itemDescription, + this.itemDescriptionN, + this.alias, + this.locationTypeID, + this.barcode, + this.companybarcode, + this.cityID, + this.cityName, + this.distanceInKilometers, + this.latitude, + this.locationType, + this.longitude, + this.phoneNumber, + this.projectImageURL, + this.sortOrder}); + + PharmacyPrescriptions.fromJson(Map json) { + expiryDate = json['ExpiryDate']; + sellingPrice = json['SellingPrice']; + quantity = json['Quantity']; + itemID = json['ItemID']; + locationID = json['LocationID']; + projectID = json['ProjectID']; + setupID = json['SetupID']; + locationDescription = json['LocationDescription']; + locationDescriptionN = json['LocationDescriptionN']; + itemDescription = json['ItemDescription']; + itemDescriptionN = json['ItemDescriptionN']; + alias = json['Alias']; + locationTypeID = json['LocationTypeID']; + barcode = json['Barcode']; + companybarcode = json['Companybarcode']; + cityID = json['CityID']; + cityName = json['CityName']; + distanceInKilometers = json['DistanceInKilometers']; + latitude = json['Latitude']; + locationType = json['LocationType']; + longitude = json['Longitude']; + phoneNumber = json['PhoneNumber']; + projectImageURL = json['ProjectImageURL']; + sortOrder = json['SortOrder']; + } + + Map toJson() { + final Map data = new Map(); + data['ExpiryDate'] = this.expiryDate; + data['SellingPrice'] = this.sellingPrice; + data['Quantity'] = this.quantity; + data['ItemID'] = this.itemID; + data['LocationID'] = this.locationID; + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['LocationDescription'] = this.locationDescription; + data['LocationDescriptionN'] = this.locationDescriptionN; + data['ItemDescription'] = this.itemDescription; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['Alias'] = this.alias; + data['LocationTypeID'] = this.locationTypeID; + data['Barcode'] = this.barcode; + data['Companybarcode'] = this.companybarcode; + data['CityID'] = this.cityID; + data['CityName'] = this.cityName; + data['DistanceInKilometers'] = this.distanceInKilometers; + data['Latitude'] = this.latitude; + data['LocationType'] = this.locationType; + data['Longitude'] = this.longitude; + data['PhoneNumber'] = this.phoneNumber; + data['ProjectImageURL'] = this.projectImageURL; + data['SortOrder'] = this.sortOrder; + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_report.dart b/lib/core/model/Prescriptions/prescription_report.dart new file mode 100644 index 00000000..d2427004 --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_report.dart @@ -0,0 +1,191 @@ +class PrescriptionReport { + String address; + int appointmentNo; + String clinic; + String companyName; + int days; + String doctorName; + var doseDailyQuantity; + String frequency; + int frequencyNumber; + String image; + String imageExtension; + String imageSRCUrl; + String imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + String prescriptionQR; + int prescriptionTimes; + String productImage; + String productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + String patientAge; + String patientGender; + String phoneOffice; + int doseTimingID; + int frequencyID; + int routeID; + String name; + String itemDescriptionN; + String routeN; + String frequencyN; + + PrescriptionReport({ + this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate, + this.patientAge, + this.patientGender, + this.phoneOffice, + this.doseTimingID, + this.frequencyID, + this.routeID, + this.name, + this.itemDescriptionN, + this.routeN, + this.frequencyN, + }); + + PrescriptionReport.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + + patientAge = json['patientAge']; + patientGender = json['patientGender']; + phoneOffice = json['phoneOffice']; + doseTimingID = json['doseTimingID']; + frequencyID = json['frequencyID']; + routeID = json['routeID']; + name = json['name']; + itemDescriptionN = json['itemDescriptionN']; + routeN = json['routeN']; + frequencyN = json['frequencyN']; + } + + Map toJson() { + final Map data = new Map(); + + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + + data['PatientAge'] = this.patientAge; + data['PatientGender'] = this.patientGender; + data['PhoneOffice'] = this.phoneOffice; + data['DoseTimingID'] = this.doseTimingID; + data['FrequencyID'] = this.frequencyID; + data['RouteID'] = this.routeID; + data['Name'] = this.name; + data['ItemDescriptionN'] = this.itemDescriptionN; + data['RouteN'] = this.routeN; + data['FrequencyN'] = this.frequencyN; + data['hasPlan'] = false; + + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescription_report_enh.dart b/lib/core/model/Prescriptions/prescription_report_enh.dart new file mode 100644 index 00000000..203eaaff --- /dev/null +++ b/lib/core/model/Prescriptions/prescription_report_enh.dart @@ -0,0 +1,144 @@ +class PrescriptionReportEnh { + String address; + int appointmentNo; + String clinic; + Null companyName; + int days; + String doctorName; + int doseDailyQuantity; + String frequency; + int frequencyNumber; + Null image; + Null imageExtension; + String imageSRCUrl; + Null imageString; + String imageThumbUrl; + String isCovered; + String itemDescription; + int itemID; + String orderDate; + int patientID; + String patientName; + String phoneOffice1; + Null prescriptionQR; + int prescriptionTimes; + Null productImage; + Null productImageBase64; + String productImageString; + int projectID; + String projectName; + String remarks; + String route; + String sKU; + int scaleOffset; + String startDate; + + PrescriptionReportEnh( + {this.address, + this.appointmentNo, + this.clinic, + this.companyName, + this.days, + this.doctorName, + this.doseDailyQuantity, + this.frequency, + this.frequencyNumber, + this.image, + this.imageExtension, + this.imageSRCUrl, + this.imageString, + this.imageThumbUrl, + this.isCovered, + this.itemDescription, + this.itemID, + this.orderDate, + this.patientID, + this.patientName, + this.phoneOffice1, + this.prescriptionQR, + this.prescriptionTimes, + this.productImage, + this.productImageBase64, + this.productImageString, + this.projectID, + this.projectName, + this.remarks, + this.route, + this.sKU, + this.scaleOffset, + this.startDate}); + + PrescriptionReportEnh.fromJson(Map json) { + address = json['Address']; + appointmentNo = json['AppointmentNo']; + clinic = json['Clinic']; + companyName = json['CompanyName']; + days = json['Days']; + doctorName = json['DoctorName']; + doseDailyQuantity = json['DoseDailyQuantity']; + frequency = json['Frequency']; + frequencyNumber = json['FrequencyNumber']; + image = json['Image']; + imageExtension = json['ImageExtension']; + imageSRCUrl = json['ImageSRCUrl']; + imageString = json['ImageString']; + imageThumbUrl = json['ImageThumbUrl']; + isCovered = json['IsCovered']; + itemDescription = json['ItemDescription']; + itemID = json['ItemID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientName = json['PatientName']; + phoneOffice1 = json['PhoneOffice1']; + prescriptionQR = json['PrescriptionQR']; + prescriptionTimes = json['PrescriptionTimes']; + productImage = json['ProductImage']; + productImageBase64 = json['ProductImageBase64']; + productImageString = json['ProductImageString']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + remarks = json['Remarks']; + route = json['Route']; + sKU = json['SKU']; + scaleOffset = json['ScaleOffset']; + startDate = json['StartDate']; + } + + Map toJson() { + final Map data = new Map(); + data['Address'] = this.address; + data['AppointmentNo'] = this.appointmentNo; + data['Clinic'] = this.clinic; + data['CompanyName'] = this.companyName; + data['Days'] = this.days; + data['DoctorName'] = this.doctorName; + data['DoseDailyQuantity'] = this.doseDailyQuantity; + data['Frequency'] = this.frequency; + data['FrequencyNumber'] = this.frequencyNumber; + data['Image'] = this.image; + data['ImageExtension'] = this.imageExtension; + data['ImageSRCUrl'] = this.imageSRCUrl; + data['ImageString'] = this.imageString; + data['ImageThumbUrl'] = this.imageThumbUrl; + data['IsCovered'] = this.isCovered; + data['ItemDescription'] = this.itemDescription; + data['ItemID'] = this.itemID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientName'] = this.patientName; + data['PhoneOffice1'] = this.phoneOffice1; + data['PrescriptionQR'] = this.prescriptionQR; + data['PrescriptionTimes'] = this.prescriptionTimes; + data['ProductImage'] = this.productImage; + data['ProductImageBase64'] = this.productImageBase64; + data['ProductImageString'] = this.productImageString; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['Remarks'] = this.remarks; + data['Route'] = this.route; + data['SKU'] = this.sKU; + data['ScaleOffset'] = this.scaleOffset; + data['StartDate'] = this.startDate; + return data; + } +} diff --git a/lib/core/model/Prescriptions/prescriptions_order.dart b/lib/core/model/Prescriptions/prescriptions_order.dart new file mode 100644 index 00000000..4f77f7ec --- /dev/null +++ b/lib/core/model/Prescriptions/prescriptions_order.dart @@ -0,0 +1,134 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class PrescriptionsOrder { + int iD; + dynamic patientID; + bool patientOutSA; + bool isOutPatient; + int projectID; + int nearestProjectID; + double longitude; + double latitude; + dynamic appointmentNo; + dynamic dischargeID; + int lineItemNo; + int status; + dynamic description; + dynamic descriptionN; + DateTime createdOn; + int serviceID; + int createdBy; + DateTime editedOn; + int editedBy; + int channel; + dynamic clientRequestID; + bool returnedToQueue; + dynamic pickupDateTime; + dynamic pickupLocationName; + dynamic dropoffLocationName; + int realRRTHaveTransactions; + dynamic nearestProjectDescription; + dynamic nearestProjectDescriptionN; + dynamic projectDescription; + dynamic projectDescriptionN; + + PrescriptionsOrder( + {this.iD, + this.patientID, + this.patientOutSA, + this.isOutPatient, + this.projectID, + this.nearestProjectID, + this.longitude, + this.latitude, + this.appointmentNo, + this.dischargeID, + this.lineItemNo, + this.status, + this.description, + this.descriptionN, + this.createdOn, + this.serviceID, + this.createdBy, + this.editedOn, + this.editedBy, + this.channel, + this.clientRequestID, + this.returnedToQueue, + this.pickupDateTime, + this.pickupLocationName, + this.dropoffLocationName, + this.realRRTHaveTransactions, + this.nearestProjectDescription, + this.nearestProjectDescriptionN, + this.projectDescription, + this.projectDescriptionN}); + + PrescriptionsOrder.fromJson(Map json) { + iD = json['ID']; + patientID = json['PatientID']; + patientOutSA = json['PatientOutSA']; + isOutPatient = json['IsOutPatient']; + projectID = json['ProjectID']; + nearestProjectID = json['NearestProjectID']; + longitude = json['Longitude']; + latitude = json['Latitude']; + appointmentNo = json['AppointmentNo']; + dischargeID = json['DischargeID']; + lineItemNo = json['LineItemNo']; + status = json['Status']; + description = json['Description']; + descriptionN = json['DescriptionN']; + createdOn = DateUtils.convertStringToDate(json['CreatedOn']); + serviceID = json['ServiceID']; + createdBy = json['CreatedBy']; + editedOn = DateUtils.convertStringToDate(json['EditedOn']); + editedBy = json['EditedBy']; + channel = json['Channel']; + clientRequestID = json['ClientRequestID']; + returnedToQueue = json['ReturnedToQueue']; + pickupDateTime = json['PickupDateTime']; + pickupLocationName = json['PickupLocationName']; + dropoffLocationName = json['DropoffLocationName']; + realRRTHaveTransactions = json['RealRRT_HaveTransactions']; + nearestProjectDescription = json['NearestProjectDescription']; + nearestProjectDescriptionN = json['NearestProjectDescriptionN']; + projectDescription = json['ProjectDescription']; + projectDescriptionN = json['ProjectDescriptionN']; + } + + Map toJson() { + final Map data = new Map(); + data['ID'] = this.iD; + data['PatientID'] = this.patientID; + data['PatientOutSA'] = this.patientOutSA; + data['IsOutPatient'] = this.isOutPatient; + data['ProjectID'] = this.projectID; + data['NearestProjectID'] = this.nearestProjectID; + data['Longitude'] = this.longitude; + data['Latitude'] = this.latitude; + data['AppointmentNo'] = this.appointmentNo; + data['DischargeID'] = this.dischargeID; + data['LineItemNo'] = this.lineItemNo; + data['Status'] = this.status; + data['Description'] = this.description; + data['DescriptionN'] = this.descriptionN; + data['CreatedOn'] = this.createdOn; + data['ServiceID'] = this.serviceID; + data['CreatedBy'] = this.createdBy; + data['EditedOn'] = this.editedOn; + data['EditedBy'] = this.editedBy; + data['Channel'] = this.channel; + data['ClientRequestID'] = this.clientRequestID; + data['ReturnedToQueue'] = this.returnedToQueue; + data['PickupDateTime'] = this.pickupDateTime; + data['PickupLocationName'] = this.pickupLocationName; + data['DropoffLocationName'] = this.dropoffLocationName; + data['RealRRT_HaveTransactions'] = this.realRRTHaveTransactions; + data['NearestProjectDescription'] = this.nearestProjectDescription; + data['NearestProjectDescriptionN'] = this.nearestProjectDescriptionN; + data['ProjectDescription'] = this.projectDescription; + data['ProjectDescriptionN'] = this.projectDescriptionN; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart new file mode 100644 index 00000000..739bb838 --- /dev/null +++ b/lib/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart @@ -0,0 +1,60 @@ +class RequestGetListPharmacyForPrescriptions { + int latitude; + int longitude; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int itemID; + + RequestGetListPharmacyForPrescriptions( + {this.latitude, + this.longitude, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.itemID}); + + RequestGetListPharmacyForPrescriptions.fromJson(Map json) { + latitude = json['Latitude']; + longitude = json['Longitude']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + itemID = json['ItemID']; + } + + Map toJson() { + final Map data = new Map(); + data['Latitude'] = this.latitude; + data['Longitude'] = this.longitude; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['ItemID'] = this.itemID; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_prescription_report.dart b/lib/core/model/Prescriptions/request_prescription_report.dart new file mode 100644 index 00000000..c8323740 --- /dev/null +++ b/lib/core/model/Prescriptions/request_prescription_report.dart @@ -0,0 +1,88 @@ +class RequestPrescriptionReport { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int episodeID; + int clinicID; + int projectID; + int dischargeNo; + + RequestPrescriptionReport( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID, + this.dischargeNo}); + + RequestPrescriptionReport.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + dischargeNo = json['DischargeNo']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/Prescriptions/request_prescription_report_enh.dart b/lib/core/model/Prescriptions/request_prescription_report_enh.dart new file mode 100644 index 00000000..4905fc2a --- /dev/null +++ b/lib/core/model/Prescriptions/request_prescription_report_enh.dart @@ -0,0 +1,86 @@ +class RequestPrescriptionReportEnh { + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + int appointmentNo; + String setupID; + int dischargeNo; + int episodeID; + int clinicID; + int projectID; + + RequestPrescriptionReportEnh( + {this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType, + this.appointmentNo, + this.setupID, + this.episodeID, + this.clinicID, + this.projectID,this.dischargeNo}); + + RequestPrescriptionReportEnh.fromJson(Map json) { + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + appointmentNo = json['AppointmentNo']; + setupID = json['SetupID']; + episodeID = json['EpisodeID']; + clinicID = json['ClinicID']; + projectID = json['ProjectID']; + } + + Map toJson() { + final Map data = new Map(); + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + data['AppointmentNo'] = this.appointmentNo; + data['SetupID'] = this.setupID; + data['EpisodeID'] = this.episodeID; + data['ClinicID'] = this.clinicID; + data['ProjectID'] = this.projectID; + data['DischargeNo'] = this.dischargeNo; + return data; + } +} diff --git a/lib/core/model/radiology/final_radiology.dart b/lib/core/model/radiology/final_radiology.dart new file mode 100644 index 00000000..66433091 --- /dev/null +++ b/lib/core/model/radiology/final_radiology.dart @@ -0,0 +1,190 @@ +import 'package:doctor_app_flutter/util/date-utils.dart'; + +class FinalRadiology { + String setupID; + int projectID; + Null patientID; + int invoiceLineItemNo; + int invoiceNo; + int doctorID; + int clinicID; + DateTime orderDate; + String reportData; + String imageURL; + String procedureID; + int appointmentNo; + Null dIAPacsURL; + bool isRead; + String readOn; + var admissionNo; + bool isInOutPatient; + int actualDoctorRate; + String clinicDescription; + String dIAPACSURL; + String doctorImageURL; + String doctorName; + int doctorRate; + String doctorTitle; + int gender; + String genderDescription; + bool isActiveDoctorProfile; + bool isExecludeDoctor; + String isInOutPatientDescription; + String isInOutPatientDescriptionN; + String nationalityFlagURL; + int noOfPatientsRate; + int orderNo; + String projectName; + String qR; + String reportDataHTML; + String reportDataTextString; + List speciality; + bool isCVI; + bool isRadMedicalReport; + bool isLiveCareAppointment; + + FinalRadiology( + {this.setupID, + this.projectID, + this.patientID, + this.invoiceLineItemNo, + this.invoiceNo, + this.doctorID, + this.clinicID, + this.orderDate, + this.reportData, + this.imageURL, + this.procedureID, + this.appointmentNo, + this.dIAPacsURL, + this.isRead, + this.readOn, + this.admissionNo, + this.isInOutPatient, + this.actualDoctorRate, + this.clinicDescription, + this.dIAPACSURL, + this.doctorImageURL, + this.doctorName, + this.doctorRate, + this.doctorTitle, + this.gender, + this.genderDescription, + this.isActiveDoctorProfile, + this.isExecludeDoctor, + this.isInOutPatientDescription, + this.isInOutPatientDescriptionN, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.orderNo, + this.projectName, + this.qR, + this.reportDataHTML, + this.reportDataTextString, + this.speciality, + this.isCVI, + this.isRadMedicalReport,this.isLiveCareAppointment}); + + FinalRadiology.fromJson(Map json) { + try { + setupID = json['SetupID']; + projectID = json['ProjectID']; + patientID = json['PatientID']; + invoiceLineItemNo = json['InvoiceLineItemNo']; + invoiceNo = json['InvoiceNo']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + orderDate = DateUtils.convertStringToDate(json['OrderDate']); + reportData = json['ReportData']; + imageURL = json['ImageURL']; + procedureID = json['ProcedureID']; + appointmentNo = json['AppointmentNo']; + dIAPacsURL = json['DIAPacsURL']; + isRead = json['IsRead']; + readOn = json['ReadOn']; + admissionNo = json['AdmissionNo']; + isInOutPatient = json['IsInOutPatient']; + actualDoctorRate = json['ActualDoctorRate']; + clinicDescription = json['ClinicDescription']; + dIAPACSURL = json['DIA_PACS_URL']; + doctorImageURL = json['DoctorImageURL']; + doctorName = json['DoctorName']; + doctorRate = json['DoctorRate']; + doctorTitle = json['DoctorTitle']; + gender = json['Gender']; + genderDescription = json['GenderDescription']; + isActiveDoctorProfile = json['IsActiveDoctorProfile']; + isExecludeDoctor = json['IsExecludeDoctor']; + isInOutPatientDescription = json['IsInOutPatientDescription']; + isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + orderNo = json['OrderNo']; + projectName = json['ProjectName']; + qR = json['QR']; + isLiveCareAppointment = json['IsLiveCareAppointment']; + reportDataHTML = json['ReportDataHTML']; + reportDataTextString = json['ReportDataTextString']; + // speciality = json['Speciality'].cast(); + isCVI = json['isCVI']; + isRadMedicalReport = json['isRadMedicalReport']; + + } catch (e) { + print(e); + } + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['PatientID'] = this.patientID; + data['InvoiceLineItemNo'] = this.invoiceLineItemNo; + data['InvoiceNo'] = this.invoiceNo; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['OrderDate'] = this.orderDate; + data['ReportData'] = this.reportData; + data['ImageURL'] = this.imageURL; + data['ProcedureID'] = this.procedureID; + data['AppointmentNo'] = this.appointmentNo; + data['DIAPacsURL'] = this.dIAPacsURL; + data['IsRead'] = this.isRead; + data['ReadOn'] = this.readOn; + data['AdmissionNo'] = this.admissionNo; + data['IsInOutPatient'] = this.isInOutPatient; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['ClinicDescription'] = this.clinicDescription; + data['DIA_PACS_URL'] = this.dIAPACSURL; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorName'] = this.doctorName; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitle'] = this.doctorTitle; + data['Gender'] = this.gender; + data['GenderDescription'] = this.genderDescription; + data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; + data['IsExecludeDoctor'] = this.isExecludeDoctor; + data['IsInOutPatientDescription'] = this.isInOutPatientDescription; + data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['OrderNo'] = this.orderNo; + data['ProjectName'] = this.projectName; + data['QR'] = this.qR; + data['ReportDataHTML'] = this.reportDataHTML; + data['ReportDataTextString'] = this.reportDataTextString; + data['Speciality'] = this.speciality; + data['isCVI'] = this.isCVI; + data['isRadMedicalReport'] = this.isRadMedicalReport; + return data; + } +} + +class FinalRadiologyList { + String filterName = ""; + List finalRadiologyList = List(); + + FinalRadiologyList({this.filterName, FinalRadiology finalRadiology}) { + finalRadiologyList.add(finalRadiology); + } +} diff --git a/lib/core/model/radiology/request_patient_rad_orders_details.dart b/lib/core/model/radiology/request_patient_rad_orders_details.dart new file mode 100644 index 00000000..9e3458d5 --- /dev/null +++ b/lib/core/model/radiology/request_patient_rad_orders_details.dart @@ -0,0 +1,92 @@ +class RequestPatientRadOrdersDetails { + int projectID; + int orderNo; + int invoiceNo; + String setupID; + String procedureID; + bool isMedicalReport; + bool isCVI; + double versionID; + int channel; + int languageID; + String iPAdress; + String generalid; + int patientOutSA; + String sessionID; + bool isDentalAllowedBackend; + int deviceTypeID; + int patientID; + String tokenID; + int patientTypeID; + int patientType; + + RequestPatientRadOrdersDetails( + {this.projectID, + this.orderNo, + this.invoiceNo, + this.setupID, + this.procedureID, + this.isMedicalReport, + this.isCVI, + this.versionID, + this.channel, + this.languageID, + this.iPAdress, + this.generalid, + this.patientOutSA, + this.sessionID, + this.isDentalAllowedBackend, + this.deviceTypeID, + this.patientID, + this.tokenID, + this.patientTypeID, + this.patientType}); + + RequestPatientRadOrdersDetails.fromJson(Map json) { + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + invoiceNo = json['InvoiceNo']; + setupID = json['SetupID']; + procedureID = json['ProcedureID']; + isMedicalReport = json['IsMedicalReport']; + isCVI = json['isCVI']; + versionID = json['VersionID']; + channel = json['Channel']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + generalid = json['generalid']; + patientOutSA = json['PatientOutSA']; + sessionID = json['SessionID']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + deviceTypeID = json['DeviceTypeID']; + patientID = json['PatientID']; + tokenID = json['TokenID']; + patientTypeID = json['PatientTypeID']; + patientType = json['PatientType']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['InvoiceNo'] = this.invoiceNo; + data['SetupID'] = this.setupID; + data['ProcedureID'] = this.procedureID; + data['IsMedicalReport'] = this.isMedicalReport; + data['isCVI'] = this.isCVI; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['generalid'] = this.generalid; + data['PatientOutSA'] = this.patientOutSA; + data['SessionID'] = this.sessionID; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['DeviceTypeID'] = this.deviceTypeID; + data['PatientID'] = this.patientID; + data['TokenID'] = this.tokenID; + data['PatientTypeID'] = this.patientTypeID; + data['PatientType'] = this.patientType; + return data; + } +} diff --git a/lib/core/model/radiology/request_send_rad_report_email.dart b/lib/core/model/radiology/request_send_rad_report_email.dart new file mode 100644 index 00000000..6d68653d --- /dev/null +++ b/lib/core/model/radiology/request_send_rad_report_email.dart @@ -0,0 +1,116 @@ +class RequestSendRadReportEmail { + int channel; + String clinicName; + String dateofBirth; + int deviceTypeID; + String doctorName; + String generalid; + int invoiceNo; + String iPAdress; + bool isDentalAllowedBackend; + int languageID; + String orderDate; + int patientID; + String patientIditificationNum; + String patientMobileNumber; + String patientName; + int patientOutSA; + int patientType; + int patientTypeID; + int projectID; + String projectName; + String radResult; + String sessionID; + String setupID; + String to; + String tokenID; + double versionID; + + RequestSendRadReportEmail( + {this.channel, + this.clinicName, + this.dateofBirth, + this.deviceTypeID, + this.doctorName, + this.generalid, + this.invoiceNo, + this.iPAdress, + this.isDentalAllowedBackend, + this.languageID, + this.orderDate, + this.patientID, + this.patientIditificationNum, + this.patientMobileNumber, + this.patientName, + this.patientOutSA, + this.patientType, + this.patientTypeID, + this.projectID, + this.projectName, + this.radResult, + this.sessionID, + this.setupID, + this.to, + this.tokenID, + this.versionID}); + + RequestSendRadReportEmail.fromJson(Map json) { + channel = json['Channel']; + clinicName = json['ClinicName']; + dateofBirth = json['DateofBirth']; + deviceTypeID = json['DeviceTypeID']; + doctorName = json['DoctorName']; + generalid = json['generalid']; + invoiceNo = json['InvoiceNo']; + iPAdress = json['IPAdress']; + isDentalAllowedBackend = json['isDentalAllowedBackend']; + languageID = json['LanguageID']; + orderDate = json['OrderDate']; + patientID = json['PatientID']; + patientIditificationNum = json['PatientIditificationNum']; + patientMobileNumber = json['PatientMobileNumber']; + patientName = json['PatientName']; + patientOutSA = json['PatientOutSA']; + patientType = json['PatientType']; + patientTypeID = json['PatientTypeID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + radResult = json['RadResult']; + sessionID = json['SessionID']; + setupID = json['SetupID']; + to = json['To']; + tokenID = json['TokenID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['Channel'] = this.channel; + data['ClinicName'] = this.clinicName; + data['DateofBirth'] = this.dateofBirth; + data['DeviceTypeID'] = this.deviceTypeID; + data['DoctorName'] = this.doctorName; + data['generalid'] = this.generalid; + data['InvoiceNo'] = this.invoiceNo; + data['IPAdress'] = this.iPAdress; + data['isDentalAllowedBackend'] = this.isDentalAllowedBackend; + data['LanguageID'] = this.languageID; + data['OrderDate'] = this.orderDate; + data['PatientID'] = this.patientID; + data['PatientIditificationNum'] = this.patientIditificationNum; + data['PatientMobileNumber'] = this.patientMobileNumber; + data['PatientName'] = this.patientName; + data['PatientOutSA'] = this.patientOutSA; + data['PatientType'] = this.patientType; + data['PatientTypeID'] = this.patientTypeID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['RadResult'] = this.radResult; + data['SessionID'] = this.sessionID; + data['SetupID'] = this.setupID; + data['To'] = this.to; + data['TokenID'] = this.tokenID; + data['VersionID'] = this.versionID; + return data; + } +} diff --git a/lib/core/service/prescriptions_service.dart b/lib/core/service/prescriptions_service.dart new file mode 100644 index 00000000..c720eec9 --- /dev/null +++ b/lib/core/service/prescriptions_service.dart @@ -0,0 +1,182 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/cupertino.dart'; + +import 'base/base_service.dart'; + +class PrescriptionsService extends BaseService { + List prescriptionsList = List(); + List prescriptionsOrderList = List(); + + Future getPrescriptions(PatiantInformtion patient) async { + hasError = false; + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.postPatient(PRESCRIPTIONS,patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionsList.clear(); + response['PatientPrescriptionList'].forEach((prescriptions) { + prescriptionsList.add(Prescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + RequestPrescriptionReport _requestPrescriptionReport = + RequestPrescriptionReport( + appointmentNo: 0, isDentalAllowedBackend: false); + List prescriptionReportList = List(); + + Future getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + hasError = false; + _requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; + _requestPrescriptionReport.projectID = prescriptions.projectID; + _requestPrescriptionReport.clinicID = prescriptions.clinicID; + _requestPrescriptionReport.setupID = prescriptions.setupID; + _requestPrescriptionReport.episodeID = prescriptions.episodeID; + _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; + + await baseAppClient.postPatient( + prescriptions.isInOutPatient + ? GET_PRESCRIPTION_REPORT_ENH + : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionReportList.clear(); + prescriptionReportEnhList.clear(); + if (prescriptions.isInOutPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + prescriptionReportList + .add(PrescriptionReport.fromJson(prescriptions)); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReport.toJson()); + } + + RequestGetListPharmacyForPrescriptions + requestGetListPharmacyForPrescriptions = + RequestGetListPharmacyForPrescriptions( + latitude: 0, + longitude: 0, + isDentalAllowedBackend: false, + ); + List pharmacyPrescriptionsList = List(); + + Future getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + hasError = false; + requestGetListPharmacyForPrescriptions.itemID = itemId; + await baseAppClient.postPatient(GET_PHARMACY_LIST, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + pharmacyPrescriptionsList.clear(); + response['PharmList'].forEach((prescriptions) { + pharmacyPrescriptionsList + .add(PharmacyPrescriptions.fromJson(prescriptions)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: requestGetListPharmacyForPrescriptions.toJson()); + } + + RequestPrescriptionReportEnh _requestPrescriptionReportEnh = + RequestPrescriptionReportEnh( + isDentalAllowedBackend: false, + ); + + List prescriptionReportEnhList = List(); + + Future getPrescriptionReportEnh( + {PrescriptionsOrder prescriptionsOrder, @required PatiantInformtion patient}) async { + ///This logic copy from the old app from class [order-history.component.ts] in line 45 + bool isInPatient = false; + prescriptionsList.forEach((element) { + if (prescriptionsOrder.appointmentNo == "0") { + if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + } + } else { + if (int.parse(prescriptionsOrder.appointmentNo) == + element.appointmentNo) { + _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; + _requestPrescriptionReportEnh.clinicID = element.clinicID; + _requestPrescriptionReportEnh.projectID = element.projectID; + _requestPrescriptionReportEnh.episodeID = element.episodeID; + _requestPrescriptionReportEnh.setupID = element.setupID; + _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; + isInPatient = element.isInOutPatient; + + ///call inpGetPrescriptionReport + } + } + }); + + hasError = false; + + await baseAppClient.postPatient( + isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT_NEW, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + prescriptionReportEnhList.clear(); + + if (isInPatient) { + response['ListPRM'].forEach((prescriptions) { + prescriptionReportEnhList + .add(PrescriptionReportEnh.fromJson(prescriptions)); + }); + } else { + response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { + PrescriptionReportEnh reportEnh = + PrescriptionReportEnh.fromJson(prescriptions); + reportEnh.itemDescription = prescriptions['ItemDescriptionN']; + prescriptionReportEnhList.add(reportEnh); + }); + } + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: _requestPrescriptionReportEnh.toJson()); + } + Future getPrescriptionsOrders() async { + Map body = Map(); + body['isDentalAllowedBackend'] = false; + await baseAppClient.post(GET_PRESCRIPTIONS_ALL_ORDERS, + onSuccess: (dynamic response, int statusCode) { + prescriptionsOrderList.clear(); + response['PatientER_GetPatientAllPresOrdersList'] + .forEach((prescriptionsOrder) { + prescriptionsOrderList + .add(PrescriptionsOrder.fromJson(prescriptionsOrder)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } +} diff --git a/lib/core/service/radiology_service.dart b/lib/core/service/radiology_service.dart new file mode 100644 index 00000000..9c1f5a60 --- /dev/null +++ b/lib/core/service/radiology_service.dart @@ -0,0 +1,48 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/model/radiology/request_send_rad_report_email.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/cupertino.dart'; + +import 'base/base_service.dart'; + +class RadiologyService extends BaseService { + List finalRadiologyList = List(); + String url = ''; + + Future getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + hasError = false; + final Map body = new Map(); + body['InvoiceNo'] = invoiceNo; + body['LineIt emNo'] = lineItem; + body['ProjectID'] = projectId; + + await baseAppClient.postPatient(GET_RAD_IMAGE_URL, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + url = response['Data']; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + } + + Future getPatientRadOrders(PatiantInformtion patient) async { + hasError = false; + await baseAppClient.postPatient(GET_PATIENT_ORDERS, + patient: patient, + onSuccess: (dynamic response, int statusCode) { + finalRadiologyList.clear(); + response['FinalRadiologyList'].forEach((radiology) { + finalRadiologyList.add(FinalRadiology.fromJson(radiology)); + }); + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: Map()); + } + + + + +} diff --git a/lib/core/viewModel/prescriptions_view_model.dart b/lib/core/viewModel/prescriptions_view_model.dart new file mode 100644 index 00000000..916a6563 --- /dev/null +++ b/lib/core/viewModel/prescriptions_view_model.dart @@ -0,0 +1,145 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart'; +import 'package:doctor_app_flutter/core/service/prescriptions_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/material.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class PrescriptionsViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + PrescriptionsService _prescriptionsService = locator(); + + List _prescriptionsOrderListClinic = List(); + List _prescriptionsOrderListHospital = List(); + + + List get prescriptionReportList => + _prescriptionsService.prescriptionReportList; + + List get prescriptionsList => + _prescriptionsService.prescriptionsList; + + List get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ; + List get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; + + + List get prescriptionsOrderList => + filterType == FilterType.Clinic + ? _prescriptionsOrderListClinic + : _prescriptionsOrderListHospital; + + getPrescriptions(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptions(patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + _filterList(); + await _getPrescriptionsOrders(); + + setState(ViewState.Idle); + } + } + _getPrescriptionsOrders() async { + await _prescriptionsService.getPrescriptionsOrders(); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + void _filterList() { + _prescriptionsService.prescriptionsList.forEach((element) { + /// PrescriptionsList list sort clinic + List prescriptionsByClinic = + _prescriptionsOrderListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (prescriptionsByClinic.length != 0) { + _prescriptionsOrderListClinic[ + _prescriptionsOrderListClinic.indexOf(prescriptionsByClinic[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListClinic.add(PrescriptionsList( + filterName: element.clinicDescription, prescriptions: element)); + } + + /// PrescriptionsList list sort via hospital + List prescriptionsByHospital = + _prescriptionsOrderListHospital + .where( + (elementClinic) => elementClinic.filterName == element.name, + ) + .toList(); + + if (prescriptionsByHospital.length != 0) { + _prescriptionsOrderListHospital[_prescriptionsOrderListHospital + .indexOf(prescriptionsByHospital[0])] + .prescriptionsList + .add(element); + } else { + _prescriptionsOrderListHospital.add(PrescriptionsList( + filterName: element.name, prescriptions: element)); + } + }); + } + + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } + + getPrescriptionReport({Prescriptions prescriptions,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } + } + + + + getListPharmacyForPrescriptions({int itemId,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getListPharmacyForPrescriptions(itemId: itemId,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + + getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder,patient: patient); + if (_prescriptionsService.hasError) { + error = _prescriptionsService.error; + setState(ViewState.Error); + } else { + setState(ViewState.Idle); + } + } + + + +} diff --git a/lib/core/viewModel/radiology_view_model.dart b/lib/core/viewModel/radiology_view_model.dart new file mode 100644 index 00000000..3a194970 --- /dev/null +++ b/lib/core/viewModel/radiology_view_model.dart @@ -0,0 +1,88 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/service/radiology_service.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:flutter/foundation.dart'; + +import '../../locator.dart'; +import 'base_view_model.dart'; + +class RadiologyViewModel extends BaseViewModel { + FilterType filterType = FilterType.Clinic; + RadiologyService _radiologyService = locator(); + + List _finalRadiologyListClinic = List(); + List _finalRadiologyListHospital = List(); + + List get finalRadiologyList => + filterType == FilterType.Clinic + ? _finalRadiologyListClinic + : _finalRadiologyListHospital; + + void getPatientRadOrders(PatiantInformtion patient) async { + setState(ViewState.Busy); + await _radiologyService.getPatientRadOrders(patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else { + _radiologyService.finalRadiologyList.forEach((element) { + List finalRadiologyListClinic = + _finalRadiologyListClinic + .where((elementClinic) => + elementClinic.filterName == element.clinicDescription) + .toList(); + + if (finalRadiologyListClinic.length != 0) { + _finalRadiologyListClinic[ + finalRadiologyListClinic.indexOf(finalRadiologyListClinic[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListClinic.add(FinalRadiologyList( + filterName: element.clinicDescription, finalRadiology: element)); + } + + // FinalRadiologyList list sort via project + List finalRadiologyListHospital = + _finalRadiologyListHospital + .where( + (elementClinic) => + elementClinic.filterName == element.projectName, + ) + .toList(); + + if (finalRadiologyListHospital.length != 0) { + _finalRadiologyListHospital[finalRadiologyListHospital + .indexOf(finalRadiologyListHospital[0])] + .finalRadiologyList + .add(element); + } else { + _finalRadiologyListHospital.add(FinalRadiologyList( + filterName: element.projectName, finalRadiology: element)); + } + }); + + setState(ViewState.Idle); + } + } + + String get radImageURL => _radiologyService.url; + + getRadImageURL({int invoiceNo, int lineItem, int projectId,@required PatiantInformtion patient}) async { + setState(ViewState.Busy); + await _radiologyService.getRadImageURL( + invoiceNo: invoiceNo, lineItem: lineItem, projectId: projectId,patient: patient); + if (_radiologyService.hasError) { + error = _radiologyService.error; + setState(ViewState.Error); + } else + setState(ViewState.Idle); + } + + setFilterType(FilterType filterType) { + this.filterType = filterType; + notifyListeners(); + } +} diff --git a/lib/locator.dart b/lib/locator.dart index 68daa9d1..1e688d96 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -25,6 +25,8 @@ import 'core/service/medicine_service.dart'; import 'core/service/patient-ucaf-service.dart'; import 'core/service/patient-vital-signs-service.dart'; import 'core/service/patient-doctor-referral-service.dart'; +import 'core/service/prescriptions_service.dart'; +import 'core/service/radiology_service.dart'; import 'core/service/referral_patient_service.dart'; import 'core/service/referred_patient_service.dart'; import 'core/service/schedule_service.dart'; @@ -38,6 +40,8 @@ import 'core/viewModel/patient-admission-request-viewmodel.dart'; import 'core/viewModel/patient-ucaf-viewmodel.dart'; import 'core/viewModel/patient-vital-sign-viewmodel.dart'; import 'core/viewModel/patient-referral-viewmodel.dart'; +import 'core/viewModel/prescriptions_view_model.dart'; +import 'core/viewModel/radiology_view_model.dart'; import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/schedule_view_model.dart'; @@ -67,6 +71,8 @@ void setupLocator() { locator.registerLazySingleton(() => PatientMuseService()); locator.registerLazySingleton(() => LabsService()); locator.registerLazySingleton(() => InsuranceCardService()); + locator.registerLazySingleton(() => RadiologyService()); + locator.registerLazySingleton(() => PrescriptionsService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); @@ -89,4 +95,6 @@ void setupLocator() { locator.registerFactory(() => PatientMuseViewModel()); locator.registerFactory(() => LabsViewModel()); locator.registerFactory(() => InsuranceViewModel()); + locator.registerFactory(() => RadiologyViewModel()); + locator.registerFactory(() => PrescriptionsViewModel()); } diff --git a/lib/routes.dart b/lib/routes.dart index c3930da2..909b1bf4 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_ import 'package:doctor_app_flutter/screens/patients/profile/lab_result/labs_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_home_page.dart'; import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; @@ -114,6 +115,7 @@ const String PATIENT_SICKLEAVE = 'patients/patient_sickleave'; const String ADD_SICKLEAVE = 'add-sickleave'; const String SHOW_SICKLEAVE = 'show-sickleave'; const String RADIOLOGY = 'radiology'; +const String RADIOLOGY_PATIENT = 'radiology-patient'; //todo: change the routing way. var routes = { ROOT: (_) => RootPage(), @@ -151,6 +153,7 @@ var routes = { VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), PATIENT_VITAL_SIGN: (_) => PatientVitalSignScreen(), RADIOLOGY: (_) => RadiologyScreen(), + RADIOLOGY_PATIENT: (_) => RadiologyHomePage(), PATIENT_ADMISSION_REQUEST: (_) => AdmissionRequestFirstScreen(), PATIENT_ADMISSION_REQUEST_2: (_) => AdmissionRequestSecondScreen(), PATIENT_ADMISSION_REQUEST_3: (_) => AdmissionRequestThirdScreen(), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart new file mode 100644 index 00000000..fc9f207a --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -0,0 +1,79 @@ +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_button.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 RadiologyDetailsPage extends StatelessWidget { + final FinalRadiology finalRadiology; + final PatiantInformtion patient; + + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => model.getRadImageURL( + patient: patient, + projectId: finalRadiology.projectID, + lineItem: finalRadiology.invoiceLineItemNo, + invoiceNo: finalRadiology.invoiceNo), + builder: (_, model, widget) => AppScaffold( + appBarTitle: TranslationBase.of(context).radiologyReport, + isShowAppBar: true, + baseViewModel: model, + body: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.center, + ), + Padding( + padding: const EdgeInsets.all(8.0), + child: Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + ), + ), + SizedBox( + height: MediaQuery.of(context).size.height * 0.2, + ) + ], + ), + ), + bottomSheet: Container( + width: double.infinity, + height: MediaQuery.of(context).size.height * 0.14, + color: Colors.grey[100], + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + Divider(), + if (finalRadiology.dIAPACSURL != "") + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ], + ), + )), + ); + } +} diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart new file mode 100644 index 00000000..cce155d2 --- /dev/null +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -0,0 +1,114 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.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/screens/patients/profile/radiology/radiology_details_page.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/app_expandable_notifier_new.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class RadiologyHomePage extends StatelessWidget { + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + return BaseView( + onModelReady: (model) => model.getPatientRadOrders(patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).radiology, + baseViewModel: model, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model.setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + model.finalRadiologyList.length, + (index) => AppExpandableNotifier( + title: model.finalRadiologyList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .finalRadiologyList[index].finalRadiologyList + .map((radiology) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: RadiologyDetailsPage( + finalRadiology: radiology, + patient: patient, + ), + ), + ), + child: DoctorCard( + isInOutPatient: radiology.isInOutPatient, + isLiveCareAppointment: + radiology.isLiveCareAppointment, + name: radiology.doctorName, + profileUrl: radiology.doctorImageURL, + billNo: '${radiology.invoiceNo}', + subName: '${radiology.projectName}', + date: projectViewModel.isArabic + ? DateUtils.getMonthDayYearDateFormattedAr( + radiology.orderDate) + : DateUtils.getMonthDayYearDateFormatted( + radiology.orderDate), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_details_page.dart b/lib/screens/prescription/prescription_details_page.dart new file mode 100644 index 00000000..e5d9ef7d --- /dev/null +++ b/lib/screens/prescription/prescription_details_page.dart @@ -0,0 +1,168 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.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_scaffold_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; + +class PrescriptionDetailsPage extends StatelessWidget { + final PrescriptionReport prescriptionReport; + + PrescriptionDetailsPage({Key key, this.prescriptionReport}); + + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: double.infinity, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all(color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + prescriptionReport.imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts( + prescriptionReport.itemDescription.isNotEmpty + ? prescriptionReport.itemDescription + : prescriptionReport.itemDescriptionN), + ), + ), + ) + ], + ), + ), + Container( + color: Colors.white, + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + child: Table( + border: TableBorder.symmetric( + inside: BorderSide(width: 0.5), + outside: BorderSide(width: 0.5)), + children: [ + TableRow( + children: [ + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).route, + fontSize: 14, + ))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).frequency, + fontSize: 14, + ))), + Container( + color: Colors.white, + width: double.infinity, + padding: EdgeInsets.symmetric(horizontal: 4), + child: Center( + child: Texts( + "${TranslationBase.of(context).dailyDoses}", + fontSize: 14, + ))), + Container( + color: Colors.white, + height: 30, + width: double.infinity, + child: Center( + child: Texts( + TranslationBase.of(context).duration, + fontSize: 14, + ))), + ], + ), + TableRow( + children: [ + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text(prescriptionReport.routeN))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: + Text(prescriptionReport.frequencyN ?? ''))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: Center( + child: Text( + '${prescriptionReport.doseDailyQuantity}'))), + Container( + color: Colors.white, + height: 50, + width: double.infinity, + child: + Center(child: Text('${prescriptionReport.days}'))) + ], + ), + ], + ), + ), + Container( + margin: EdgeInsets.only(top: 10, left: 10, right: 10), + width: double.infinity, + color: Colors.white, + padding: EdgeInsets.all(5), + child: Center( + child: Column( + children: [ + Texts(TranslationBase.of(context).notes), + SizedBox( + height: 5, + ), + Divider( + height: 0.5, + color: Colors.grey[300], + ), + SizedBox( + height: 5, + ), + Texts(prescriptionReport.remarks ?? ''), + ], + ), + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart new file mode 100644 index 00000000..a306a93f --- /dev/null +++ b/lib/screens/prescription/prescription_items_page.dart @@ -0,0 +1,182 @@ +import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart'; +import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_details_page.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_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionItemsPage extends StatelessWidget { + final Prescriptions prescriptions; + final PatiantInformtion patient; + PrescriptionItemsPage({Key key, this.prescriptions, this.patient}); + + @override + Widget build(BuildContext context) { + return BaseView( + onModelReady: (model) => + model.getPrescriptionReport(prescriptions: prescriptions,patient: patient), + builder: (_, model, widget) => AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + baseViewModel: model, + body: Container( + height: MediaQuery.of(context).size.height * 0.8, + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), + ), + ), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, + ), + ), + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), + ), + ), + ) + ], + ), + ), + ), + ); + } +} diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart new file mode 100644 index 00000000..2b99e53a --- /dev/null +++ b/lib/screens/prescription/prescriptions_page.dart @@ -0,0 +1,122 @@ +import 'package:doctor_app_flutter/core/enum/filter_type.dart'; +import 'package:doctor_app_flutter/core/viewModel/prescriptions_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; +import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.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/app_expandable_notifier_new.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class PrescriptionsPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + PatiantInformtion patient = routeArgs['patient']; + + ProjectViewModel projectViewModel = Provider.of(context); + return BaseView( + onModelReady: (model) => model.getPrescriptions(patient), + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).prescriptions, + body: FractionallySizedBox( + widthFactor: 1.0, + child: ListView( + physics: BouncingScrollPhysics(), + children: [ + Row( + children: [ + Expanded( + flex: 1, + child: InkWell( + onTap: () => model + .setFilterType(FilterType.Clinic), + child: ListTile( + title: Text(TranslationBase.of(context).clinic), + leading: Radio( + value: FilterType.Clinic, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ), + Expanded( + flex: 1, + child: InkWell( + onTap: () => model + .setFilterType(FilterType.Hospital), + child: ListTile( + title: Text(TranslationBase.of(context).hospital), + leading: Radio( + value: FilterType.Hospital, + groupValue: model.filterType, + onChanged: (FilterType value) { + model.setFilterType(value); + }, + ), + ), + ), + ) + ], + ), + ...List.generate( + model.prescriptionsOrderList.length, + (index) => AppExpandableNotifier( + title: model + .prescriptionsOrderList[index].filterName, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .prescriptionsOrderList[index].prescriptionsList + .map((prescriptions) { + return InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: prescriptions, + ), + ), + ), + child: DoctorCard( + name: prescriptions.doctorName, + profileUrl: prescriptions.doctorImageURL, + rat: + prescriptions.actualDoctorRate.toDouble(), + subName: prescriptions.name, + isInOutPatient: prescriptions.isInOutPatient, + isLiveCareAppointment: + prescriptions.isLiveCareAppointment, + date: projectViewModel.isArabic + ? DateUtils + .getMonthDayYearDateFormattedAr( + DateUtils.convertStringToDate( + prescriptions + .appointmentDate)) + : DateUtils.getMonthDayYearDateFormatted( + DateUtils.convertStringToDate( + prescriptions.appointmentDate)), + ), + ); + }).toList(), + )), + ) + ], + ), + ), + )); + } +} diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 868ad086..331b2812 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1160,6 +1160,10 @@ class TranslationBase { String get companyName => localizedValues['companyName'][locale.languageCode]; String get procedureName => localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; + String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get notes => localizedValues['notes'][locale.languageCode]; + String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; + } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 60a0154e..7a672570 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -172,6 +172,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, icon: 'lab.png'), + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_ECG, + nameLine1: TranslationBase.of(context).patient, + nameLine2: "ECG", + icon: 'lab.png'), ], ), ); 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 883b3e4b..6863362b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -8,10 +8,10 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; class ProfileMedicalInfoWidgetSearch extends StatelessWidget { - String from; - String to; - PatiantInformtion patient; - String patientType; + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; ProfileMedicalInfoWidgetSearch( {Key key, this.patient, this.patientType, this.from, this.to}); @@ -29,7 +29,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: RADIOLOGY, + route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'radiology-1.png'), From a167db7651b17594b3e5c2f2de1177e2d757676d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Wed, 24 Mar 2021 13:49:17 +0200 Subject: [PATCH 389/421] Fix prescription items --- lib/routes.dart | 3 + .../prescription/prescription_items_page.dart | 273 +++++++++--------- .../prescription/prescriptions_page.dart | 1 + .../profile_medical_info_widget_search.dart | 4 +- 4 files changed, 143 insertions(+), 138 deletions(-) diff --git a/lib/routes.dart b/lib/routes.dart index 909b1bf4..dc905ba8 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/screens/patients/profile/refer_patient_screen import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart'; 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/prescription/prescriptions_page.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'; @@ -108,6 +109,7 @@ const String IN_PATIENT_PRESCRIPTIONS_DETAILS = 'patients/prescription-details'; // const String VIDEO_CALL = 'video-call'; const String LIVECARE_PENDING_LIST = 'livecare-pendinglist'; const String ORDER_PRESCRIPTION = 'prescription/prescriptionsss'; +const String ORDER_PRESCRIPTION_NEW = 'prescription/prescription_new'; const String ORDER_PRESCRIPTION_HISTORY = 'prescription/prescriptionsssH'; const String ORDER_PROCEDURE = 'procedure/procedure'; // const String LIVECARE_END_DIALOG = 'video-call/EndCallDialogBox'; @@ -173,6 +175,7 @@ var routes = { ADD_SICKLEAVE: (_) => AddSickLeavScreen(), SHOW_SICKLEAVE: (_) => ShowSickLeaveScreen(), ORDER_PRESCRIPTION: (_) => NewPrescriptionScreen(), + ORDER_PRESCRIPTION_NEW: (_) => PrescriptionsPage(), ORDER_PRESCRIPTION_HISTORY: (_) => NewPrescriptionHistoryScreen(), ORDER_PROCEDURE: (_) => ProcedureScreen(), diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index a306a93f..67e957a2 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -11,7 +11,6 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; class PrescriptionItemsPage extends StatelessWidget { final Prescriptions prescriptions; @@ -27,153 +26,155 @@ class PrescriptionItemsPage extends StatelessWidget { isShowAppBar: true, appBarTitle: TranslationBase.of(context).prescriptions, baseViewModel: model, - body: Container( - height: MediaQuery.of(context).size.height * 0.8, - child: Column( - children: [ - if (!prescriptions.isInOutPatient) - ...List.generate( - model.prescriptionReportList.length, - (index) => InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: - model.prescriptionReportList[index], + body: SingleChildScrollView( + child: Container( + child: Column( + children: [ + if (!prescriptions.isInOutPatient) + ...List.generate( + model.prescriptionReportList.length, + (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: + model.prescriptionReportList[index], + ), ), ), - ), - child: Container( - width: double.infinity, - margin: - EdgeInsets.only(top: 10, left: 10, right: 10), - padding: EdgeInsets.all(8.0), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(10.0), + child: Container( + width: double.infinity, + margin: + EdgeInsets.only(top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), ), - border: Border.all( - color: Colors.grey[200], width: 0.5), - ), - child: Row( - children: [ - ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(5)), - child: Image.network( - model.prescriptionReportList[index] - .imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + child: Row( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(5)), + child: Image.network( + model.prescriptionReportList[index] + .imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, + ), ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Center( - child: Texts(model - .prescriptionReportList[index] - .itemDescription - .isNotEmpty - ? model.prescriptionReportList[index] - .itemDescription - : model.prescriptionReportList[index] - .itemDescriptionN)), - )), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Center( + child: Texts(model + .prescriptionReportList[index] + .itemDescription + .isNotEmpty + ? model.prescriptionReportList[index] + .itemDescription + : model.prescriptionReportList[index] + .itemDescriptionN)), + )), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), - ), - )) - else - ...List.generate( - model.prescriptionReportEnhList.length, - (index) => InkWell( - onTap: () { - PrescriptionReport prescriptionReport = - PrescriptionReport( - imageSRCUrl: model - .prescriptionReportEnhList[index].imageSRCUrl, - itemDescription: model - .prescriptionReportEnhList[index] - .itemDescription, - itemDescriptionN: model - .prescriptionReportEnhList[index] - .itemDescription, - routeN: - model.prescriptionReportEnhList[index].route, - frequency: model - .prescriptionReportEnhList[index].frequency, - frequencyN: model - .prescriptionReportEnhList[index].frequency, - doseDailyQuantity: model - .prescriptionReportEnhList[index] - .doseDailyQuantity, - days: model.prescriptionReportEnhList[index].days, - itemID: - model.prescriptionReportEnhList[index].itemID, - remarks: model - .prescriptionReportEnhList[index].remarks); - Navigator.push( - context, - FadePage( - page: PrescriptionDetailsPage( - prescriptionReport: prescriptionReport, - ), - ), - ); - }, - child: Container( - margin: EdgeInsets.all(8.0), - color: Colors.white, - child: Row( - children: [ - ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(5)), - child: Image.network( - model - .prescriptionReportEnhList[index].imageSRCUrl, - fit: BoxFit.cover, - width: 60, - height: 70, + )) + else + ...List.generate( + model.prescriptionReportEnhList.length, + (index) => InkWell( + onTap: () { + PrescriptionReport prescriptionReport = + PrescriptionReport( + imageSRCUrl: model + .prescriptionReportEnhList[index].imageSRCUrl, + itemDescription: model + .prescriptionReportEnhList[index] + .itemDescription, + itemDescriptionN: model + .prescriptionReportEnhList[index] + .itemDescription, + routeN: + model.prescriptionReportEnhList[index].route, + frequency: model + .prescriptionReportEnhList[index].frequency, + frequencyN: model + .prescriptionReportEnhList[index].frequency, + doseDailyQuantity: model + .prescriptionReportEnhList[index] + .doseDailyQuantity, + days: model.prescriptionReportEnhList[index].days, + itemID: + model.prescriptionReportEnhList[index].itemID, + remarks: model + .prescriptionReportEnhList[index].remarks); + Navigator.push( + context, + FadePage( + page: PrescriptionDetailsPage( + prescriptionReport: prescriptionReport, ), ), - SizedBox( - width: 10, - ), - Expanded( - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(model.prescriptionReportEnhList[index] - .itemDescription), - ], + ); + }, + child: Container( + margin: EdgeInsets.all(8.0), + color: Colors.white, + child: Row( + children: [ + ClipRRect( + borderRadius: BorderRadius.all(Radius.circular(5)), + child: Image.network( + model + .prescriptionReportEnhList[index].imageSRCUrl, + fit: BoxFit.cover, + width: 60, + height: 70, ), ), - ), - Icon( - Icons.arrow_forward_ios, - size: 18, - color: Colors.grey[500], - ) - ], + SizedBox( + width: 10, + ), + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts(model.prescriptionReportEnhList[index] + .itemDescription), + ], + ), + ), + ), + Icon( + Icons.arrow_forward_ios, + size: 18, + color: Colors.grey[500], + ) + ], + ), ), ), ), - ) - ], + + ], + ), ), ), ), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 2b99e53a..d595ff0b 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -88,6 +88,7 @@ class PrescriptionsPage extends StatelessWidget { FadePage( page: PrescriptionItemsPage( prescriptions: prescriptions, + patient: patient, ), ), ), 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 6863362b..b5e96ec7 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'lab.png'), From e640bcf975852bd5fb46bbac977d9256641a9156 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Wed, 24 Mar 2021 16:12:37 +0300 Subject: [PATCH 390/421] search updated --- lib/core/service/patient_service.dart | 2 + lib/models/patient/patiant_info_model.dart | 2 +- .../patients/patient_search_screen.dart | 96 +++++++++---------- lib/screens/patients/patients_screen.dart | 3 +- 4 files changed, 53 insertions(+), 50 deletions(-) diff --git a/lib/core/service/patient_service.dart b/lib/core/service/patient_service.dart index 4f190ff8..477d9d80 100644 --- a/lib/core/service/patient_service.dart +++ b/lib/core/service/patient_service.dart @@ -129,6 +129,8 @@ class PatientService extends BaseService { "SessionID": patient.SessionID, "IsLoginForDoctorApp": patient.IsLoginForDoctorApp, "PatientOutSA": patient.PatientOutSA, + "SearchType": patient.Searchtype, + "MobileNo": '' }, ); diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 2c3bb2b2..02f0b2c2 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -3,7 +3,7 @@ class PatiantInformtion { final List list; int genderInt; - String age; + dynamic age; String appointmentDate; int appointmentNo; String appointmentType; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index d1a8cd22..3fc538ff 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -443,38 +443,6 @@ class _PatientSearchScreenState extends State { }, 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) - // .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, ), @@ -487,23 +455,55 @@ class _PatientSearchScreenState extends State { 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) {}, - ), + 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; + } + }), ), - (!(_selectedType == '2' || - _selectedType == '4')) - ? DynamicElements( - _patientSearchFormValues, - isFormSubmitted) - : SizedBox( - height: 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.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, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 56935a8e..4803c039 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -295,8 +295,9 @@ class _PatientsScreenState extends State { } else { if (isView == false && val2 == 1) { lItems = res['GetPatientFileInformation_PRMList']; + } else { + lItems = res[SERVICES_PATIANT2[val2]]; } - lItems = res[SERVICES_PATIANT2[val2]]; } parsed = lItems; responseModelList = new ModelResponse.fromJson(parsed).list; From 0e05b90c6b82c6d1a68711dbbb76753591fb8aed Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 24 Mar 2021 16:42:17 +0200 Subject: [PATCH 391/421] finish patient profile screen --- lib/config/config.dart | 4 +- lib/config/localized_values.dart | 6 +- .../profile/patient_profile_screen.dart | 1583 +++++++++-------- .../profile/PatientProfileButton.dart | 27 +- .../profile/profile_medical_info_widget.dart | 73 +- .../profile_medical_info_widget_search.dart | 2 +- lib/widgets/shared/borderedButton.dart | 14 +- 7 files changed, 918 insertions(+), 791 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 81dea160..df2b83e8 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -//const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 4f64d5ee..5544ca75 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -337,8 +337,8 @@ const Map> localizedValues = { 'sameBranch': {'en': "Same Branch", 'ar': 'نفس الفرع'}, 'otherBranch': {'en': "Other Branch", 'ar': 'فرع آخر'}, 'dr': {'en': "DR.", 'ar': 'د.'}, - 'previewHealth': {'en': "Preview Health", 'ar': 'معاينة الصحة'}, - 'summaryReport': {'en': "Summary Report", 'ar': 'تقرير موجز'}, + 'previewHealth': {'en': "Health", 'ar': 'الصحة'}, + 'summaryReport': {'en': "Summary", 'ar': 'موجز'}, 'accept': {'en': "ACCEPT", 'ar': 'قبول'}, 'reject': {'en': "REJECT", 'ar': 'رفض'}, 'noAppointmentsErrorMsg': { @@ -490,7 +490,7 @@ const Map> localizedValues = { 'significantSigns': {'en': "SIGNIFICANT SIGNS", 'ar': 'علامات مهمة'}, 'backAbdomen': {'en': "Back : Abdomen", 'ar': 'الظهر: البطن'}, 'reasons': {'en': "Reasons", 'ar': 'الأسباب'}, - 'createNew': {'en': "Create New", 'ar': 'انشاء '}, + 'createNew': {'en': "Create", 'ar': 'انشاء '}, 'episode': {'en': "Episode", 'ar': 'Episode'}, 'chiefComplaints': {'en': "Chief Complaints", 'ar': 'الشكاوى'}, 'addChiefComplaints': {'en': "Add Chief Complaints", 'ar': ' اضافه الشكاوى'}, diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 6adf2eee..a2282f49 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -5,19 +5,25 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; +import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; +import '../../../routes.dart'; + /* *@author: Elham Rababah *@Date:22/4/2020 @@ -38,6 +44,7 @@ class PatientProfileScreen extends StatelessWidget { patient = routeArgs['patient']; String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; String from = routeArgs['from']; String to = routeArgs['to']; if (routeArgs.containsKey("isSearch")) { @@ -61,773 +68,397 @@ class PatientProfileScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).patientProfile, + isShowAppBar: false, body: Container( color: Color(0XFFF2F2F2), - child: CustomScrollView(primary: false, slivers: [ - SliverList( - delegate: SliverChildListDelegate( - [ - /* Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Container( - decoration: BoxDecoration(boxShadow: [ - BoxShadow( - color: Colors.grey.shade300, - blurRadius: 10.0, - spreadRadius: 0, - offset: Offset(0, 10)), - ], color: Colors.white), - child: Column(children: [ - Padding( - padding: const EdgeInsets.all(8.0), - child: Row( - children: [ - AvatarWidget( - Icon( - patient.genderDescription == "Male" - ? DoctorApp.male - : DoctorApp.female_icon, - size: 70, - color: Colors.white, - ), + child: Stack( + children: [ + SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 220, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), ), - SizedBox( - width: 20, + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', ), - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - patient.firstName + - ' ' + - patient.lastName, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .fileNo, - color: Colors.black, - fontWeight: FontWeight.bold, - ), - SizedBox( - width: 4, - ), - AppText( - patient.patientId.toString(), - color: Colors.black, - fontWeight: FontWeight.normal, - ), - ], - ), - model.patientAllergiesList - .isNotEmpty && - model.getAllergicNames( - projectViewModel - .isArabic) != - '' - ? Container( - width: MediaQuery.of(context) - .size - .width * - 0.65, - child: Padding( - padding: const EdgeInsets - .symmetric(vertical: 8), - child: AppText( - TranslationBase.of( - context) - .allergicTO + - " : " + - model.getAllergicNames( - projectViewModel - .isArabic), - color: Color(0xFFB9382C), - fontWeight: - FontWeight.bold, - ), - ), - ) - : AppText(''), - ], - ) - ], + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - Container( - height: 11 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).age, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", - fontWeight: FontWeight.normal, - fontSize: 1.6 * - SizeConfig.textMultiplier, - ), - ], - ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, ), ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .nationality, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.nationalityName ?? - patient.nationality, - fontWeight: FontWeight.normal, - fontSize: 1.7 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .gender, - fontWeight: FontWeight.bold, - fontSize: 2 * - SizeConfig.textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient.gender.toString() == '1' - ? 'Male' - : 'Female', - fontWeight: FontWeight.normal, - fontSize: 1.8 * - SizeConfig.textMultiplier, - ), - ], - ), - ), - ), - ], - ), - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), - ]), - ), - if (patient.admissionNo != null) - Container( - margin: EdgeInsets.all(16), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .admissionDetail, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 1.8 * SizeConfig.textMultiplier, ), SizedBox( - height: 4, + width: 10, ), - Container( - decoration: BoxDecoration( - color: Colors.white, - shape: BoxShape.rectangle, - borderRadius: BorderRadius.circular(8), - border: - Border.fromBorderSide(BorderSide( - color: Color(0xffBBBBBB), - width: 1, - )), - ), + Expanded( child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Padding( - padding: EdgeInsets.all(16), - child: Column( - children: [ - Row( - children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .dateTime, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - Expanded( - child: AppText( - patient.createdOn != - null - ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" - : "", - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - ], - ), - SizedBox( - height: 4, - ), - Row( - children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .admissionNo, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - AppText( - patient.admissionNo != - null - ? patient.admissionNo - : '', - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), - SizedBox( - height: 4, - ), - Row( + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, children: [ - Container( - width: 14 * - SizeConfig - .textMultiplier, - child: AppText( - TranslationBase.of( - context) - .losNo, - color: Colors.black, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ), - AppText( - patient.createdOn != null - ? DateUtils - .differenceBetweenServerDateAndCurrent( - patient - .createdOn, - context) - : "", - color: Colors.black, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) ], - ), - ], - ), - ), - const Divider( - color: Color(0xffCCCCCC), - height: 5, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Container( - height: - 10 * SizeConfig.textMultiplier, - child: Row( - children: [ - Expanded( - child: Padding( - padding: const EdgeInsets - .fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .area, - fontWeight: - FontWeight.bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - height: 4, - ), - AppText( - patient - .clinicDescription, - fontWeight: - FontWeight.normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], - ), + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, ), - ), - Container( - width: 1, - color: Color(0xffCCCCCC), - ), - Expanded( - child: Padding( - padding: const EdgeInsets - .fromLTRB( - 16.0, 8.0, 8.0, 8.0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment - .start, - mainAxisAlignment: - MainAxisAlignment - .spaceEvenly, - children: [ - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .room, - fontWeight: - FontWeight - .bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - Expanded( - child: AppText( - "${patient.nursingStationName}\n${patient.roomId}", - fontWeight: - FontWeight - .normal, - fontSize: 1.4 * - SizeConfig - .textMultiplier, - ), - ), - ], + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), ), - ), - SizedBox( - height: 4, - ), - Expanded( - child: Row( - crossAxisAlignment: - CrossAxisAlignment - .start, - children: [ - AppText( - TranslationBase.of( - context) - .bed, - fontWeight: - FontWeight - .bold, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - SizedBox( - width: 4, - ), - AppText( - "${patient.bedId}", - fontWeight: - FontWeight - .normal, - fontSize: 1.6 * - SizeConfig - .textMultiplier, - ), - ], + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, ), - ), - ], + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, ), ), - ), - ], - ), - ) - ], - ), - ) - ], - ), - ), - ], - ),*/ - Container( - // margin: EdgeInsets.all(6), - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - // borderRadius: BorderRadius.circular(15), - color: Colors.white, - ), - child: Stack( - children: [ - Container( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 10), - child: Column( - children: [ - Row( - children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - SERVICES_PATIANT2[int.parse( - patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors - .green, - fontWeight: - FontWeight - .bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: Colors - .red[800], - fontWeight: - FontWeight - .bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - patientType == '1' - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight - .w600, - ) - : AppText( - DateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: - 'Poppins', - fontWeight: - FontWeight - .w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of( + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( context) - .appointmentDate + - " : ", - fontSize: 14, - ), - patient.startTime != null - ? Container( - height: 15, - width: 60, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 25), - color: HexColor( - "#20A169"), - ), - child: AppText( - patient - .startTime, - color: Colors - .white, - fontSize: 1.5 * - SizeConfig - .textMultiplier, - textAlign: - TextAlign - .center, - fontWeight: - FontWeight - .bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2( - patient - .appointmentDate - .toString()), - fontSize: 1.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], ), + ), Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * - SizeConfig - .textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, - style: TextStyle( - fontSize: 14, - fontFamily: - 'Poppins')), - new TextSpan( - text: patient - .patientId - .toString(), - style: TextStyle( - fontWeight: - FontWeight - .w700, - fontFamily: - 'Poppins', - fontSize: 15)), - ], - ), + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, ), - Expanded(child: Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality, - fontWeight: FontWeight.bold, - fontSize: 14, - ), - patient.nationality != null - ? ClipRRect( + patient.nationality != null + ? ClipRRect( borderRadius: - BorderRadius.circular(20.0), + BorderRadius + .circular( + 20.0), child: Image.network( - patient.nationalityFlagURL, + patient + .nationalityFlagURL, height: 25, width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); }, )) - : SizedBox() - ], - )) + : SizedBox() ], ) ], ), - ) - ], - crossAxisAlignment: - CrossAxisAlignment.start, + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), ), - ], - ), + ]), + ], ), - ], + ), ), - ), - ], - ), - ), - SliverPadding( - padding: const EdgeInsets.all(16.0), - sliver: isFromSearch - ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, - from: from, - to: to, + Padding( + padding: const EdgeInsets.all(16.0), + child: Container( + child: Column( + children: [ + isFromSearch + ? ProfileMedicalInfoWidgetSearch( + patient: patient, + patientType: patientType, + from: from, + to: to, + ) + : ProfileMedicalInfoWidget( + patient: patient, + patientType: patientType, + from: from, + to: to, + ), + ], + ), + ), ) - : ProfileMedicalInfoWidget( - patient: patient, - patientType: patientType, - from: from, - to: to, - ), - ) - ]), + ], + ), + ), + if (int.parse(patientType) == 7 || + int.parse(patientType) == 6) + Positioned( + top: 195, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + BorderedButton( + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + backgroundColor: Colors.red.shade700, + textColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 12, + fontFamily: 'Poppins', + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + handler: () async { + PostEpisodeReqModel postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: patient.appointmentNo, + patientMRN: patient.patientMRN); + GifLoaderDialogUtils.showMyDialog(context); + await model.postEpisode(postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog(context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: {'patient': patient}); + }, + ), + if (patient.episodeNo != 0) + BorderedButton( + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + backgroundColor: Colors.red.shade700, + textColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 12, + fontFamily: 'Poppins', + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + handler: () { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: {'patient': patient}); + }, + ), + ], + ), + ), + ], + ), ), )); } @@ -875,7 +506,6 @@ convertDateFormat2(String str) { return newDate.toString(); } - isToday(date) { DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); return DateFormat("yyyy-MM-dd").format(tempDate) == @@ -892,3 +522,500 @@ myBoxDecoration() { ), borderRadius: BorderRadius.circular(10)); } + +/* Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + decoration: BoxDecoration(boxShadow: [ + BoxShadow( + color: Colors.grey.shade300, + blurRadius: 10.0, + spreadRadius: 0, + offset: Offset(0, 10)), + ], color: Colors.white), + child: Column(children: [ + Padding( + padding: const EdgeInsets.all(8.0), + child: Row( + children: [ + AvatarWidget( + Icon( + patient.genderDescription == "Male" + ? DoctorApp.male + : DoctorApp.female_icon, + size: 70, + color: Colors.white, + ), + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + patient.firstName + + ' ' + + patient.lastName, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .fileNo, + color: Colors.black, + fontWeight: FontWeight.bold, + ), + SizedBox( + width: 4, + ), + AppText( + patient.patientId.toString(), + color: Colors.black, + fontWeight: FontWeight.normal, + ), + ], + ), + model.patientAllergiesList + .isNotEmpty && + model.getAllergicNames( + projectViewModel + .isArabic) != + '' + ? Container( + width: MediaQuery.of(context) + .size + .width * + 0.65, + child: Padding( + padding: const EdgeInsets + .symmetric(vertical: 8), + child: AppText( + TranslationBase.of( + context) + .allergicTO + + " : " + + model.getAllergicNames( + projectViewModel + .isArabic), + color: Color(0xFFB9382C), + fontWeight: + FontWeight.bold, + ), + ), + ) + : AppText(''), + ], + ) + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + Container( + height: 11 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).age, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + "${DateUtils.convertDateFromServerFormat(patient.dateofBirth, 'dd-MM-yyyy')} / ${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + fontWeight: FontWeight.normal, + fontSize: 1.6 * + SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .nationality, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.normal, + fontSize: 1.7 * + SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .gender, + fontWeight: FontWeight.bold, + fontSize: 2 * + SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient.gender.toString() == '1' + ? 'Male' + : 'Female', + fontWeight: FontWeight.normal, + fontSize: 1.8 * + SizeConfig.textMultiplier, + ), + ], + ), + ), + ), + ], + ), + ), + Container( + width: double.infinity, + height: 1, + color: Color(0xffCCCCCC), + ), + ]), + ), + if (patient.admissionNo != null) + Container( + margin: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .admissionDetail, + color: Colors.black, + fontWeight: FontWeight.bold, + fontSize: 1.8 * SizeConfig.textMultiplier, + ), + SizedBox( + height: 4, + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.circular(8), + border: + Border.fromBorderSide(BorderSide( + color: Color(0xffBBBBBB), + width: 1, + )), + ), + child: Column( + children: [ + Padding( + padding: EdgeInsets.all(16), + child: Column( + children: [ + Row( + children: [ + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( + context) + .dateTime, + color: Colors.black, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + Expanded( + child: AppText( + patient.createdOn != + null + ? "${DateUtils.convertDateFromServerFormat(patient.createdOn, 'EEEE dd, MMMM yyyy hh:mm a')}" + : "", + color: Colors.black, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( + context) + .admissionNo, + color: Colors.black, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + AppText( + patient.admissionNo != + null + ? patient.admissionNo + : '', + color: Colors.black, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + SizedBox( + height: 4, + ), + Row( + children: [ + Container( + width: 14 * + SizeConfig + .textMultiplier, + child: AppText( + TranslationBase.of( + context) + .losNo, + color: Colors.black, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ), + AppText( + patient.createdOn != null + ? DateUtils + .differenceBetweenServerDateAndCurrent( + patient + .createdOn, + context) + : "", + color: Colors.black, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + ], + ), + ), + const Divider( + color: Color(0xffCCCCCC), + height: 5, + thickness: 1, + indent: 0, + endIndent: 0, + ), + Container( + height: + 10 * SizeConfig.textMultiplier, + child: Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets + .fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .area, + fontWeight: + FontWeight.bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + height: 4, + ), + AppText( + patient + .clinicDescription, + fontWeight: + FontWeight.normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + ), + ), + Container( + width: 1, + color: Color(0xffCCCCCC), + ), + Expanded( + child: Padding( + padding: const EdgeInsets + .fromLTRB( + 16.0, 8.0, 8.0, 8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment + .start, + mainAxisAlignment: + MainAxisAlignment + .spaceEvenly, + children: [ + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .room, + fontWeight: + FontWeight + .bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + Expanded( + child: AppText( + "${patient.nursingStationName}\n${patient.roomId}", + fontWeight: + FontWeight + .normal, + fontSize: 1.4 * + SizeConfig + .textMultiplier, + ), + ), + ], + ), + ), + SizedBox( + height: 4, + ), + Expanded( + child: Row( + crossAxisAlignment: + CrossAxisAlignment + .start, + children: [ + AppText( + TranslationBase.of( + context) + .bed, + fontWeight: + FontWeight + .bold, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + SizedBox( + width: 4, + ), + AppText( + "${patient.bedId}", + fontWeight: + FontWeight + .normal, + fontSize: 1.6 * + SizeConfig + .textMultiplier, + ), + ], + ), + ), + ], + ), + ), + ), + ], + ), + ) + ], + ), + ) + ], + ), + ), + ], + ),*/ diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index e0a1e5f0..28d3b700 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -36,6 +36,7 @@ class PatientProfileButton extends StatelessWidget { Widget build(BuildContext context) { return new Container( margin: new EdgeInsets.symmetric(horizontal: 4.0), + padding: EdgeInsets.fromLTRB(10, 10, 10, 5), child: InkWell( onTap: isDisable ? null @@ -45,6 +46,14 @@ class PatientProfileButton extends StatelessWidget { navigator(context, this.route); }, child: Column(children: [ + Container( + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: new Image.asset(url + icon, width: 50, height: 50,)) + ], + )), Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), @@ -53,33 +62,22 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( this.nameLine1, - color: Color(0xFFB9382C), + color: Colors.black, /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.5, ), AppText( this.nameLine2, color: Colors.black, fontWeight: FontWeight.w600, textAlign: TextAlign.left, - fontSize: SizeConfig.textMultiplier * 2, + fontSize: SizeConfig.textMultiplier * 1.5, ), if (isLoading) DrAppCircularProgressIndeicator() ], ), ), - Expanded( - child: Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(10), - child: new Image.asset(url + icon)) - ], - )), - ) ]), ), decoration: BoxDecoration( @@ -99,7 +97,6 @@ class PatientProfileButton extends StatelessWidget { ), ], ), - padding: EdgeInsets.fromLTRB(5, 10, 5, 5), ); } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 60a0154e..d85d7b44 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -29,13 +29,15 @@ class ProfileMedicalInfoWidget extends StatelessWidget { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => SliverGrid.count( + builder: (_, model, w) => GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, - mainAxisSpacing: 20, - crossAxisCount: 2, - childAspectRatio: 1.5, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, children: [ - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + /*if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, patient: patient, @@ -62,23 +64,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).update, nameLine2: TranslationBase.of(context).episode, route: UPDATE_EPISODE, - icon: 'modilfy-episode.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: RADIOLOGY, - nameLine1: TranslationBase.of(context).radiology, - nameLine2: TranslationBase.of(context).service, - icon: 'radiology-1.png'), - if (int.parse(patientType) == 7 || int.parse(patientType) == 6) - PatientProfileButton( - key: key, - patient: patient, - route: PATIENT_INSURANCE_APPROVALS, - nameLine1: TranslationBase.of(context).insurance, - nameLine2: TranslationBase.of(context).service, - icon: 'lab.png'), + icon: 'modilfy-episode.png'),*/ if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -87,11 +73,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { to: to, nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, - route: - VITAL_SIGN_DETAILS /* PATIENT_VITAL_SIGN - */ - , - icon: 'heartbeat.png'), + route: VITAL_SIGN_DETAILS, + icon: 'patient/vital_signs.png'), if (selectedPatientType != 7) PatientProfileButton( key: key, @@ -99,14 +82,14 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: LAB_ORDERS, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), + icon: 'patient/lab_results.png'), PatientProfileButton( key: key, patient: patient, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, - icon: 'radiology-1.png'), + icon: 'patient/health_summary.png'), if (selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 7) @@ -116,7 +99,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png'), + icon: 'patient/Progress_notes.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -124,7 +107,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PATIENT_ADMISSION_REQUEST, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, - icon: 'heartbeat.png'), + icon: 'patient/admission_req.png'), (int.parse(patientType) == 7 || int.parse(patientType) == 6) ? PatientProfileButton( key: key, @@ -132,14 +115,14 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png') + icon: 'patient/order_prescription.png') : PatientProfileButton( key: key, patient: patient, route: ORDER_PRESCRIPTION_HISTORY, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + icon: 'patient/order_prescription.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -147,7 +130,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, - icon: 'lab.png'), + icon: 'patient/Order_Procedures.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -155,7 +138,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: REFER_PATIENT_TO_DOCTOR, nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, - icon: 'note.png'), + icon: 'patient/refer_patient.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -163,7 +146,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + icon: 'patient/patient_sick_leave.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -171,7 +154,23 @@ class ProfileMedicalInfoWidget extends StatelessWidget { route: PATIENT_UCAF_REQUEST, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, - icon: 'lab.png'), + icon: 'patient/ucaf.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: RADIOLOGY, + nameLine1: TranslationBase.of(context).radiology, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/health_summary.png'), + if (int.parse(patientType) == 7 || int.parse(patientType) == 6) + PatientProfileButton( + key: key, + patient: patient, + route: PATIENT_INSURANCE_APPROVALS, + nameLine1: TranslationBase.of(context).insurance, + nameLine2: TranslationBase.of(context).service, + icon: 'patient/vital_signs.png'), ], ), ); 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 883b3e4b..f01319ab 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -20,7 +20,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { Widget build(BuildContext context) { return BaseView( onModelReady: (model) async {}, - builder: (_, model, w) => SliverGrid.count( + builder: (_, model, w) => GridView.count( crossAxisSpacing: 10, mainAxisSpacing: 20, crossAxisCount: 2, diff --git a/lib/widgets/shared/borderedButton.dart b/lib/widgets/shared/borderedButton.dart index 5ccf4544..4e841254 100644 --- a/lib/widgets/shared/borderedButton.dart +++ b/lib/widgets/shared/borderedButton.dart @@ -16,6 +16,7 @@ class BorderedButton extends StatelessWidget { final double rPadding; final double bPadding; final double fontSize; + final String fontFamily; final Widget icon; final FontWeight fontWeight; @@ -34,6 +35,7 @@ class BorderedButton extends StatelessWidget { this.rPadding = 4.0, this.bPadding = 0.0, this.fontSize = 0, + this.fontFamily = 'WorkSans', this.icon, this.fontWeight, }); @@ -55,22 +57,24 @@ class BorderedButton extends StatelessWidget { )), ), child: Container( + padding: (hPadding > 0 || vPadding > 0) + ? EdgeInsets.symmetric( + vertical: vPadding, horizontal: hPadding) + : EdgeInsets.fromLTRB( + lPadding, tPadding, rPadding, bPadding), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ icon != null ? icon : Container(), Container( - padding: (hPadding > 0 || vPadding > 0) - ? EdgeInsets.symmetric( - vertical: vPadding, horizontal: hPadding) - : EdgeInsets.fromLTRB( - lPadding, tPadding, rPadding, bPadding), + margin: EdgeInsets.symmetric(horizontal: 2), child: Text( text, textAlign: TextAlign.center, style: TextStyle( fontSize: fontSize == 0 ? SizeConfig.textMultiplier * 1.6 : fontSize, fontWeight: fontWeight != null ? fontWeight : FontWeight.normal, + fontFamily: fontFamily, color: textColor ?? Color(0xffc4aa54)), ), ), From 0ea66bd1e191de137cf60714db6879baadf30abc Mon Sep 17 00:00:00 2001 From: mosazaid Date: Wed, 24 Mar 2021 16:53:34 +0200 Subject: [PATCH 392/421] add the new design for the search patient --- .../profile_medical_info_widget_search.dart | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) 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 72d6df75..150ac872 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -21,10 +21,12 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { return BaseView( onModelReady: (model) async {}, builder: (_, model, w) => GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), crossAxisSpacing: 10, - mainAxisSpacing: 20, - crossAxisCount: 2, - childAspectRatio: 1.5, + mainAxisSpacing: 10, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, children: [ PatientProfileButton( key: key, @@ -32,22 +34,21 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, - icon: 'radiology-1.png'), + icon: 'patient/health_summary.png'), PatientProfileButton( key: key, patient: patient, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, - icon: 'lab.png'), - + icon: 'patient/vital_signs.png'), PatientProfileButton( key: key, patient: patient, - route: LAB_RESULT, + route: LAB_ORDERS, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, - icon: 'lab.png'), + icon: 'patient/lab_results.png'), PatientProfileButton( key: key, patient: patient, @@ -56,8 +57,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { nameLine1: TranslationBase.of(context).vital, nameLine2: TranslationBase.of(context).signs, route: VITAL_SIGN_DETAILS, - icon: 'heartbeat.png'), - + icon: 'patient/vital_signs.png'), // PatientProfileButton( // key: key, // patient: patient, @@ -69,45 +69,45 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png') + icon: 'patient/order_prescription.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_NEW, + route: ORDER_PRESCRIPTION_HISTORY, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, - icon: 'lab.png'), + icon: 'patient/order_prescription.png'), PatientProfileButton( key: key, patient: patient, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, - icon: 'radiology-1.png'), + icon: 'patient/health_summary.png'), PatientProfileButton( key: key, patient: patient, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", - icon: 'lab.png'), + icon: 'patient/patient_sick_leave.png'), PatientProfileButton( key: key, patient: patient, route: SHOW_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, - icon: 'sick_leaves_icons.png'), + icon: 'patient/patient_sick_leave.png'), PatientProfileButton( key: key, patient: patient, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, - icon: 'heartbeat.png'), + icon: 'patient/Progress_notes.png'), ], ), ); From 4f558dc41dfee8f6661be96022d2c900a8a4cc9e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 25 Mar 2021 12:50:31 +0200 Subject: [PATCH 393/421] fix referral card --- lib/config/localized_values.dart | 2 +- .../referral/my-referral-patient-screen.dart | 50 +- .../referral/patient_referral_screen.dart | 1 + .../patient-referral-item-widget.dart | 576 ++++++++++++------ lib/widgets/shared/card_with_bg_widget.dart | 37 +- 5 files changed, 430 insertions(+), 236 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a1f63710..f30a86e5 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -328,7 +328,7 @@ const Map> localizedValues = { 'ar': 'لا وصفة طبية مدرجة' }, 'referTo': {'en': "Refer To", 'ar': 'محال إلى'}, - 'referredFrom': {'en': "Referred From", 'ar': 'محال من'}, + 'referredFrom': {'en': "From : ", 'ar': ' : من'}, 'branch': {'en': "Branch", 'ar': 'الفرع'}, 'chooseAppointment': {'en': "Choose Appointment", 'ar': 'اختر موعد'}, 'appointmentNo': {'en': "Appointment # : ", 'ar': '# الموعد:'}, diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index a888ad3e..f54ac5e6 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,6 +23,7 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, + appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -33,33 +34,35 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( + // color: Colors.white, + height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox(height: 100), - ProfileWelcomeWidget( - AppText( - authProvider.selectedClinicName != null - ? authProvider.selectedClinicName - : authProvider.doctorProfile.clinicDescription, - fontSize: SizeConfig.textMultiplier * 1.7, - color: Colors.white, - textAlign: TextAlign.center, - ), - height: 100, - ), - SizedBox( - height: 16, - ), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ), + // ProfileWelcomeWidget( + // AppText( + // authProvider.selectedClinicName != null + // ? authProvider.selectedClinicName + // : authProvider.doctorProfile.clinicDescription, + // fontSize: SizeConfig.textMultiplier * 1.7, + // color: Colors.white, + // textAlign: TextAlign.center, + // ), + // height: 100, + // ), + // SizedBox( + // height: 16, + // ), + // Padding( + // padding: const EdgeInsets.symmetric(horizontal: 16.0), + // child: AppText( + // TranslationBase.of(context).myReferralPatient, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 16, + // ), + // ), ...List.generate( model.pendingReferral.length, (index) => InkWell( @@ -71,6 +74,7 @@ class MyReferralPatientScreen extends StatelessWidget { }, child: PatientReferralItemWidget( "${model.pendingReferral[index].patientID}", + patientInfo:model.pendingReferral[index] , patientName: model.pendingReferral[index].patientName, referralStatus: null, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 80f30aad..2906e196 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -37,6 +37,7 @@ class _PatientReferralScreen extends State appBarTitle: TranslationBase.of(context).patientsreferral, body: Scaffold( extendBodyBehindAppBar: true, + // backgroundColor: Colors.white, appBar: PreferredSize( preferredSize: Size.fromHeight(65.0), child: Center( diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index ee54917b..1f45485f 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,6 +1,11 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class PatientReferralItemWidget extends StatelessWidget { final String patientName; @@ -14,6 +19,7 @@ class PatientReferralItemWidget extends StatelessWidget { final String referredOn; final String answerFromTarget; final Widget infoIcon; + final PendingReferral patientInfo; PatientReferralItemWidget( this.patientID, { @@ -27,6 +33,7 @@ class PatientReferralItemWidget extends StatelessWidget { this.referredOn, this.answerFromTarget, this.infoIcon, + this.patientInfo, }); @override @@ -35,222 +42,389 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.all(16.0), child: Column( children: [ - Row( - children: [ - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - if (referralStatus != null) + //TODO should be removed by mousa + // Row( + // children: [ + // Expanded( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // if (referralStatus != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referralStatus, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Container( + // color: Color(0xFF4BA821), + // padding: EdgeInsets.all(4), + // child: AppText( + // referralStatus + // /*referralStatus == "46" + // ? TranslationBase.of(context).approved + // : TranslationBase.of(context).rejected*/ + // , + // color: Colors.white, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // isReferredTo + // ? "${TranslationBase.of(context).referTo}: " + // : "${TranslationBase.of(context).referredFrom}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // isSameBranch + // ? TranslationBase.of(context).sameBranch + // : TranslationBase.of(context).otherBranch, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // "${TranslationBase.of(context).referralDoctor} : ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Expanded( + // child: AppText( + // referralDoctorName != null + // ? "${TranslationBase.of(context).dr} $referralDoctorName" + // : "-", + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // if (clinicDescription != null) + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).clinic}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // clinicDescription, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).patientID}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // patientID ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // "${TranslationBase.of(context).patientName}: ", + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // patientName ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).referralRemark, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // Expanded( + // child: AppText( + // remark, + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 8, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referredOn, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // referredOn ?? '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // if (answerFromTarget != null) + // SizedBox( + // height: 8, + // ), + // if (answerFromTarget != null) + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).referralResponse, + // color: Colors.grey, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // AppText( + // answerFromTarget != "" ? answerFromTarget : '-', + // color: Colors.black, + // fontWeight: FontWeight.bold, + // fontSize: 12, + // ), + // ], + // ), + // SizedBox( + // height: 16, + // ), + // ], + // ), + // ), + // if (infoIcon != null) infoIcon, + // ], + // ), + // const Divider( + // color: Color(0xffCCCCCC), + // height: 1, + // thickness: 1, + // indent: 0, + // endIndent: 0, + // ), + SizedBox( + height: 8, + ), + Container( + child: CardWithBgWidget( + bgColor: patientInfo.referralStatus =='Pending' + ? Colors.orange[400] + : Colors.red[800], + hasBorder: false, + widget:Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).referralStatus, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Container( - color: Color(0xFF4BA821), - padding: EdgeInsets.all(4), - child: AppText( - referralStatus - /*referralStatus == "46" - ? TranslationBase.of(context).approved - : TranslationBase.of(context).rejected*/ - , - color: Colors.white, - fontWeight: FontWeight.bold, - fontSize: 12, + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: patientInfo.referralStatus, + style: TextStyle( + color: patientInfo.referralStatus =='Pending' + ? Colors.orange[400] + : Colors.red[800], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 18)), + ], ), ), + //TODO :ask backend to return in the standerformate + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) ], ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - isReferredTo - ? "${TranslationBase.of(context).referTo}: " - : "${TranslationBase.of(context).referredFrom}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - "${TranslationBase.of(context).referralDoctor} : ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 10, + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .fileNumber, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), - Expanded( - child: AppText( - referralDoctorName != null - ? "${TranslationBase.of(context).dr} $referralDoctorName" - : "-", - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .referredFrom, + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: isSameBranch + ? TranslationBase + .of(context) + .sameBranch + : TranslationBase + .of(context) + .otherBranch, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - ], - ), - SizedBox( - height: 8, - ), - if (clinicDescription != null) - Row( - children: [ - AppText( - "${TranslationBase.of(context).clinic}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - clinicDescription, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).patientID}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - patientID ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - "${TranslationBase.of(context).patientName}: ", - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - patientName ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 8, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).referralRemark, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - Expanded( - child: AppText( - remark, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .remarks + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.remarksFromSource, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - ], - ), - SizedBox( - height: 8, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).referredOn, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - referredOn ?? '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - if (answerFromTarget != null) - SizedBox( - height: 8, ), - if (answerFromTarget != null) + SizedBox(height: 20,), Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).referralResponse, - color: Colors.grey, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - AppText( - answerFromTarget != "" ? answerFromTarget : '-', - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - ], - ), - SizedBox( - height: 16, - ), - ], - ), - ), - if (infoIcon != null) infoIcon, - ], - ), - const Divider( - color: Color(0xffCCCCCC), - height: 1, - thickness: 1, - indent: 0, - endIndent: 0, - ), - SizedBox( - height: 8, + + Column(children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase + .of(context) + .referralDoctor + " : ", + style: TextStyle( + fontSize: 14, + fontFamily: 'Poppins')), + new TextSpan( + text: referralDoctorName, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ) + ],), + Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black) + ],) + ], + ), + // onTap: onTap, + )) ,), ), ], ), diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index f7fd3637..4a274529 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -13,8 +13,11 @@ import 'package:provider/provider.dart'; class CardWithBgWidget extends StatelessWidget { final Widget widget; + final Color bgColor; + final bool hasBorder; - CardWithBgWidget({@required this.widget}); + CardWithBgWidget( + {@required this.widget, this.bgColor, this.hasBorder = true}); @override Widget build(BuildContext context) { @@ -26,7 +29,9 @@ class CardWithBgWidget extends StatelessWidget { borderRadius: BorderRadius.all( Radius.circular(10.0), ), - border: Border.all(color: HexColor('#707070'), width: 2.0), + border: Border.all( + color: hasBorder ? HexColor('#707070') : Colors.transparent, + width: hasBorder ? 2.0 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), @@ -34,23 +39,33 @@ class CardWithBgWidget extends StatelessWidget { children: [ if (projectProvider.isArabic) Positioned( - child: Container( + child: Container( + decoration: BoxDecoration( + color: bgColor ?? HexColor('#58434F'), + + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10),),), width: 10, - color: HexColor('#58434F'), ), - bottom: 0, - top: 0, - right: 0, + bottom: 1, + top: 1, + right: 1, ) else Positioned( child: Container( + decoration: BoxDecoration( + color: bgColor ?? HexColor('#58434F'), + + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10), + bottomLeft: Radius.circular(10),),), width: 10, - color: HexColor('#58434F'), ), - bottom: 0, - top: 0, - left: 0, + bottom: 1, + top: 1, + left: 1, ), Container( padding: EdgeInsets.all(15.0), From ffd77528a2e00f91c93c921b5421ba973ada9b77 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 25 Mar 2021 13:14:58 +0200 Subject: [PATCH 394/421] patient profile new design --- lib/models/patient/patiant_info_model.dart | 15 ++- .../profile/patient_profile_screen.dart | 42 +++++---- .../referral/my-referral-detail-screen.dart | 94 +++++++++++-------- .../profile/PatientProfileButton.dart | 4 +- .../profile/patient-page-header-widget.dart | 2 +- 5 files changed, 91 insertions(+), 66 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 8c279f7c..8903791c 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,12 +1,13 @@ // TODO : it have to be changed. class PatiantInformtion { - final List list; + final PatiantInformtion patientDetails; int genderInt; dynamic age; String appointmentDate; int appointmentNo; String appointmentType; + int appointmentTypeId; String arrivedOn; int clinicGroupId; String companyName; @@ -31,6 +32,8 @@ class PatiantInformtion { String firstNameN; String middleNameN; String lastNameN; + String fullName; + String fullNameN; int gender; String dateofBirth; String nationalityId; @@ -58,7 +61,7 @@ class PatiantInformtion { int visitTypeId; String startTimes; PatiantInformtion( - {this.list, + {this.patientDetails, this.projectId, this.clinicId, this.doctorId, @@ -96,6 +99,7 @@ class PatiantInformtion { this.startTime, this.appointmentNo, this.appointmentType, + this.appointmentTypeId, this.arrivedOn, this.clinicGroupId, this.companyName, @@ -110,6 +114,8 @@ class PatiantInformtion { this.nationality, this.patientMRN, this.visitType, + this.fullName, + this.fullNameN, this.nationalityFlagURL, this.patientStatusType, this.visitTypeId, @@ -117,6 +123,8 @@ class PatiantInformtion { factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( + patientDetails: json['patientDetails'] != null ? new PatiantInformtion.fromJson(json['patientDetails']) + : null, projectId: json["ProjectID"] ?? json["projectID"], clinicId: json["ClinicID"] ?? json["clinicID"], doctorId: json["DoctorID"] ?? json["doctorID"], @@ -133,6 +141,8 @@ class PatiantInformtion { middleNameN: json["MiddleNameN"] ?? json["middleNameN"], lastNameN: json["LastNameN"] ?? json["lastNameN"], gender: json["Gender"] ?? json["gender"], + fullName: json["fullName"] ?? json["fullName"], + fullNameN: json["fullNameN"] ?? json["fullNameN"], dateofBirth: json["DateofBirth"] ?? json["dob"], nationalityId: json["NationalityID"] ?? json["nationalityID"], mobileNumber: json["MobileNumber"] ?? json["mobileNumber"], @@ -165,6 +175,7 @@ class PatiantInformtion { startTime: json["startTime"], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], + appointmentTypeId: json['appointmentTypeId'], arrivedOn: json['arrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index a2282f49..67626545 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -73,7 +73,7 @@ class PatientProfileScreen extends StatelessWidget { color: Color(0XFFF2F2F2), child: Stack( children: [ - SingleChildScrollView( + Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -368,25 +368,27 @@ class PatientProfileScreen extends StatelessWidget { ), ), ), - Padding( - padding: const EdgeInsets.all(16.0), - child: Container( - child: Column( - children: [ - isFromSearch - ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, - from: from, - to: to, - ) - : ProfileMedicalInfoWidget( - patient: patient, - patientType: patientType, - from: from, - to: to, - ), - ], + Expanded( + child: Padding( + padding: const EdgeInsets.all(16.0), + child: SingleChildScrollView( + child: Column( + children: [ + isFromSearch + ? ProfileMedicalInfoWidgetSearch( + patient: patient, + patientType: patientType, + from: from, + to: to, + ) + : ProfileMedicalInfoWidget( + patient: patient, + patientType: patientType, + from: from, + to: to, + ), + ], + ), ), ), ) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 7449d970..134f3c2a 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -2,14 +2,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.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/util/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientProfileButton.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile-welcome-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/borderedButton.dart'; @@ -42,17 +45,60 @@ class MyReferralDetailScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, + isShowAppBar: false, body: model.patientArrivalList != null && model.patientArrivalList.length > 0 ? Column( children: [ + Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(model.patientArrivalList[0].patientDetails.fullName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + model.patientArrivalList[0].patientDetails.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + ], + ), + ), + ), Expanded( child: SingleChildScrollView( child: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - ProfileWelcomeWidget( + /*ProfileWelcomeWidget( AppText( authProvider.selectedClinicName != null ? authProvider.selectedClinicName @@ -63,7 +109,7 @@ class MyReferralDetailScreen extends StatelessWidget { textAlign: TextAlign.center, ), height: 100, - ), + ),*/ SizedBox( height: 16, ), @@ -91,45 +137,11 @@ class MyReferralDetailScreen extends StatelessWidget { referredOn: pendingReferral.referredOn, ), SizedBox( - child: GridView.count( - childAspectRatio: 1.8, - crossAxisSpacing: 8, - mainAxisSpacing: 10, - controller: new ScrollController( - keepScrollOffset: false), - shrinkWrap: true, - padding: const EdgeInsets.all(4.0), - crossAxisCount: 2, - children: [ - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: MEDICAL_FILE, - nameLine1: TranslationBase.of(context) - .previewHealth, - nameLine2: TranslationBase.of(context) - .summaryReport, - icon: 'radiology-1.png'), - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: LAB_ORDERS, - nameLine1: - TranslationBase.of(context).lab, - nameLine2: - TranslationBase.of(context).result, - icon: 'lab.png'), - PatientProfileButton( - key: key, - patient: model.patientArrivalList[0], - route: - VITAL_SIGN_DETAILS /*PATIENT_VITAL_SIGN*/, - nameLine1: - TranslationBase.of(context).vital, - nameLine2: - TranslationBase.of(context).signs, - icon: 'heartbeat.png'), - ], + child: ProfileMedicalInfoWidgetSearch( + patient: model.patientArrivalList[0], + patientType: "7", + from: null, + to: null, ), ), ], diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 28d3b700..ad0a7bd7 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -88,14 +88,14 @@ class PatientProfileButton extends StatelessWidget { color: Color(0xffBBBBBB), width: 1, )), - boxShadow: [ + /*boxShadow: [ BoxShadow( color: Colors.grey.withOpacity(0.2), spreadRadius: 5, blurRadius: 7, offset: Offset(0, 3), // changes position of shadow ), - ], + ],*/ ), ); } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index 71515b1d..ffb297b1 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -67,7 +67,7 @@ class PatientPageHeaderWidget extends StatelessWidget { height: 5, ), AppText( - patient.firstName + ' ' + patient.lastName, + patient.patientDetails.fullName != null ? patient.patientDetails.fullName : patient.firstName, color: Colors.black, fontWeight: FontWeight.bold, ), From b19c3092a624b323e98c09d11c8e58240fd960ab Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Sun, 28 Mar 2021 09:43:13 +0300 Subject: [PATCH 395/421] bug fixes --- lib/client/base_app_client.dart | 107 +++++++++--------- lib/screens/dashboard_screen.dart | 6 +- .../patients/patient_search_screen.dart | 53 ++++----- lib/screens/patients/patients_screen.dart | 35 +++--- .../profile/patient_profile_screen.dart | 30 +++-- lib/widgets/patients/PatientCard.dart | 27 +++-- 6 files changed, 136 insertions(+), 122 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 722aa533..77545340 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -10,7 +10,6 @@ import 'package:flutter/cupertino.dart'; import 'package:http/http.dart' as http; import 'dart:io' show Platform; - DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); //ProjectProvider projectsProvider = new ProjectProvider(); @@ -86,7 +85,7 @@ class BaseAppClient { print("URL : $url"); print("Body : ${json.encode(body)}"); - String asd= json.encode(body); + if (await Helpers.checkConnection()) { final response = await http.post(url, body: json.encode(body), @@ -126,10 +125,10 @@ class BaseAppClient { postPatient(String endPoint, {Map body, - Function(dynamic response, int statusCode) onSuccess, - Function(String error, int statusCode) onFailure, - @required PatiantInformtion patient, - bool isExternal = false}) async { + Function(dynamic response, int statusCode) onSuccess, + Function(String error, int statusCode) onFailure, + @required PatiantInformtion patient, + bool isExternal = false}) async { String url = BASE_URL + endPoint; try { @@ -138,65 +137,63 @@ class BaseAppClient { 'Accept': 'application/json' }; - String token = await sharedPref.getString(TOKEN); - var languageID = - await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); - if (body.containsKey('SetupID')) { - body['SetupID'] = body.containsKey('SetupID') - ? body['SetupID'] != null - ? body['SetupID'] - : SETUP_ID - : SETUP_ID; - } - - body['VersionID'] = VERSION_ID; - body['Channel'] = CHANNEL; - body['LanguageID'] = languageID == 'ar' ? 1 : 2; + String token = await sharedPref.getString(TOKEN); + var languageID = + await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); + if (body.containsKey('SetupID')) { + body['SetupID'] = body.containsKey('SetupID') + ? body['SetupID'] != null + ? body['SetupID'] + : SETUP_ID + : SETUP_ID; + } - body['IPAdress'] = IP_ADDRESS; - body['generalid'] = GENERAL_ID; - body['PatientOutSA'] = body.containsKey('PatientOutSA') - ? body['PatientOutSA'] != null - ? body['PatientOutSA'] - : PATIENT_OUT_SA_PATIENT_REQ - : PATIENT_OUT_SA_PATIENT_REQ; + body['VersionID'] = VERSION_ID; + body['Channel'] = CHANNEL; + body['LanguageID'] = languageID == 'ar' ? 1 : 2; - if (body.containsKey('isDentalAllowedBackend')) { - body['isDentalAllowedBackend'] = - body.containsKey('isDentalAllowedBackend') - ? body['isDentalAllowedBackend'] != null - ? body['isDentalAllowedBackend'] - : IS_DENTAL_ALLOWED_BACKEND - : IS_DENTAL_ALLOWED_BACKEND; - } + body['IPAdress'] = IP_ADDRESS; + body['generalid'] = GENERAL_ID; + body['PatientOutSA'] = body.containsKey('PatientOutSA') + ? body['PatientOutSA'] != null + ? body['PatientOutSA'] + : PATIENT_OUT_SA_PATIENT_REQ + : PATIENT_OUT_SA_PATIENT_REQ; - body['DeviceTypeID'] = Platform.isAndroid ? 1: 2; + if (body.containsKey('isDentalAllowedBackend')) { + body['isDentalAllowedBackend'] = + body.containsKey('isDentalAllowedBackend') + ? body['isDentalAllowedBackend'] != null + ? body['isDentalAllowedBackend'] + : IS_DENTAL_ALLOWED_BACKEND + : IS_DENTAL_ALLOWED_BACKEND; + } + body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; - body['PatientType'] = body.containsKey('PatientType') - ? body['PatientType'] != null + body['PatientType'] = body.containsKey('PatientType') + ? body['PatientType'] != null ? body['PatientType'] - : patient.patientType!= null - ? patient.patientType - : PATIENT_TYPE - : PATIENT_TYPE; + : patient.patientType != null + ? patient.patientType + : PATIENT_TYPE + : PATIENT_TYPE; - body['PatientTypeID'] = body.containsKey('PatientTypeID') - ? body['PatientTypeID'] != null + body['PatientTypeID'] = body.containsKey('PatientTypeID') + ? body['PatientTypeID'] != null ? body['PatientTypeID'] - : patient.patientType!= null - ? patient.patientType - : PATIENT_TYPE_ID - : PATIENT_TYPE_ID; - - body['TokenID'] = token; - body['PatientID'] = body['PatientID'] != null - ? body['PatientID'] - : patient.patientId?? patient.patientMRN; + : patient.patientType != null + ? patient.patientType + : PATIENT_TYPE_ID + : PATIENT_TYPE_ID; - body['PatientOutSA'] = 0;//user['OutSA']; //TODO change it - body['SessionID'] = SESSION_ID; //getSe + body['TokenID'] = token; + body['PatientID'] = body['PatientID'] != null + ? body['PatientID'] + : patient.patientId ?? patient.patientMRN; + body['PatientOutSA'] = 0; //user['OutSA']; //TODO change it + body['SessionID'] = SESSION_ID; //getSe print("URL : $url"); print("Body : ${json.encode(body)}"); diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 67218e02..3351f831 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -843,7 +843,7 @@ class _DashboardScreenState extends State { MainAxisAlignment.start, children: [ AppText( - model.dashboardItemsList[5] + model.dashboardItemsList[6] .kPIName, fontSize: SizeConfig.textMultiplier * @@ -869,11 +869,11 @@ class _DashboardScreenState extends State { Axis.horizontal, children: new List.generate( model - .dashboardItemsList[5] + .dashboardItemsList[6] .summaryoptions .length, (int index) { return getActivityButton(model - .dashboardItemsList[5] + .dashboardItemsList[6] .summaryoptions[index]); }))) ], diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 3fc538ff..45d457cd 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -478,35 +478,32 @@ class _PatientSearchScreenState extends State { 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, + 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, ), diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index a475589d..286f206d 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -304,17 +304,24 @@ class _PatientsScreenState extends State { //if (val2 == 7) { responseModelList.sort((a, b) { if (b.startTime != null && b.startTime != null) { - DateTime now = DateTime.now(); - DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); - String formattedDate = - DateFormat('yyyy-MM-dd ' + a.startTime).format(now); - DateTime dateTimeA = dateFormat.parse(formattedDate); - String formattedDateB = - DateFormat('yyyy-MM-dd ' + b.startTime).format(now); - DateTime dateTimeB = dateFormat.parse(formattedDateB); - var adate = dateTimeA; //a.startTime; - var bdate = dateTimeB; - return adate.compareTo(bdate); + try { + DateTime now = DateTime.now(); + DateFormat dateFormat = DateFormat("yyyy-MM-dd HH:mm"); + String formattedDate = + DateFormat('yyyy-MM-dd ' + a.startTime).format(now); + DateTime dateTimeA = dateFormat.parse(formattedDate); + String formattedDateB = + DateFormat('yyyy-MM-dd ' + b.startTime).format(now); + DateTime dateTimeB = dateFormat.parse(formattedDateB); + var adate = dateTimeA; //a.startTime; + var bdate = dateTimeB; + return adate.compareTo(bdate); + } on Exception catch (_) { + print('never reached'); + var adate = a.startTime; //a.startTime; + var bdate = b.startTime; + return adate.compareTo(bdate); + } } else { var adate = convertDateFormat(a.appointmentDate); var bdate = convertDateFormat(b.appointmentDate); @@ -549,8 +556,10 @@ class _PatientsScreenState extends State { .getFrom, "to": patient.getTo, - "isSearch": isSearch, - "arrivalType" :arrivalType, + "isSearch": + isSearch, + "arrivalType": + arrivalType, }); }, ); diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index a2282f49..23c1d608 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -405,7 +405,9 @@ class PatientProfileScreen extends StatelessWidget { if (patient.episodeNo == 0) BorderedButton( "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - backgroundColor: Colors.red.shade700, + backgroundColor: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, textColor: Colors.white, vPadding: 8, radius: 30, @@ -419,17 +421,21 @@ class PatientProfileScreen extends StatelessWidget { height: 30, ), handler: () async { - PostEpisodeReqModel postEpisodeReqModel = - PostEpisodeReqModel( - appointmentNo: patient.appointmentNo, - patientMRN: patient.patientMRN); - GifLoaderDialogUtils.showMyDialog(context); - await model.postEpisode(postEpisodeReqModel); - GifLoaderDialogUtils.hideDialog(context); - patient.episodeNo = model.episodeID; - Navigator.of(context).pushNamed( - CREATE_EPISODE, - arguments: {'patient': patient}); + if (patient.patientStatusType == 43) { + PostEpisodeReqModel postEpisodeReqModel = + PostEpisodeReqModel( + appointmentNo: + patient.appointmentNo, + patientMRN: patient.patientMRN); + GifLoaderDialogUtils.showMyDialog(context); + await model + .postEpisode(postEpisodeReqModel); + GifLoaderDialogUtils.hideDialog(context); + patient.episodeNo = model.episodeID; + Navigator.of(context).pushNamed( + CREATE_EPISODE, + arguments: {'patient': patient}); + } }, ), if (patient.episodeNo != 0) diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 5e34e7b9..9ecc6a23 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -122,8 +122,9 @@ class PatientCard extends StatelessWidget { Row( children: [ AppText( - patientInfo.nationalityName ?? - patientInfo.nationality, + patientInfo.nationalityName != null + ? patientInfo.nationalityName + : patientInfo.nationality, fontWeight: FontWeight.bold, fontSize: 14, ), @@ -253,15 +254,19 @@ class PatientCard extends StatelessWidget { width: 3.5, ), Container( - child: AppText( - DateUtils.convertDateFromServerFormat( - patientInfo.appointmentDate - .toString(), - 'yyyy-MM-dd'), - fontSize: - 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), + child: patientInfo.appointmentDate != null + ? AppText( + DateUtils + .convertDateFromServerFormat( + patientInfo + .appointmentDate + .toString(), + 'yyyy-MM-dd'), + fontSize: 1.5 * + SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ) + : SizedBox(), ), SizedBox( height: 0.5, From ed104a4562ac8f97437674f644fe958c2b537809 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 10:29:07 +0300 Subject: [PATCH 396/421] working on referral card --- .../patient-referral-item-widget.dart | 252 +++++++++--------- 1 file changed, 121 insertions(+), 131 deletions(-) diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 1f45485f..a218e864 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -42,7 +42,7 @@ class PatientReferralItemWidget extends StatelessWidget { margin: EdgeInsets.all(16.0), child: Column( children: [ - //TODO should be removed by mousa + // TODO should be removed by mousa // Row( // children: [ // Expanded( @@ -262,73 +262,91 @@ class PatientReferralItemWidget extends StatelessWidget { ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus =='Pending' + bgColor: patientInfo.referralStatus == 'Pending' ? Colors.orange[400] : Colors.red[800], hasBorder: false, - widget:Container( - // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), - child: InkWell( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 10, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: patientInfo.referralStatus, - style: TextStyle( - color: patientInfo.referralStatus =='Pending' - ? Colors.orange[400] - : Colors.red[800], - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 18)), - ], - ), + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: patientInfo.referralStatus, + style: TextStyle( + color: patientInfo.referralStatus == + 'Pending' + ? Colors.orange[400] + : Colors.red[800], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 18)), + ], ), - //TODO :ask backend to return in the standerformate - AppText( - referredOn, - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + ), + //TODO :ask backend to return in the standerformate + AppText( + referredOn, + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 10, + ), + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - SizedBox( - width: 10, - ), - RichText( + ), + Container( + child: RichText( text: new TextSpan( style: new TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ new TextSpan( - text: TranslationBase - .of(context) - .fileNumber, + text: TranslationBase.of(context).referredFrom, style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), + fontSize: 14, fontFamily: 'Poppins')), new TextSpan( - text: patientInfo.patientID.toString(), + text: isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', @@ -336,95 +354,67 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referredFrom, - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase - .of(context) - .sameBranch - : TranslationBase - .of(context) - .otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).remarks + " : ", + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.remarksFromSource, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], ), ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( + ), + SizedBox( + height: 20, + ), + Column( + children: [ + RichText( + text: TextSpan( + style: TextStyle( fontSize: 2.0 * SizeConfig.textMultiplier, color: Colors.black), children: [ - new TextSpan( - text: TranslationBase - .of(context) - .remarks + " : ", + TextSpan( + text: TranslationBase.of(context) + .referralDoctor + + " : ", style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.remarksFromSource, + fontSize: 14, fontFamily: 'Poppins')), + TextSpan( + text: referralDoctorName, style: TextStyle( fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 15)), ], ), - ), - ), - SizedBox(height: 20,), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - - Column(children: [ - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase - .of(context) - .referralDoctor + " : ", - style: TextStyle( - fontSize: 14, - fontFamily: 'Poppins')), - new TextSpan( - text: referralDoctorName, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ) - ],), - Icon(FontAwesomeIcons.arrowRight, size: 25,color:Colors.black) - ],) - ], - ), - // onTap: onTap, - )) ,), + ) + ], + ), + Container( + width: double.infinity, + alignment: Alignment.centerRight, + child: Icon(FontAwesomeIcons.arrowRight, + size: 25, color: Colors.black)) + ], + ), + // onTap: onTap, + )), + ), ), ], ), From 08b7b6263c3b9736cacc3ac64ef552716271140c Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 28 Mar 2021 10:46:55 +0300 Subject: [PATCH 397/421] Add new services to arrival patient --- .../profile/profile_medical_info_widget.dart | 15 +++++++++++---- .../profile_medical_info_widget_search.dart | 6 +++--- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d6073657..d5a87f60 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -79,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: LAB_ORDERS, + route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), @@ -104,7 +104,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_ADMISSION_REQUEST, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), @@ -123,6 +123,13 @@ class ProfileMedicalInfoWidget extends StatelessWidget { nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), + PatientProfileButton( + key: key, + patient: patient, + route: ORDER_PRESCRIPTION_NEW, + nameLine1: TranslationBase.of(context).orders, + nameLine2: TranslationBase.of(context).prescription, + icon: 'patient/order_prescription.png'), if (int.parse(patientType) == 7 || int.parse(patientType) == 6) PatientProfileButton( key: key, @@ -159,7 +166,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: RADIOLOGY, + route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, icon: 'patient/health_summary.png'), @@ -167,7 +174,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: PATIENT_INSURANCE_APPROVALS, + route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, icon: 'patient/vital_signs.png'), 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 150ac872..704ced0d 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -45,7 +45,7 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - route: LAB_ORDERS, + route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, icon: 'patient/lab_results.png'), @@ -69,14 +69,14 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png') : PatientProfileButton( key: key, patient: patient, - route: ORDER_PRESCRIPTION_HISTORY, + route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, icon: 'patient/order_prescription.png'), From 27ff179750756448c80a24d7d25d7dd9a5a1db65 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Sun, 28 Mar 2021 11:12:42 +0300 Subject: [PATCH 398/421] working on referral screen bugs --- .../referral/my-referral-detail-screen.dart | 3 +- .../referral/my-referral-patient-screen.dart | 34 ++++--------------- .../referral/patient_referral_screen.dart | 3 +- .../referral/referred-patient-screen.dart | 1 + .../patient-referral-item-widget.dart | 19 +++++------ 5 files changed, 20 insertions(+), 40 deletions(-) diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index 134f3c2a..d6d9e8b6 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -126,7 +126,7 @@ class MyReferralDetailScreen extends StatelessWidget { PatientReferralItemWidget( "${pendingReferral.patientID}", patientName: pendingReferral.patientName, - referralStatus: null, + referralStatus: pendingReferral.referralStatus, isReferredTo: false, isSameBranch: pendingReferral.isReferralDoctorSameBranch, @@ -135,6 +135,7 @@ class MyReferralDetailScreen extends StatelessWidget { clinicDescription: null, remark: pendingReferral.remarksFromSource, referredOn: pendingReferral.referredOn, + patientInfo: pendingReferral, ), SizedBox( child: ProfileMedicalInfoWidgetSearch( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index f54ac5e6..3cab440c 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -23,7 +23,6 @@ class MyReferralPatientScreen extends StatelessWidget { builder: (_, model, w) => AppScaffold( baseViewModel: model, isShowAppBar: false, - appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( @@ -34,35 +33,13 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( + margin: EdgeInsets.only(top: 50), // color: Colors.white, - height: MediaQuery.of(context).size.height, + // height: MediaQuery.of(context).size.height, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox(height: 100), - // ProfileWelcomeWidget( - // AppText( - // authProvider.selectedClinicName != null - // ? authProvider.selectedClinicName - // : authProvider.doctorProfile.clinicDescription, - // fontSize: SizeConfig.textMultiplier * 1.7, - // color: Colors.white, - // textAlign: TextAlign.center, - // ), - // height: 100, - // ), - // SizedBox( - // height: 16, - // ), - // Padding( - // padding: const EdgeInsets.symmetric(horizontal: 16.0), - // child: AppText( - // TranslationBase.of(context).myReferralPatient, - // color: Colors.black, - // fontWeight: FontWeight.bold, - // fontSize: 16, - // ), - // ), + // SizedBox(height: 50), ...List.generate( model.pendingReferral.length, (index) => InkWell( @@ -74,10 +51,11 @@ class MyReferralPatientScreen extends StatelessWidget { }, child: PatientReferralItemWidget( "${model.pendingReferral[index].patientID}", - patientInfo:model.pendingReferral[index] , + patientInfo: model.pendingReferral[index], patientName: model.pendingReferral[index].patientName, - referralStatus: null, + referralStatus: + model.pendingReferral[index].referralStatus, isReferredTo: false, isSameBranch: model.pendingReferral[index] .isReferralDoctorSameBranch, diff --git a/lib/screens/patients/profile/referral/patient_referral_screen.dart b/lib/screens/patients/profile/referral/patient_referral_screen.dart index 2906e196..adea0247 100644 --- a/lib/screens/patients/profile/referral/patient_referral_screen.dart +++ b/lib/screens/patients/profile/referral/patient_referral_screen.dart @@ -92,7 +92,8 @@ class _PatientReferralScreen extends State controller: _tabController, children: [ MyReferralPatientScreen(), - MyReferredPatient(), + ReferredPatientScreen(), + // MyReferredPatient(), ], ), ) diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 323a9a9b..d6a81603 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -15,6 +15,7 @@ class ReferredPatientScreen extends StatelessWidget { onModelReady: (model) => model.getMyReferredPatient(), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).referredPatient, body: model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index a218e864..d5c1d035 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -39,7 +39,7 @@ class PatientReferralItemWidget extends StatelessWidget { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.all(16.0), + margin: EdgeInsets.only(left: 16.0, right: 16.0, top: 8.0), child: Column( children: [ // TODO should be removed by mousa @@ -257,14 +257,14 @@ class PatientReferralItemWidget extends StatelessWidget { // indent: 0, // endIndent: 0, // ), - SizedBox( - height: 8, - ), + // SizedBox( + // height: 8, + // ), Container( child: CardWithBgWidget( - bgColor: patientInfo.referralStatus == 'Pending' + bgColor: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -283,12 +283,11 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: patientInfo.referralStatus, + text: referralStatus != null ? referralStatus : "", style: TextStyle( - color: patientInfo.referralStatus == - 'Pending' + color: referralStatus != null ? referralStatus == 'Pending' ? Colors.orange[400] - : Colors.red[800], + : Colors.red[800] : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', fontSize: 18)), From 6267d805f018f233f98a5e3e09012070e624fec4 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Sun, 28 Mar 2021 12:08:36 +0300 Subject: [PATCH 399/421] hot fixes --- lib/config/config.dart | 4 ++-- .../service/patient-vital-signs-service.dart | 2 +- .../insurance_approval_screen_patient.dart | 5 +++-- .../radiology/radiology_details_page.dart | 5 +++-- lib/util/date-utils.dart | 17 +++++++++++------ 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..0f615af5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/core/service/patient-vital-signs-service.dart b/lib/core/service/patient-vital-signs-service.dart index bac13c7f..75bc955f 100644 --- a/lib/core/service/patient-vital-signs-service.dart +++ b/lib/core/service/patient-vital-signs-service.dart @@ -42,7 +42,7 @@ class VitalSignsService extends BaseService { hasError = false; Map body = Map(); body['PatientMRN'] = patient.patientId; // patient.patientMRN - body['AppointmentNo'] = patient.appointmentNo; + // body['AppointmentNo'] = patient.appointmentNo; // body['EpisodeID'] = patient.episodeNo; body['PatientTypeID'] = 1; body['PatientType'] = 1; diff --git a/lib/screens/patients/insurance_approval_screen_patient.dart b/lib/screens/patients/insurance_approval_screen_patient.dart index 91ed13b2..95f55e27 100644 --- a/lib/screens/patients/insurance_approval_screen_patient.dart +++ b/lib/screens/patients/insurance_approval_screen_patient.dart @@ -1,6 +1,7 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/InsuranceViewModel.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_scaffold_widget.dart'; @@ -236,7 +237,7 @@ class _InsuranceApprovalScreenNewState extends State ), Texts( - convertDateFormat(model.insuranceApproval[index].rceiptOn), + DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].rceiptOn).toString(), fontSize: 17.5, fontWeight: FontWeight.w600, @@ -257,7 +258,7 @@ class _InsuranceApprovalScreenNewState extends State ), Texts( - convertDateFormat(model.insuranceApproval[index].expiryDate), + DateUtils.getDateTimeFromServerFormat(model.insuranceApproval[index].expiryDate).toString(), fontSize: 17.5, fontWeight: FontWeight.w600, diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index fc9f207a..dedb5bd5 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -56,15 +56,16 @@ class RadiologyDetailsPage extends StatelessWidget { bottomSheet: Container( width: double.infinity, height: MediaQuery.of(context).size.height * 0.14, - color: Colors.grey[100], + // color: Colors.grey[100], child: Column( mainAxisSize: MainAxisSize.min, children: [ Divider(), - if (finalRadiology.dIAPACSURL != "") + if (model.radImageURL.isNotEmpty) Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( + onTap: () { launch(model.radImageURL); }, diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 4ef21844..51089567 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -19,16 +19,21 @@ class DateUtils { } static DateTime getDateTimeFromServerFormat(String str) { - const start = "/Date("; + DateTime date= DateTime.now(); + if (str!=null) { + const start = "/Date("; - const end = "+0300)"; + const end = "+0300)"; - final startIndex = str.indexOf(start); + final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); + final endIndex = str.indexOf(end, startIndex + start.length); - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); + date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + } else { + date = DateTime.now(); + } return date; } From f8c14a88eedb7cde1cd1dc8dc948415c847b5533 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 28 Mar 2021 17:59:37 +0300 Subject: [PATCH 400/421] fix schedule --- lib/util/date-utils.dart | 10 ++ lib/widgets/doctor/my_schedule_widget.dart | 115 ++++++++++++-------- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 3 files changed, 81 insertions(+), 46 deletions(-) diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 51089567..9396c2f0 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -284,4 +284,14 @@ class DateUtils { } return "$years ${TranslationBase.of(context).years} $months ${TranslationBase.of(context).months} $days ${TranslationBase.of(context).days}"; } + + static bool isToday(DateTime dateTime){ + + DateTime todayDate = DateTime.now().toUtc(); + if(dateTime.day == todayDate.day && dateTime.month == todayDate.month && dateTime.year == todayDate.year) { + return true; + } + return false; + + } } diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 34ec97db..bc681a94 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -1,8 +1,9 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.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:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,58 +17,82 @@ class MyScheduleWidget extends StatelessWidget { List workingHours = Helpers.getWorkingHours( workingHoursTable.workingHours, ); - return CardWithBgWidgetNew( - widget: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Column( - children: [ - Divider( - height: 1, - color: Colors.grey, - thickness: 1.0, - ), - ], + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + SizedBox( + height: 10, + ), + AppText( + workingHoursTable.dayName, + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + // fontSize: 18 ), SizedBox( height: 10, ), - Row( - children: [ - AppText( - workingHoursTable.dayName, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - AppText( - ' ${workingHoursTable.date.day}/${workingHoursTable.date.month}/${workingHoursTable.date.year}', - fontSize: 2.2 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ), - ], + AppText( + ' ${workingHoursTable.date.day} ${(DateUtils.getMonth(workingHoursTable.date.month).toString().substring(0, 3))}', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w700, + + fontFamily: 'Poppins', + // fontSize: 18 ), - Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: workingHours.map((work) { - return Container( - child: Column( - children: [ - SizedBox( - height: 5, - ), - AppText( - work.from + ' - ' + work.to, - fontSize: 2.0 * SizeConfig.textMultiplier, - fontWeight: FontWeight.w300, - ) - ], + ], + ), + Container( + width: MediaQuery.of(context).size.width * 0.55, + child: CardWithBgWidget( + bgColor: DateUtils.isToday(workingHoursTable.date) + ? Colors.green[500] + : Colors.transparent, + hasBorder: false, + widget: Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + if (DateUtils.isToday(workingHoursTable.date)) + AppText( + "Today", + fontSize: 2.5 * SizeConfig.textMultiplier, + fontFamily: 'Poppins', + color: Colors.green[500], + // fontSize: 18 + ), + SizedBox( + height: 10, ), - ); - }).toList(), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: workingHours.map((work) { + return Container( + child: Column( + children: [ + SizedBox( + height: 5, + ), + AppText( + work.from + ' - ' + work.to, + fontSize: 2.0 * SizeConfig.textMultiplier, + fontWeight: FontWeight.w300, + ) + ], + ), + ); + }).toList(), + ), + ], + ), ), - ], + ), ), - ), + ], ); } } diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index 4a274529..b4da8d28 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -24,7 +24,7 @@ class CardWithBgWidget extends StatelessWidget { ProjectViewModel projectProvider = Provider.of(context); return Container( margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, + // width: double.infinity, decoration: BoxDecoration( borderRadius: BorderRadius.all( Radius.circular(10.0), From c1868d98a46611c9f6f8c4caf3ef8e9ed3ab0539 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 28 Mar 2021 18:04:08 +0300 Subject: [PATCH 401/421] small fix --- lib/widgets/doctor/my_schedule_widget.dart | 2 +- lib/widgets/shared/card_with_bg_widget.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index bc681a94..25e794cf 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -52,7 +52,7 @@ class MyScheduleWidget extends StatelessWidget { bgColor: DateUtils.isToday(workingHoursTable.date) ? Colors.green[500] : Colors.transparent, - hasBorder: false, + // hasBorder: false, widget: Container( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/widgets/shared/card_with_bg_widget.dart b/lib/widgets/shared/card_with_bg_widget.dart index b4da8d28..3b65bba5 100644 --- a/lib/widgets/shared/card_with_bg_widget.dart +++ b/lib/widgets/shared/card_with_bg_widget.dart @@ -31,7 +31,7 @@ class CardWithBgWidget extends StatelessWidget { ), border: Border.all( color: hasBorder ? HexColor('#707070') : Colors.transparent, - width: hasBorder ? 2.0 : 0), + width: hasBorder ? 0.30 : 0), ), child: Material( borderRadius: BorderRadius.all(Radius.circular(10.0)), From db2c086ffd1f3fca903338da1529f4fa7cc715b7 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 28 Mar 2021 19:18:29 +0300 Subject: [PATCH 402/421] Medical Report New Design --- .../medical-file/medical_file_details.dart | 1134 +++++++++-------- .../medical-file/medical_file_page.dart | 314 ++++- pubspec.lock | 8 +- 3 files changed, 907 insertions(+), 549 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index e93bab49..64e4405b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -3,6 +3,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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/util/helpers.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_scaffold_widget.dart'; @@ -72,7 +73,6 @@ class _MedicalFileDetailsState extends State { child: SingleChildScrollView( child: Center( child: Container( - color: Colors.white, child: Column( children: [ Padding( @@ -278,96 +278,115 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .historyOfPresentIllness - .toUpperCase(), - variant: isHistoryExpand - ? "bodyText" - : '', - bold: isHistoryExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .historyOfPresentIllness + .toUpperCase(), + variant: isHistoryExpand + ? "bodyText" + : '', + bold: isHistoryExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isHistoryExpand = + !isHistoryExpand; + }); + }, + child: Icon(isHistoryExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - 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( + 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: [ - Expanded( - child: AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[ - 0] - .consulations[0] - .lstCheifComplaint[ - index] - .hOPI - .trim(), - ), + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstCheifComplaint[ + index] + .hOPI + .trim(), + ), + ), + SizedBox( + width: 35.0), + ], ), - SizedBox(width: 35.0), ], ), - ], - ), - ), - ); - }), - isExpand: isHistoryExpand, + ), + ); + }), + isExpand: isHistoryExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + SizedBox( height: 30, ), @@ -380,85 +399,174 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .assessment - .toUpperCase(), - variant: isAssessmentExpand - ? "bodyText" - : '', - bold: isAssessmentExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .assessment + .toUpperCase(), + variant: + isAssessmentExpand + ? "bodyText" + : '', + bold: isAssessmentExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isAssessmentExpand = + !isAssessmentExpand; + }); + }, + child: Icon(isAssessmentExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - 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( + 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: [ - AppText( - 'ICD', - fontWeight: - FontWeight.w700, + 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(), + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstAssessments[ - index] - .iCD10 - .trim(), + Row( + children: [ + AppText( + model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstAssessments[ + index] + .description, + fontWeight: + FontWeight + .w700, + ) + ], ), - SizedBox(width: 35.0), - AppText( - 'Condition: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + AppText( + 'Type: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstAssessments[ + index] + .type), + ], + ), + SizedBox( + height: 15.0, ), AppText( model @@ -471,87 +579,34 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstAssessments[ index] - .condition + .remarks .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, + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .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, - ), - ], - ), - ), - ); - }), - isExpand: isAssessmentExpand, + ), + ); + }), + isExpand: isAssessmentExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -564,90 +619,181 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .test - .toUpperCase(), - variant: isProcedureExpand - ? "bodyText" - : '', - bold: isProcedureExpand - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .test + .toUpperCase(), + variant: isProcedureExpand + ? "bodyText" + : '', + bold: isProcedureExpand + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isProcedureExpand = + !isProcedureExpand; + }); + }, + child: Icon(isProcedureExpand + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - 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( + 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: [ - AppText( - 'Procedure ID: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Column( + 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), + Column( + children: [ + AppText( + 'Order Date: ', + fontWeight: + FontWeight + .w700, + ), + AppText( + Helpers.getDateFormatted( + DateTime + .parse( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .orderDate + .trim(), + )), + fontSize: + 13.5, + ), + ], + ), + ], ), - AppText( - model - .medicalFileList[ - 0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstProcedure[ - index] - .procedureId - .trim(), + SizedBox( + height: 20.0, ), - SizedBox(width: 35.0), - AppText( - 'Order Date: ', - fontWeight: - FontWeight.w700, + Row( + children: [ + Expanded( + child: AppText( + model + .medicalFileList[ + 0] + .entityList[ + 0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstProcedure[ + index] + .procName, + fontWeight: + FontWeight + .w700, + ), + ) + ], ), - Expanded( - child: AppText( - model + Row( + children: [ + AppText( + 'CPT Code : ', + fontWeight: + FontWeight + .w700, + ), + AppText(model .medicalFileList[ 0] .entityList[0] @@ -658,79 +804,38 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstProcedure[ index] - .orderDate - .trim(), - ), + .patientID + .toString()), + ], ), - ], - ), - 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, + SizedBox( + height: 15.0, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - 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, + ), + ); + }), + isExpand: isProcedureExpand, + ), + ), ), - SizedBox( - height: 30, - ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // SizedBox( + // height: 30, + // ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), SizedBox( height: 30, ), @@ -743,79 +848,144 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - HeaderBodyExpandableNotifier( - headerWidget: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Row( + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], + width: 0.5), + ), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: HeaderBodyExpandableNotifier( + headerWidget: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - Texts( - TranslationBase.of(context) - .physicalSystemExamination - .toUpperCase(), - variant: isPhysicalExam - ? "bodyText" - : '', - bold: isPhysicalExam - ? true - : false, - color: Colors.black), + Row( + children: [ + Texts( + TranslationBase.of( + context) + .physicalSystemExamination + .toUpperCase(), + variant: isPhysicalExam + ? "bodyText" + : '', + bold: isPhysicalExam + ? true + : true, + color: Colors.black), + ], + ), + InkWell( + onTap: () { + setState(() { + isPhysicalExam = + !isPhysicalExam; + }); + }, + child: Icon(isPhysicalExam + ? EvaIcons.arrowUp + : EvaIcons.arrowDown)) ], ), - 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( + 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: [ - AppText( - 'Exam Type: ', - fontWeight: - FontWeight.w700, + 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] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[ + 0] + .lstPhysicalExam[ + index] + .examDesc, + fontWeight: + FontWeight + .w700, + ) + ], + ), + Row( + children: [ + AppText( + 'Abnormal: ', + fontWeight: + FontWeight + .w700, + ), + AppText(model + .medicalFileList[ + 0] + .entityList[0] + .timelines[ + encounterNumber] + .timeLineEvents[ + 0] + .consulations[0] + .lstPhysicalExam[ + index] + .abnormal), + ], + ), + SizedBox( + height: 15.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .consulations[0] - .lstPhysicalExam[ - index] - .examDesc), - ], - ), - Row( - children: [ AppText( model .medicalFileList[ @@ -827,69 +997,33 @@ class _MedicalFileDetailsState extends State { .consulations[0] .lstPhysicalExam[ index] - .examDesc, - fontWeight: - FontWeight.w700, - ) - ], - ), - Row( - children: [ - AppText( - 'Abnormal: ', - fontWeight: - FontWeight.w700, + .remarks, + ), + Divider( + height: 1, + color: Colors.grey, + thickness: 1.0, + ), + SizedBox( + height: 8.0, ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[ - encounterNumber] - .timeLineEvents[0] - .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, - ), - ], - ), - ), - ); - }), - isExpand: isPhysicalExam, + ), + ); + }), + isExpand: isPhysicalExam, + ), + ), ), SizedBox( height: 30, ), - Container( - width: double.infinity, - height: 1, - color: Color(0xffCCCCCC), - ), + // Container( + // width: double.infinity, + // height: 1, + // color: Color(0xffCCCCCC), + // ), ], ), ), diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index 79f7416f..b0901e0a 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -1,14 +1,20 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/medical_file_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/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/medical-file/medical_file_details.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.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/network_base_view.dart'; import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; class MedicalFilePage extends StatefulWidget { @override @@ -20,6 +26,10 @@ class _MedicalFilePageState extends State { @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; + patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; + patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), @@ -32,19 +42,91 @@ class _MedicalFilePageState extends State { baseViewModel: model, child: SingleChildScrollView( child: Container( - color: Colors.white, child: Column( // mainAxisAlignment: model.medicalFileList.length != 0 && // model.medicalFileList != null // ? MainAxisAlignment.start // : MainAxisAlignment.center, children: [ - PatientPageHeaderWidget(patient), + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize(patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + ]), Divider( height: 1.0, thickness: 1.0, color: Colors.grey, ), + Padding( + padding: + EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), + child: Container( + child: Column( + children: [ + Row( + children: [ + AppText( + 'Medical', + fontSize: 15.0, + fontWeight: FontWeight.normal, + ), + ], + ), + Row( + children: [ + AppText( + 'Report', + fontSize: 35.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), + ), + ), (model.medicalFileList != null && model.medicalFileList.length != 0) ? ListView.builder( @@ -60,66 +142,208 @@ class _MedicalFilePageState extends State { horizontal: 12.0, vertical: 8.0), child: InkWell( child: Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), child: Column( children: [ Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ - AppText( - TranslationBase.of(context).branch + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .doctorName, + fontWeight: FontWeight.w700, + fontSize: 17.0, + fontFamily: 'Poppins', + ) + ], ), - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .projectName), + Row( + children: [ + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .day + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate(model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .month + .toString() + + "/", + ), + AppText( + Helpers.convertStringToDate( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .date) + .year + .toString(), + ), + ], + ) ], ), Row( + mainAxisAlignment: + MainAxisAlignment.start, children: [ - AppText( - TranslationBase.of(context) - .doctorName - .toUpperCase() + - ": ", - fontWeight: FontWeight.w700, - ), - Expanded( - child: AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .doctorName, - fontWeight: FontWeight.w700, + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + ClipRRect( + borderRadius: + BorderRadius.all( + Radius.circular(30)), + child: Image.network( + 'https://media.istockphoto.com/photos/portrait-senior-asian-doctor-over-radiography-background-asian-picture-id1019862020?k=6&m=1019862020&s=612x612&w=0&h=40frRnNnEGhNv5XRcDMRn55bIxCC3oXzbO6pOSQL_sQ=', + fit: BoxFit.cover, + width: 60, + height: 70, + ), + ), + ], ), ), + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .clinicName, + fontWeight: FontWeight.w600, + ), + ], + ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + TranslationBase.of(context) + .branch + + ": ", + ), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[index] + .projectName, + fontWeight: FontWeight.w600, + ), + ], + ), + ], + ), ], ), Row( + mainAxisAlignment: + MainAxisAlignment.end, children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, - ), - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[index] - .clinicName, - ), + Column( + children: [ + Icon( + Icons.remove_red_eye, + size: 30.0, + ) + ], + ) ], ), - SizedBox(height: 10.0), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey.shade400, - ) + // Row( + // children: [ + // Expanded( + // child: AppText( + // model + // .medicalFileList[0] + // .entityList[0] + // .timelines[index] + // .doctorName, + // fontWeight: FontWeight.w700, + // fontSize: 18.0, + // fontFamily: 'Poppins', + // ), + // ), + // ], + // ), + // 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) + // .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, + // ) ], ), ), diff --git a/pubspec.lock b/pubspec.lock index ca18664d..e15e02c9 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -566,7 +566,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.2" + version: "0.6.3-nullsafety.1" json_annotation: dependency: transitive description: @@ -608,7 +608,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.3" + version: "1.3.0-nullsafety.4" mime: dependency: transitive description: @@ -900,7 +900,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.1" + version: "1.10.0-nullsafety.2" stream_channel: dependency: transitive description: @@ -1084,5 +1084,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <2.11.0" + dart: ">=2.10.0 <=2.11.0-213.1.beta" flutter: ">=1.22.0 <2.0.0" From 61a0e42afae899c6402620d59be97f480f73d9d8 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 09:56:26 +0300 Subject: [PATCH 403/421] paient and referral screens new design --- .../profile/patient_profile_screen.dart | 345 +---------------- .../patient-referral-item-widget.dart | 179 ++++++--- .../patient-profile-header-new-design.dart | 351 ++++++++++++++++++ 3 files changed, 476 insertions(+), 399 deletions(-) create mode 100644 lib/widgets/patients/profile/patient-profile-header-new-design.dart diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index ef566b9f..68519d73 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -1,42 +1,27 @@ -import 'package:doctor_app_flutter/config/config.dart'; -import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; -import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/SOAP/GeneralGetReqForSOAP.dart'; import 'package:doctor_app_flutter/models/SOAP/PostEpisodeReqModel.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/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.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/borderedButton.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; import '../../../routes.dart'; -/* - *@author: Elham Rababah - *@Date:22/4/2020 - *@param: - *@return:PatientProfileWidget - *@desc: Patient Profile Widget - */ // ignore: must_be_immutable class PatientProfileScreen extends StatelessWidget { PatiantInformtion patient; bool isFromSearch = false; - //TODO change it @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; @@ -77,297 +62,7 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - padding: EdgeInsets.only( - left: 0, right: 5, bottom: 5, top: 5), - decoration: BoxDecoration( - color: Colors.white, - ), - height: 220, - child: Container( - padding: EdgeInsets.only( - left: 10, right: 10, bottom: 10), - margin: EdgeInsets.only(top: 50), - child: Column( - children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - AppText( - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize( - patient.lastName)), - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - patient.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SERVICES_PATIANT2[ - int.parse(patientType)] == - "patientArrivalList" - ? Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - patient.patientStatusType == - 43 - ? AppText( - TranslationBase.of( - context) - .arrivedP, - color: Colors.green, - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ) - : AppText( - TranslationBase.of( - context) - .notArrived, - color: - Colors.red[800], - fontWeight: - FontWeight.bold, - fontFamily: - 'Poppins', - fontSize: 12, - ), - arrivalType == '1' - ? AppText( - patient.startTime != - null - ? patient - .startTime - : '', - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - : AppText( - DateUtils.convertStringToDateFormat( - patient - .arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: - 'Poppins', - fontWeight: - FontWeight.w600, - ) - ], - )) - : SizedBox(), - if (SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient") - Container( - child: Row( - mainAxisAlignment: - MainAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .appointmentDate + - " : ", - fontSize: 14, - ), - patient.startTime != null - ? Container( - height: 15, - width: 60, - decoration: - BoxDecoration( - borderRadius: - BorderRadius - .circular( - 25), - color: HexColor( - "#20A169"), - ), - child: AppText( - patient.startTime, - color: Colors.white, - fontSize: 1.5 * - SizeConfig - .textMultiplier, - textAlign: TextAlign - .center, - fontWeight: - FontWeight.bold, - ), - ) - : SizedBox(), - SizedBox( - width: 3.5, - ), - Container( - child: AppText( - convertDateFormat2(patient - .appointmentDate - .toString()), - fontSize: 1.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold, - ), - ), - SizedBox( - height: 0.5, - ) - ], - ), - margin: EdgeInsets.only( - top: 8, - ), - ), - Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - RichText( - text: TextSpan( - style: TextStyle( - fontSize: 1.6 * - SizeConfig - .textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: - TranslationBase.of( - context) - .fileNumber, - style: TextStyle( - fontSize: 12, - fontFamily: - 'Poppins')), - new TextSpan( - text: patient.patientId - .toString(), - style: TextStyle( - fontWeight: - FontWeight.w700, - fontFamily: - 'Poppins', - fontSize: 14)), - ], - ), - ), - Row( - children: [ - AppText( - patient.nationalityName ?? - patient.nationality, - fontWeight: FontWeight.bold, - fontSize: 12, - ), - patient.nationality != null - ? ClipRRect( - borderRadius: - BorderRadius - .circular( - 20.0), - child: Image.network( - patient - .nationalityFlagURL, - height: 25, - width: 30, - errorBuilder: - (BuildContext - context, - Object - exception, - StackTrace - stackTrace) { - return Text( - 'No Image'); - }, - )) - : SizedBox() - ], - ) - ], - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 1.6 * - SizeConfig.textMultiplier, - color: Colors.black, - fontFamily: 'Poppins', - ), - children: [ - new TextSpan( - text: TranslationBase.of( - context) - .age + - " : ", - style: TextStyle( - fontSize: 14)), - new TextSpan( - text: - "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", - style: TextStyle( - fontWeight: - FontWeight.w700, - fontSize: 14)), - ], - ), - ), - ), - ], - ), - ), - ]), - ], - ), - ), - ), + PatientProfileHeaderNewDesign(patient, patientType, arrivalType), Expanded( child: Padding( padding: const EdgeInsets.all(16.0), @@ -495,42 +190,6 @@ class AvatarWidget extends StatelessWidget { } } -convertDateFormat2(String str) { - String timeConvert; - const start = "/Date("; - const end = "+0300)"; - - final startIndex = str.indexOf(start); - final endIndex = str.indexOf(end, startIndex + start.length); - - var date = new DateTime.fromMillisecondsSinceEpoch( - int.parse(str.substring(startIndex + start.length, endIndex))); - String newDate = date.year.toString() + - "/" + - date.month.toString().padLeft(2, '0') + - "/" + - date.day.toString().padLeft(2, '0'); - - return newDate.toString(); -} - -isToday(date) { - DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); - return DateFormat("yyyy-MM-dd").format(tempDate) == - DateFormat("yyyy-MM-dd").format(DateTime.now()); -} - -myBoxDecoration() { - return BoxDecoration( - border: Border( - top: BorderSide( - color: Colors.green, - width: 5, - ), - ), - borderRadius: BorderRadius.circular(10)); -} - /* Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index d5c1d035..6e9008e7 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/PendingReferral.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -262,9 +263,11 @@ class PatientReferralItemWidget extends StatelessWidget { // ), Container( child: CardWithBgWidget( - bgColor: referralStatus != null ? referralStatus == 'Pending' - ? Colors.orange[400] - : Colors.red[800] : Colors.grey[500], + bgColor: referralStatus != null + ? referralStatus == 'Pending' + ? Color(0xffc4aa54) + : Colors.red[800] + : Colors.grey[500], hasBorder: false, widget: Container( // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), @@ -272,7 +275,6 @@ class PatientReferralItemWidget extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ @@ -283,76 +285,141 @@ class PatientReferralItemWidget extends StatelessWidget { color: Colors.black), children: [ new TextSpan( - text: referralStatus != null ? referralStatus : "", + text: referralStatus != null + ? referralStatus + : "", style: TextStyle( - color: referralStatus != null ? referralStatus == 'Pending' - ? Colors.orange[400] - : Colors.red[800] : Colors.grey[500], + color: referralStatus != null + ? referralStatus == 'Pending' + ? Color(0xffc4aa54) + : referralStatus == 'Accepted' + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], fontWeight: FontWeight.w700, fontFamily: 'Poppins', - fontSize: 18)), + fontSize: 2.0 * SizeConfig.textMultiplier)), ], ), ), - //TODO :ask backend to return in the standerformate + //TODO :ask backend to return in the standard format AppText( referredOn, fontFamily: 'Poppins', fontWeight: FontWeight.w600, + fontSize: 2.1 * SizeConfig.textMultiplier, ) ], ), - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Row( + children: [ + AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + SizedBox( + width: 4, + ), + /*patient.gender*/1 == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], ), SizedBox( width: 10, ), - RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).fileNumber, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: patientInfo.patientID.toString(), - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), - ], - ), - ), - Container( - child: RichText( - text: new TextSpan( - style: new TextStyle( - fontSize: 2.0 * SizeConfig.textMultiplier, - color: Colors.black), - children: [ - new TextSpan( - text: TranslationBase.of(context).referredFrom, - style: TextStyle( - fontSize: 14, fontFamily: 'Poppins')), - new TextSpan( - text: isSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context).otherBranch, - style: TextStyle( - fontWeight: FontWeight.w700, - fontFamily: 'Poppins', - fontSize: 15)), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Column( + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: patientInfo.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).referredFrom, + style: TextStyle( + fontSize: 14, fontFamily: 'Poppins')), + new TextSpan( + text: isSameBranch + ? TranslationBase.of(context).sameBranch + : TranslationBase.of(context).otherBranch, + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), + ], + ), + ), + ), ], ), - ), + Row( + children: [ + AppText( + /*patient.nationalityName ?? + patient.nationality*/ "Saudi", + fontWeight: FontWeight.bold, + fontSize: 12, + ), + /* patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + ))*/ + /*:*/ SizedBox() + ], + ) + ], ), Container( child: RichText( @@ -405,7 +472,7 @@ class PatientReferralItemWidget extends StatelessWidget { ], ), Container( - width: double.infinity, + width: double.infinity, alignment: Alignment.centerRight, child: Icon(FontAwesomeIcons.arrowRight, size: 25, color: Colors.black)) diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart new file mode 100644 index 00000000..5979b8e1 --- /dev/null +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -0,0 +1,351 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.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/util/date-utils.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; + +class PatientProfileHeaderNewDesign extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + + PatientProfileHeaderNewDesign(this.patient, this.patientType, this.arrivalType); + + @override + Widget build(BuildContext context) { + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 220, + child: Container( + padding: EdgeInsets.only( + left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} From c97b395810377d3f161d65a2408ac4088bb10547 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 10:05:39 +0300 Subject: [PATCH 404/421] send patient type to patient profile cards --- .../profile/patient_profile_screen.dart | 5 +- .../profile/PatientProfileButton.dart | 62 ++++++++++++------- .../profile/profile_medical_info_widget.dart | 46 ++++++++++++-- .../profile_medical_info_widget_search.dart | 28 ++++++++- 4 files changed, 110 insertions(+), 31 deletions(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 68519d73..85c93e2f 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -62,7 +62,8 @@ class PatientProfileScreen extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientProfileHeaderNewDesign(patient, patientType, arrivalType), + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), Expanded( child: Padding( padding: const EdgeInsets.all(16.0), @@ -73,12 +74,14 @@ class PatientProfileScreen extends StatelessWidget { ? ProfileMedicalInfoWidgetSearch( patient: patient, patientType: patientType, + arrivalType: arrivalType, from: from, to: to, ) : ProfileMedicalInfoWidget( patient: patient, patientType: patientType, + arrivalType: arrivalType, from: from, to: to, ), diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index ad0a7bd7..1622df90 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -11,6 +11,8 @@ class PatientProfileButton extends StatelessWidget { final String icon; final dynamic route; final PatiantInformtion patient; + final String patientType; + final String arrivalType; String from; String to; final String url = "assets/images/"; @@ -20,16 +22,18 @@ class PatientProfileButton extends StatelessWidget { PatientProfileButton( {Key key, - this.patient, - this.nameLine1, - this.nameLine2, - this.icon, - this.route, - this.isDisable = false, - this.onTap, - this.isLoading = false, - this.from, - this.to}) + this.patient, + this.patientType, + this.arrivalType, + this.nameLine1, + this.nameLine2, + this.icon, + this.route, + this.isDisable = false, + this.onTap, + this.isLoading = false, + this.from, + this.to}) : super(key: key); @override @@ -41,19 +45,23 @@ class PatientProfileButton extends StatelessWidget { onTap: isDisable ? null : onTap != null - ? onTap - : () { - navigator(context, this.route); - }, + ? onTap + : () { + navigator(context, this.route); + }, child: Column(children: [ Container( child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Container( - child: new Image.asset(url + icon, width: 50, height: 50,)) - ], - )), + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: new Image.asset( + url + icon, + width: 50, + height: 50, + )) + ], + )), Container( alignment: Alignment.topLeft, padding: EdgeInsets.all(5), @@ -62,7 +70,8 @@ class PatientProfileButton extends StatelessWidget { children: [ AppText( this.nameLine1, - color: Colors.black, /*Color(0xFFB9382C),*/ + color: Colors.black, + /*Color(0xFFB9382C),*/ fontWeight: FontWeight.w600, textAlign: TextAlign.left, fontSize: SizeConfig.textMultiplier * 1.5, @@ -107,7 +116,12 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } - Navigator.of(context).pushNamed(route, - arguments: {'patient': patient, 'from': from, 'to': to}); + Navigator.of(context).pushNamed(route, arguments: { + 'patient': patient, + 'from': from, + 'to': to, + 'patient-type': patientType, + 'arrival-type': arrivalType + }); } -} \ No newline at end of file +} diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d5a87f60..ade70b47 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -17,13 +17,19 @@ import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; class ProfileMedicalInfoWidget extends StatelessWidget { - String from; - String to; - PatiantInformtion patient; - String patientType; + final String from; + final String to; + final PatiantInformtion patient; + final String patientType; + final String arrivalType; ProfileMedicalInfoWidget( - {Key key, this.patient, this.patientType, this.from, this.to}); + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to}); @override Widget build(BuildContext context) { @@ -69,6 +75,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, from: from, to: to, nameLine1: TranslationBase.of(context).vital, @@ -79,6 +87,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, @@ -86,6 +96,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, @@ -96,6 +108,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, @@ -104,6 +118,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, @@ -112,6 +128,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -119,6 +137,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { : PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_HISTORY, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -126,6 +146,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -134,6 +156,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PROCEDURE, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).procedures, @@ -142,6 +166,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: REFER_PATIENT_TO_DOCTOR, nameLine1: TranslationBase.of(context).myReferral, nameLine2: TranslationBase.of(context).patient, @@ -150,6 +176,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ADD_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, @@ -158,6 +186,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_UCAF_REQUEST, nameLine1: TranslationBase.of(context).patient, nameLine2: TranslationBase.of(context).ucaf, @@ -166,6 +196,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -174,6 +206,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, @@ -181,6 +215,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", 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 704ced0d..c49c4576 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget_search.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget_search.dart @@ -12,9 +12,15 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { final String to; final PatiantInformtion patient; final String patientType; + final String arrivalType; ProfileMedicalInfoWidgetSearch( - {Key key, this.patient, this.patientType, this.from, this.to}); + {Key key, + this.patient, + this.patientType, + this.arrivalType, + this.from, + this.to}); @override Widget build(BuildContext context) { @@ -31,6 +37,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: RADIOLOGY_PATIENT, nameLine1: TranslationBase.of(context).radiology, nameLine2: TranslationBase.of(context).service, @@ -38,6 +46,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_INSURANCE_APPROVALS_NEW, nameLine1: TranslationBase.of(context).insurance, nameLine2: TranslationBase.of(context).service, @@ -45,6 +55,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: LAB_RESULT, nameLine1: TranslationBase.of(context).lab, nameLine2: TranslationBase.of(context).result, @@ -52,6 +64,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, from: from, to: to, nameLine1: TranslationBase.of(context).vital, @@ -69,6 +83,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { ? PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -76,6 +92,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { : PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: ORDER_PRESCRIPTION_NEW, nameLine1: TranslationBase.of(context).orders, nameLine2: TranslationBase.of(context).prescription, @@ -83,6 +101,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: MEDICAL_FILE, nameLine1: TranslationBase.of(context).previewHealth, nameLine2: TranslationBase.of(context).summaryReport, @@ -90,6 +110,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PATIENT_ECG, nameLine1: TranslationBase.of(context).patient, nameLine2: "ECG", @@ -97,6 +119,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: SHOW_SICKLEAVE, nameLine1: TranslationBase.of(context).patientSick, nameLine2: TranslationBase.of(context).leave, @@ -104,6 +128,8 @@ class ProfileMedicalInfoWidgetSearch extends StatelessWidget { PatientProfileButton( key: key, patient: patient, + patientType: patientType, + arrivalType: arrivalType, route: PROGRESS_NOTE, nameLine1: TranslationBase.of(context).progress, nameLine2: TranslationBase.of(context).note, From ebb130af09af5ec419a4f938442d8f378eb8ac8a Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Mar 2021 10:42:46 +0300 Subject: [PATCH 405/421] Medical Report New Design --- .../medical-file/medical_file_details.dart | 251 ++++++++++-------- .../medical-file/medical_file_page.dart | 116 +++----- 2 files changed, 173 insertions(+), 194 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 64e4405b..63006f65 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -140,134 +140,155 @@ class _MedicalFileDetailsState extends State { child: Container( child: Column( children: [ - Row( - children: [ - AppText( - TranslationBase.of(context).visitDate + - ": ", - fontWeight: FontWeight.w700, + Container( + width: double.infinity, + margin: EdgeInsets.only( + top: 10, left: 10, right: 10), + padding: EdgeInsets.all(8.0), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(10.0), ), - 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[0] - .doctorName - .toUpperCase(), - fontWeight: FontWeight.w700, - ), - ), - ], - ), - if (model.medicalFileList.length != 0) - Row( + border: Border.all( + color: Colors.grey[200], width: 0.5), + ), + child: Column( children: [ - AppText( - TranslationBase.of(context) - .clinicName + - ": ", - fontWeight: FontWeight.w700, + Row( + children: [ + 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[0] + .doctorName + .toUpperCase(), + fontWeight: FontWeight.w700, + ), + ), + ], ), - if (model.medicalFileList.length != 0 && - model + if (model.medicalFileList.length != 0) + Row( + children: [ + AppText( + TranslationBase.of(context) + .clinic + + ": ", + 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] + .clinicName, + ), + ], + ), + 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 - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .clinicName, - ), - ], - ), - Row( - children: [ - AppText( - TranslationBase.of(context).episode + - ": ", - fontWeight: FontWeight.w700, - ), - if (model.medicalFileList.length != 0 && - model + .consulations[0] + .episodeID + .toString(), + ), + ], + ), + 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 - .length != - 0) - AppText( - model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .episodeID - .toString(), + .consulations[0] + .appointmentDate + .toString()), + SizedBox(width: 35.0), + // AppText( + // 'Appt Date : ', + // fontWeight: FontWeight.w700, + // ), + // AppText( + // '23/12/2020', + // ), + ], ), - ], - ), - 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 diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index b0901e0a..ae50e9a2 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -103,27 +103,31 @@ class _MedicalFilePageState extends State { padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), child: Container( - child: Column( - children: [ - Row( - children: [ - AppText( - 'Medical', - fontSize: 15.0, - fontWeight: FontWeight.normal, - ), - ], - ), - Row( - children: [ - AppText( - 'Report', - fontSize: 35.0, - fontWeight: FontWeight.w700, - ), - ], - ), - ], + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + children: [ + Row( + children: [ + AppText( + 'Medical', + fontSize: 13.0, + fontWeight: FontWeight.w600, + fontFamily: 'Poppins', + ), + ], + ), + Row( + children: [ + AppText( + 'Report', + fontSize: 30.0, + fontWeight: FontWeight.w700, + ), + ], + ), + ], + ), ), ), ), @@ -223,7 +227,7 @@ class _MedicalFilePageState extends State { BorderRadius.all( Radius.circular(30)), child: Image.network( - 'https://media.istockphoto.com/photos/portrait-senior-asian-doctor-over-radiography-background-asian-picture-id1019862020?k=6&m=1019862020&s=612x612&w=0&h=40frRnNnEGhNv5XRcDMRn55bIxCC3oXzbO6pOSQL_sQ=', + 'https://previews.123rf.com/images/yupiramos/yupiramos1705/yupiramos170524444/78443570-a-female-doctor-avatar-character-vector-illustration-design.jpg', fit: BoxFit.cover, width: 60, height: 70, @@ -291,59 +295,6 @@ class _MedicalFilePageState extends State { ) ], ), - // Row( - // children: [ - // Expanded( - // child: AppText( - // model - // .medicalFileList[0] - // .entityList[0] - // .timelines[index] - // .doctorName, - // fontWeight: FontWeight.w700, - // fontSize: 18.0, - // fontFamily: 'Poppins', - // ), - // ), - // ], - // ), - // 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) - // .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, - // ) ], ), ), @@ -365,10 +316,17 @@ class _MedicalFilePageState extends State { ), ); }) - : Container( - child: AppText( - 'THERES NO MEDICAL FILE FOR THIS Patient', - ), + : Column( + children: [ + Container( + child: AppText( + 'THERES NO MEDICAL FILE FOR THIS Patient', + ), + ), + SizedBox( + height: 400, + ) + ], ) ], ), From 8237270e7345324fb2732be01b3d3db04ed2711e Mon Sep 17 00:00:00 2001 From: mosazaid Date: Mon, 29 Mar 2021 11:40:22 +0300 Subject: [PATCH 406/421] fix navigation problem to patient profile cards --- lib/config/config.dart | 4 ++-- .../profile/vital_sign/vital_sign_details_screen.dart | 2 ++ lib/widgets/patients/profile/PatientProfileButton.dart | 9 ++++++--- .../patients/profile/profile_medical_info_widget.dart | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f615af5..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 45cd8d14..2b4877e8 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -24,6 +24,8 @@ class VitalSignDetailsScreen extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; String from = routeArgs['from']; String to = routeArgs['to']; String imageBasePath = 'assets/images/'; diff --git a/lib/widgets/patients/profile/PatientProfileButton.dart b/lib/widgets/patients/profile/PatientProfileButton.dart index 1622df90..ebac98b5 100644 --- a/lib/widgets/patients/profile/PatientProfileButton.dart +++ b/lib/widgets/patients/profile/PatientProfileButton.dart @@ -12,7 +12,7 @@ class PatientProfileButton extends StatelessWidget { final dynamic route; final PatiantInformtion patient; final String patientType; - final String arrivalType; + String arrivalType; String from; String to; final String url = "assets/images/"; @@ -116,12 +116,15 @@ class PatientProfileButton extends StatelessWidget { if (to == null) { to = DateUtils.convertDateToFormat(DateTime.now(), 'yyyy-MM-dd'); } + if(arrivalType == null){ + arrivalType = "0"; + } Navigator.of(context).pushNamed(route, arguments: { 'patient': patient, 'from': from, 'to': to, - 'patient-type': patientType, - 'arrival-type': arrivalType + 'patientType': patientType, + 'arrivalType': arrivalType }); } } diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index ade70b47..b5afa0af 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -120,7 +120,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { patient: patient, patientType: patientType, arrivalType: arrivalType, - route: PATIENT_INSURANCE_APPROVALS_NEW, + route: PATIENT_ADMISSION_REQUEST, nameLine1: TranslationBase.of(context).admission, nameLine2: TranslationBase.of(context).request, icon: 'patient/admission_req.png'), From 019553ba51a4d7138edffa3eb72f407ec6b9a326 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 12:16:43 +0300 Subject: [PATCH 407/421] new design for ESG service --- lib/config/config.dart | 4 +- lib/screens/patients/ECGPage.dart | 94 ++++++++++++++++++--- lib/util/date-utils.dart | 13 +++ lib/widgets/shared/Text.dart | 2 +- lib/widgets/shared/app_scaffold_widget.dart | 6 +- 5 files changed, 102 insertions(+), 17 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 0f615af5..3a72faba 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index ba76c031..69be86e9 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,7 +1,10 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; 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/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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'; @@ -13,7 +16,8 @@ class ECGPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -21,28 +25,96 @@ class ECGPage extends StatelessWidget { patientID: patient.patientId), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: 'ECG', - body: ListView.builder( - itemCount: model.patientMuseResultsModelList.length, - itemBuilder: (context, index) => InkWell( + isShowAppBar: false, + backgroundColor: Color(0xffF8F8F8), + body: SingleChildScrollView( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Texts('Service',style: "caption2",color: Colors.black,), + Texts('ECG',bold: true,fontSize: 22,), + SizedBox(height: 12,), + ...List.generate(model.patientMuseResultsModelList.length, (index) => InkWell( onTap: () async { await launch( model.patientMuseResultsModelList[index].imageURL); }, child: Container( width: double.infinity, - margin: EdgeInsets.all(5), + height: 90, + margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( - border: Border.all(color: Colors.grey,width: 2) + border: Border.all(color: Colors.white,width: 2), + color: Colors.white, + borderRadius: BorderRadius.circular(8) ), - child: Center( - child: Texts( - "${model.patientMuseResultsModelList[index].createdOnDateTime}"), + child: Column( + children: [ + Row( + // mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('ECG Report',bold: true,fontSize: 14,), + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of(context).orderNo, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ) + ], + ), + ), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + ], + ), + ), + ], + ), + Align( + alignment: Alignment.topRight, + child: Icon(Icons.arrow_circle_up_rounded), + ) + ], ), ), )), + + ], + ), + ), + ), ), ); } diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 51089567..253b0f55 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -267,6 +267,19 @@ class DateUtils { return ""; } + /// get data formatted like Apr 26,2020 + /// [dateTime] convert DateTime to data formatted + static String getHour(DateTime dateTime) { + // if (dateTime != null) + // return getMonth(dateTime.hour) + + // " " + + // dateTime.day.toString() + + // ", " + + // dateTime.year.toString(); + // else + return DateFormat('hh:mm a').format(dateTime); + } + static String getAgeByBirthday(dynamic birthday, BuildContext context) { // https://leechy.dev/calculate-dates-diff-in-dart DateTime birthDate = DateUtils.getDateTimeFromServerFormat(birthday); diff --git a/lib/widgets/shared/Text.dart b/lib/widgets/shared/Text.dart index 4f2c4271..59929075 100644 --- a/lib/widgets/shared/Text.dart +++ b/lib/widgets/shared/Text.dart @@ -216,7 +216,7 @@ class _TextsState extends State { fontSize:widget.fontSize?? _getFontSize(), letterSpacing: widget.variant == "overline" ? 1.5 : null, - fontWeight: _getFontWeight(), + fontWeight: widget.fontWeight ?? _getFontWeight(), decoration: widget.textDecoration //TextDecoration.lineThrough )), diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 9842bbed..37dfda14 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -18,12 +18,13 @@ class AppScaffold extends StatelessWidget { final bool isShowAppBar; final BaseViewModel baseViewModel; final Widget bottomSheet; + final Color backgroundColor; AppScaffold( {this.appBarTitle = '', this.body, this.isLoading = false, this.isShowAppBar = true, - this.baseViewModel, this.bottomSheet}); + this.baseViewModel, this.bottomSheet, this.backgroundColor}); @override Widget build(BuildContext context) { @@ -34,7 +35,7 @@ class AppScaffold extends StatelessWidget { FocusScope.of(context).requestFocus(new FocusNode()); }, child: Scaffold( - backgroundColor: Colors.white, + backgroundColor: backgroundColor??Colors.white, appBar: isShowAppBar ? AppBar( elevation: 0, @@ -59,7 +60,6 @@ class AppScaffold extends StatelessWidget { ], ) : null, - bottomSheet: bottomSheet, body: projectProvider.isInternetConnection ? baseViewModel != null From f0c65bb70be104730ba13bbb7b14d7c8f5eba385 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 12:38:40 +0300 Subject: [PATCH 408/421] change color and font for ESG service --- lib/screens/patients/ECGPage.dart | 20 ++++++++++++-------- lib/util/date-utils.dart | 26 ++++++++++++++++---------- 2 files changed, 28 insertions(+), 18 deletions(-) diff --git a/lib/screens/patients/ECGPage.dart b/lib/screens/patients/ECGPage.dart index 69be86e9..ffb12ee1 100644 --- a/lib/screens/patients/ECGPage.dart +++ b/lib/screens/patients/ECGPage.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/viewModel/PatientMuseViewModel.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; @@ -9,6 +10,7 @@ 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:provider/provider.dart'; import 'package:url_launcher/url_launcher.dart'; class ECGPage extends StatelessWidget { @@ -18,6 +20,7 @@ class ECGPage extends StatelessWidget { PatiantInformtion patient = routeArgs['patient']; String patientType = routeArgs['patient-type']; String arrivalType = routeArgs['arrival-type']; + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getECGPatient( patientType: patient.patientType, @@ -34,7 +37,7 @@ class ECGPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), - SizedBox(height: 12,), + SizedBox(height: 12,), Texts('Service',style: "caption2",color: Colors.black,), Texts('ECG',bold: true,fontSize: 22,), SizedBox(height: 12,), @@ -45,7 +48,7 @@ class ECGPage extends StatelessWidget { }, child: Container( width: double.infinity, - height: 90, + height: 110, margin: EdgeInsets.only(top: 5,bottom: 5), padding: EdgeInsets.all(10), decoration: BoxDecoration( @@ -62,7 +65,8 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Texts('ECG Report',bold: true,fontSize: 14,), + Texts('ECG Report',fontWeight: FontWeight.w700,fontSize: 17,), + SizedBox(height:3), RichText( text: TextSpan( style: TextStyle( @@ -78,10 +82,9 @@ class ECGPage extends StatelessWidget { fontFamily: 'Poppins')), new TextSpan( - text: '${model.patientMuseResultsModelList[index].orderNo?? ''}', + text: '${/*model.patientMuseResultsModelList[index].orderNo?? */'3455'}', style: TextStyle( - fontWeight: - FontWeight.w700, + fontWeight: FontWeight.w600, fontFamily: 'Poppins', fontSize: 14)), @@ -95,13 +98,14 @@ class ECGPage extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.end, children: [ - Texts('${DateUtils.getMonthDayYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime)}',color: Colors.black,), - Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',), + Texts('${DateUtils.getDayMonthYearDateFormatted(model.patientMuseResultsModelList[index].createdOnDateTime,isArabic: projectViewModel.isArabic)}',color: Colors.black,fontWeight: FontWeight.w600,fontSize: 14,), + Texts('${DateUtils.getHour(model.patientMuseResultsModelList[index].createdOnDateTime)}',fontWeight: FontWeight.w600,color: Colors.grey[700],fontSize: 14,), ], ), ), ], ), + SizedBox(height: 15,), Align( alignment: Alignment.topRight, child: Icon(Icons.arrow_circle_up_rounded), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 253b0f55..4c11e43b 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -256,9 +256,9 @@ class DateUtils { /// get data formatted like Apr 26,2020 /// [dateTime] convert DateTime to data formatted - static String getMonthDayYearDateFormatted(DateTime dateTime) { + static String getMonthDayYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return getMonth(dateTime.month) + + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + " " + dateTime.day.toString() + ", " + @@ -267,16 +267,22 @@ class DateUtils { return ""; } - /// get data formatted like Apr 26,2020 + /// get data formatted like 26 Apr 2020 + /// [dateTime] convert DateTime to data formatted + static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { + if (dateTime != null) + return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + + " " + + dateTime.day.toString() + + " " + + dateTime.year.toString(); + else + return ""; + } + + /// get data formatted like 10:45 PM /// [dateTime] convert DateTime to data formatted static String getHour(DateTime dateTime) { - // if (dateTime != null) - // return getMonth(dateTime.hour) + - // " " + - // dateTime.day.toString() + - // ", " + - // dateTime.year.toString(); - // else return DateFormat('hh:mm a').format(dateTime); } From 79fe067fe201958a18ec778ce22885ddf172f3ec Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Mar 2021 14:29:27 +0300 Subject: [PATCH 409/421] Medical Report New Design --- .../medical-file/medical_file_details.dart | 104 ++++++------------ .../medical-file/medical_file_page.dart | 58 +--------- 2 files changed, 39 insertions(+), 123 deletions(-) diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index 63006f65..77fddfe5 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/patient_profile_screen.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -20,6 +21,7 @@ class MedicalFileDetails extends StatefulWidget { String gender; int encounterNumber; int pp; + PatiantInformtion patient; MedicalFileDetails( {this.age, @@ -27,16 +29,19 @@ class MedicalFileDetails extends StatefulWidget { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); @override _MedicalFileDetailsState createState() => _MedicalFileDetailsState( - firstName: firstName, - age: age, - lastName: lastName, - gender: gender, - encounterNumber: encounterNumber, - pp: pp); + firstName: firstName, + age: age, + lastName: lastName, + gender: gender, + encounterNumber: encounterNumber, + pp: pp, + patient: patient, + ); } class _MedicalFileDetailsState extends State { @@ -46,6 +51,7 @@ class _MedicalFileDetailsState extends State { String lastName; String gender; int pp; + PatiantInformtion patient; _MedicalFileDetailsState( {this.age, @@ -53,7 +59,8 @@ class _MedicalFileDetailsState extends State { this.lastName, this.gender, this.encounterNumber, - this.pp}); + this.pp, + this.patient}); bool isPhysicalExam = false; bool isProcedureExpand = false; bool isHistoryExpand = false; @@ -75,57 +82,8 @@ class _MedicalFileDetailsState extends State { 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, - ), - ], - ), - ], - ) - ], - ), - ), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), + PatientProfileHeaderNewDesign(patient, + patient.patientType.toString(), patient.arrivedOn), model.medicalFileList.length != 0 && model .medicalFileList[0] @@ -191,7 +149,6 @@ class _MedicalFileDetailsState extends State { TranslationBase.of(context) .clinic + ": ", - fontWeight: FontWeight.w700, ), if (model.medicalFileList .length != @@ -214,6 +171,7 @@ class _MedicalFileDetailsState extends State { .timeLineEvents[0] .consulations[0] .clinicName, + fontWeight: FontWeight.w700, ), ], ), @@ -245,6 +203,7 @@ class _MedicalFileDetailsState extends State { .consulations[0] .episodeID .toString(), + fontWeight: FontWeight.w700, ), ], ), @@ -267,14 +226,17 @@ class _MedicalFileDetailsState extends State { .consulations .length != 0) - AppText(model - .medicalFileList[0] - .entityList[0] - .timelines[encounterNumber] - .timeLineEvents[0] - .consulations[0] - .appointmentDate - .toString()), + AppText( + model + .medicalFileList[0] + .entityList[0] + .timelines[encounterNumber] + .timeLineEvents[0] + .consulations[0] + .appointmentDate + .toString(), + fontWeight: FontWeight.w700, + ), SizedBox(width: 35.0), // AppText( // 'Appt Date : ', @@ -349,7 +311,8 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model @@ -471,7 +434,8 @@ class _MedicalFileDetailsState extends State { ], ), bodyWidget: ListView.builder( - //physics: , + physics: + NeverScrollableScrollPhysics(), scrollDirection: Axis.vertical, shrinkWrap: true, itemCount: model diff --git a/lib/screens/medical-file/medical_file_page.dart b/lib/screens/medical-file/medical_file_page.dart index ae50e9a2..5f53c2b9 100644 --- a/lib/screens/medical-file/medical_file_page.dart +++ b/lib/screens/medical-file/medical_file_page.dart @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient-profile-header-new-design.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/network_base_view.dart'; @@ -30,7 +31,6 @@ class _MedicalFilePageState extends State { String patientType = routeArgs['patientType']; String arrivalType = routeArgs['arrivalType']; - patient = routeArgs['patient']; return BaseView( onModelReady: (model) => model.getMedicalFile(mrn: patient.patientId), builder: @@ -48,57 +48,8 @@ class _MedicalFilePageState extends State { // ? MainAxisAlignment.start // : MainAxisAlignment.center, children: [ - Container( - padding: EdgeInsets.only(left: 12.0), - child: Row(children: [ - IconButton( - icon: Icon(Icons.arrow_back_ios), - color: Colors.black, //Colors.black, - onPressed: () => Navigator.pop(context), - ), - AppText( - (Helpers.capitalize(patient.firstName) + - " " + - Helpers.capitalize(patient.lastName)), - fontSize: SizeConfig.textMultiplier * 3, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', - ), - patient.gender == 1 - ? Icon( - DoctorApp.male_2, - color: Colors.blue, - ) - : Icon( - DoctorApp.female_1, - color: Colors.pink, - ), - ]), - ), - Row(children: [ - Padding( - padding: EdgeInsets.only(left: 12.0), - child: Container( - width: 60, - height: 60, - child: Image.asset( - patient.gender == 1 - ? 'assets/images/male_avatar.png' - : 'assets/images/female_avatar.png', - fit: BoxFit.cover, - ), - ), - ), - SizedBox( - width: 10, - ), - ]), - Divider( - height: 1.0, - thickness: 1.0, - color: Colors.grey, - ), + PatientProfileHeaderNewDesign( + patient, patient.patientType.toString(), arrivalType), Padding( padding: EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0), @@ -111,7 +62,7 @@ class _MedicalFilePageState extends State { children: [ AppText( 'Medical', - fontSize: 13.0, + fontSize: 15.0, fontWeight: FontWeight.w600, fontFamily: 'Poppins', ), @@ -310,6 +261,7 @@ class _MedicalFilePageState extends State { gender: patient.genderDescription, encounterNumber: index, pp: patient.patientId, + patient: patient, )), ); }, From 747a0b7da4a6eb4b5c87cc68c7e8180fc74e71d0 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Mon, 29 Mar 2021 15:18:38 +0300 Subject: [PATCH 410/421] change the lab result design --- .../profile/lab_result/labs_home_page.dart | 121 +++----- .../radiology/radiology_home_page.dart | 16 +- .../prescription/prescriptions_page.dart | 25 +- lib/util/date-utils.dart | 5 +- .../shared/app_expandable_notifier_new.dart | 1 + lib/widgets/shared/doctor_card.dart | 258 +++++++----------- 6 files changed, 165 insertions(+), 261 deletions(-) diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index c0118e5f..e2388156 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -5,6 +5,8 @@ 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/screens/patients/profile/lab_result/laboratory_result_page.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,94 +22,61 @@ class LabsHomePage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - ProjectViewModel projectViewModel = Provider.of(context); + String patientType = routeArgs['patient-type']; + String arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labOrders, + isShowAppBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: FractionallySizedBox( widthFactor: 1.0, - child: Center( - child: Column( - children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), - ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) => - model.setFilterType(value), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Lab',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Result',bold: true,fontSize: 22,), + ], + ), + ), + ...List.generate( + model.patientLabOrdersList.length, + (index) => Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: model + .patientLabOrdersList[index].patientLabOrdersList + .map((labOrder) { + return DoctorCard( + onTap: () => Navigator.push( + context, + FadePage( + page: LaboratoryResultPage( + patientLabOrders: labOrder, + patient: patient, ), ), ), - ) - ], + doctorName: labOrder.doctorName, + invoiceNO: ' ${labOrder.invoiceNo}', + profileUrl: labOrder.doctorImageURL, + branch: labOrder.projectName, + appointmentDate: labOrder.orderDate, + orderNo: labOrder.orderNo, + ); + }).toList(), ), - ...List.generate( - model.patientLabOrdersList.length, - (index) => AppExpandableNotifier( - title: model.patientLabOrdersList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .patientLabOrdersList[index].patientLabOrdersList - .map((labOrder) { - return DoctorCard( - onTap: () => Navigator.push( - context, - FadePage( - page: LaboratoryResultPage( - patientLabOrders: labOrder, - patient: patient, - ), - ), - ), - isInOutPatient: labOrder.isInOutPatient, - name: labOrder.doctorName, - billNo: ' ${labOrder.invoiceNo}', - profileUrl: labOrder.doctorImageURL, - subName: labOrder.projectName, - isLiveCareAppointment: - labOrder.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - labOrder.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - labOrder.orderDate), - ); - }).toList(), - ), - ), - ) - ], - ), + ) + ], ), ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index cce155d2..4698def1 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -88,18 +88,12 @@ class RadiologyHomePage extends StatelessWidget { ), ), child: DoctorCard( - isInOutPatient: radiology.isInOutPatient, - isLiveCareAppointment: - radiology.isLiveCareAppointment, - name: radiology.doctorName, + doctorName: radiology.doctorName, profileUrl: radiology.doctorImageURL, - billNo: '${radiology.invoiceNo}', - subName: '${radiology.projectName}', - date: projectViewModel.isArabic - ? DateUtils.getMonthDayYearDateFormattedAr( - radiology.orderDate) - : DateUtils.getMonthDayYearDateFormatted( - radiology.orderDate), + invoiceNO: '${radiology.invoiceNo}', + branch: '${radiology.projectName}', + appointmentDate: radiology.orderDate, + orderNo: radiology.orderNo.toString(), ), ); }).toList(), diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d595ff0b..039bd7f2 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -93,24 +93,15 @@ class PrescriptionsPage extends StatelessWidget { ), ), child: DoctorCard( - name: prescriptions.doctorName, + doctorName: prescriptions.doctorName, profileUrl: prescriptions.doctorImageURL, - rat: - prescriptions.actualDoctorRate.toDouble(), - subName: prescriptions.name, - isInOutPatient: prescriptions.isInOutPatient, - isLiveCareAppointment: - prescriptions.isLiveCareAppointment, - date: projectViewModel.isArabic - ? DateUtils - .getMonthDayYearDateFormattedAr( - DateUtils.convertStringToDate( - prescriptions - .appointmentDate)) - : DateUtils.getMonthDayYearDateFormatted( - DateUtils.convertStringToDate( - prescriptions.appointmentDate)), - ), + branch: prescriptions.name, + appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,), + orderNo: prescriptions.appointmentNo.toString(), + invoiceNO:prescriptions.appointmentNo.toString(), + + ) + ); }).toList(), )), diff --git a/lib/util/date-utils.dart b/lib/util/date-utils.dart index 4c11e43b..a78b34c8 100644 --- a/lib/util/date-utils.dart +++ b/lib/util/date-utils.dart @@ -271,10 +271,9 @@ class DateUtils { /// [dateTime] convert DateTime to data formatted static String getDayMonthYearDateFormatted(DateTime dateTime,{bool isArabic = false}) { if (dateTime != null) - return isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) + - " " + - dateTime.day.toString() + + return dateTime.day.toString()+" "+ "${isArabic? getMonthArabic(dateTime.month): getMonth(dateTime.month) }"+ " " + + dateTime.year.toString(); else return ""; diff --git a/lib/widgets/shared/app_expandable_notifier_new.dart b/lib/widgets/shared/app_expandable_notifier_new.dart index ea5777a5..848f5265 100644 --- a/lib/widgets/shared/app_expandable_notifier_new.dart +++ b/lib/widgets/shared/app_expandable_notifier_new.dart @@ -47,6 +47,7 @@ class _AppExpandableNotifier extends State { child: Padding( padding: const EdgeInsets.only(left: 10, right: 10, top: 4), child: Card( + color: Colors.grey[200], clipBehavior: Clip.antiAlias, child: Column( children: [ diff --git a/lib/widgets/shared/doctor_card.dart b/lib/widgets/shared/doctor_card.dart index 6493c916..047d567c 100644 --- a/lib/widgets/shared/doctor_card.dart +++ b/lib/widgets/shared/doctor_card.dart @@ -1,7 +1,8 @@ - import 'package:doctor_app_flutter/core/viewModel/project_view_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/patients/profile/large_avatar.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -11,28 +12,22 @@ import 'StarRating.dart'; import 'Text.dart'; class DoctorCard extends StatelessWidget { - final String name; - final String subName; - final double rat; - final String date; + final String doctorName; + final String branch; + final DateTime appointmentDate; final String profileUrl; - final String billNo; + final String invoiceNO; + final String orderNo; final Function onTap; - final Function onEmailTap; - final bool isInOutPatient; - final bool isLiveCareAppointment; DoctorCard( - {this.name, - this.subName, - this.rat, - this.date, + {this.doctorName, + this.branch, this.profileUrl, - this.billNo, + this.invoiceNO, this.onTap, - this.onEmailTap, - this.isInOutPatient, - this.isLiveCareAppointment = false}); + this.appointmentDate, + this.orderNo}); @override Widget build(BuildContext context) { @@ -42,155 +37,110 @@ class DoctorCard extends StatelessWidget { decoration: BoxDecoration( border: Border.all( width: 0.5, - color: Theme.of(context).primaryColor, + color: Colors.white, ), borderRadius: BorderRadius.all( - Radius.circular(8.0), + Radius.circular(15.0), ), color: Colors.white), - child: InkWell( - onTap: onTap, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - width: projectViewModel.isArabic ? 27 : 20, - height: date == null - ? projectViewModel.isArabic - ? 185 - : 100 - : 180, - decoration: BoxDecoration( - //Colors.red[900] Color(0xff404545) - color: isLiveCareAppointment - ? Color(0xff404545) - : !isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - bottomLeft: projectViewModel.isArabic - ? Radius.circular(0) - : Radius.circular(8), - topRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), - bottomRight: projectViewModel.isArabic - ? Radius.circular(8) - : Radius.circular(0), + child: Padding( + padding: const EdgeInsets.all(15.0), + child: InkWell( + onTap: onTap, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Texts( + doctorName, + bold: true, + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + Texts( + '${DateUtils.getHour(appointmentDate)}', + fontWeight: FontWeight.w600, + color: Colors.grey[700], + fontSize: 14, + ), + ], ), ), - child: RotatedBox( - quarterTurns: 3, - child: Center( - child: Text( - isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() - : !isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), - style: TextStyle(color: Colors.white), - ), - )), - ), - Expanded( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Padding( - padding: const EdgeInsets.all(10.0), - child: Row( + ], + ), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 55, + height: 55, + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - Expanded( - flex: 1, - child: LargeAvatar( - name: name, - url: profileUrl, + if (orderNo != null) + Row( + children: [ + Texts( + 'order No:', + color: Colors.grey[500], + ), + Texts( + orderNo ?? '', + ) + ], ), - ), - Expanded( - flex: 4, - child: Container( - margin: EdgeInsets.all(10), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts( - TranslationBase.of(context).dr + - " " + - name, - bold: true, - ), - Texts( - subName, - ), - if (billNo != null) - Row( - children: [ - Texts( - '${TranslationBase.of(context).billNo}: ', - ), - Texts( - billNo, - ) - ], - ), - if (rat != null) - StarRating( - totalAverage: rat, forceStars: true), - ], - ), + if (invoiceNO != null) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[500], + ), + Texts( + invoiceNO, + ) + ], ), - ), - if (onEmailTap != null) - InkWell( - onTap: onEmailTap, - child: Icon( - Icons.email, - color: Theme.of(context).primaryColor, + Row( + children: [ + Texts( + 'Branch:', + color: Colors.grey[500], ), - ), - ], - ), - ), - if (date != null) - Divider( - height: 8, - color: Colors.grey[400], - ), - if (date != null) - Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Icon( - Icons.calendar_today_outlined, - size: 30, - color: Colors.red, - ), - Expanded( - child: Texts( - date, - variant: 'bodyText', - ), + Texts( + branch, + ) + ], ) - ], - ) - ], + ]), + ), ), - ) - ], - ), - ], + Icon( + EvaIcons.eye, + ) + ], + ), + ], + ), ), ), ); From 8beab7d84f5411221ef76d3c32a4b97e3a186231 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 29 Mar 2021 15:23:30 +0300 Subject: [PATCH 411/421] finish drawer --- lib/widgets/doctor/my_schedule_widget.dart | 1 + lib/widgets/shared/app_drawer_widget.dart | 246 ++++++++++----------- lib/widgets/shared/drawer_item_widget.dart | 24 +- 3 files changed, 137 insertions(+), 134 deletions(-) diff --git a/lib/widgets/doctor/my_schedule_widget.dart b/lib/widgets/doctor/my_schedule_widget.dart index 25e794cf..c28cc8d3 100644 --- a/lib/widgets/doctor/my_schedule_widget.dart +++ b/lib/widgets/doctor/my_schedule_widget.dart @@ -23,6 +23,7 @@ class MyScheduleWidget extends StatelessWidget { children: [ Column( mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, children: [ SizedBox( height: 10, diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 84144f49..100e8c1d 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -31,14 +31,6 @@ class _AppDrawerState extends State { Helpers helpers = new Helpers(); ProjectViewModel projectsProvider; - // @override - // void didChangeDependencies() { - // super.didChangeDependencies(); - // // if (_isInit) { - // getDocProfile(); // TODO: Refactor this code to prevent errors in the cosole. - // // } - // _isInit = false; - // } @override Widget build(BuildContext context) { @@ -47,127 +39,112 @@ class _AppDrawerState extends State { return RoundedContainer( child: Container( color: Colors.white, - // margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 2), child: Drawer( child: Column(children: [ Expanded( flex: 4, child: ListView(padding: EdgeInsets.zero, children: [ Container( + margin: EdgeInsets.symmetric(horizontal: 20), height: SizeConfig.heightMultiplier * 50, - child: InkWell( - child: DrawerHeader( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - child: Image.asset( - 'assets/images/logo.png', - ), - margin: EdgeInsets.only(top: 10, bottom: 15), - ), - SizedBox( - height: 1, - child: Container( - color: Colors.black26, - ), - ), - SizedBox(height: 15), - InkWell( - onTap: () { - Navigator.of(context) - .pushNamed(PROFILE, arguments: { - 'title': authProvider.doctorProfile.doctorName, - "doctorProfileall": authProvider.doctorProfile - }); - }, - child: Column( - children: [ - authProvider.doctorProfile != null - ? CircleAvatar( - radius: - SizeConfig.imageSizeMultiplier * 12, - // radius: (52) - child: ClipRRect( - borderRadius: BorderRadius.circular(50), - child: Image.network( - authProvider - .doctorProfile.doctorImageURL, - fit: BoxFit.fill, - width: 700, - ), - ), - backgroundColor: Colors.transparent, - ) - : SizedBox(), - authProvider.doctorProfile != null - ? Padding( - padding: EdgeInsets.only(top: 10), - child: AppText( - TranslationBase.of(context).dr + - authProvider - .doctorProfile?.doctorName, - fontWeight: FontWeight.bold, - color: Colors.black, - fontSize: SizeConfig.textMultiplier * 2, - )) - : SizedBox(), - ], - ), - ), - RaisedButton( - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(18.0), - side: BorderSide(color: Colors.red)), - child: AppText( - TranslationBase.of(context).logout, - color: Colors.white, - ), - onPressed: () async { - Navigator.pop(context); - await helpers.logout(); - projectsProvider.isLogin = false; - }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: Image.asset( + 'assets/images/dr_app_logo.png', + ), + margin: EdgeInsets.only(top: 10, bottom: 15), + ), + SizedBox(height: 15), + if (authProvider.doctorProfile != null) + InkWell( + onTap: () { + Navigator.of(context).pushNamed(PROFILE, arguments: { + 'title': authProvider.doctorProfile.doctorName, + "doctorProfileall": authProvider.doctorProfile + }); + }, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.only(top: 10), + child: AppText( + TranslationBase.of(context).dr + + authProvider.doctorProfile?.doctorName, + fontWeight: FontWeight.bold, + color: Color(0xFF2E303A), + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.5, + ), + ), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + authProvider.doctorProfile?.clinicDescription, + fontWeight: FontWeight.w600, + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins', + )) + ], ), - ], + ), + SizedBox(height: 15), + InkWell( + child: DrawerItem( + TranslationBase.of(context).rescheduleLeaves, + // " or " + + // TranslationBase.of(context).leaves, + + DoctorApp.leaves, + // subTitle: , + ), + onTap: () { + Navigator.pop(context); + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => AddRescheduleLeavScreen(), + // MyReferredPatient(), + )); + }, ), - ), + ], ), ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).settings, Icons.settings), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(SETTINGS); - }, + SizedBox( + height: 40, ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).reschedule, - DoctorApp.leaves, - subTitle: TranslationBase.of(context).leaves, + Container( + margin: EdgeInsets.symmetric(horizontal: 20), + child: Column( + children: [ + InkWell( + child: DrawerItem( + TranslationBase.of(context).logout, Icons.settings), + onTap: () async { + Navigator.pop(context); + await helpers.logout(); + projectsProvider.isLogin = false; + }, + ), + InkWell( + child: DrawerItem( + projectsProvider.isArabic + ? TranslationBase.of(context).lanEnglish + : TranslationBase.of(context).lanArabic, + DoctorApp.qr_code), + onTap: () { + if (projectsProvider.isArabic) + projectsProvider.changeLanguage('en'); + else + projectsProvider.changeLanguage('ar'); + }, + ), + ], ), - onTap: () { - Navigator.pop(context); - - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddRescheduleLeavScreen(), - // MyReferredPatient(), - )); - }, - ), - InkWell( - child: DrawerItem( - TranslationBase.of(context).qr + - TranslationBase.of(context).reader, - DoctorApp.qr_code), - onTap: () { - Navigator.pop(context); - Navigator.of(context).pushNamed(QR_READER); - }, ), ]), ), @@ -179,14 +156,35 @@ class _AppDrawerState extends State { child: Align( alignment: FractionalOffset.bottomCenter, child: Container( - child: Column( - children: [ - Text("Powered by"), - Image.asset( - 'assets/images/cs_logo_container.png', - width: SizeConfig.imageSizeMultiplier * 30, - ) - ], + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: MediaQuery.of(context).size.width *0.3, + child: RichText( + text: TextSpan( + text: 'Powered by', + style: TextStyle( + color: Color(0xFF989898), + fontWeight: FontWeight.bold, + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + children: [ + TextSpan(text: ' Cloud Solutions', + style: TextStyle( + color: Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2, + fontFamily: 'Poppins',), + ) + ] + ),), + ), + // Text("Powered by"), + Image.asset( + 'assets/images/cs_logo_container.png', + width: SizeConfig.imageSizeMultiplier * 20, + ) + ], )))) ])) ])), diff --git a/lib/widgets/shared/drawer_item_widget.dart b/lib/widgets/shared/drawer_item_widget.dart index 83afb860..84691f7f 100644 --- a/lib/widgets/shared/drawer_item_widget.dart +++ b/lib/widgets/shared/drawer_item_widget.dart @@ -26,7 +26,7 @@ class _DrawerItemState extends State { @override Widget build(BuildContext context) { return Container( - margin: EdgeInsets.only(top: 5, bottom: 5, left: 10, right: 10), + margin: EdgeInsets.only(top: 5, bottom: 5, left: 0, right: 0), child: Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -39,15 +39,19 @@ class _DrawerItemState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - AppText( - widget.title, - color: widget.color ?? Colors.black, - textOverflow: TextOverflow.ellipsis, - // fontWeight: FontWeight.bold, - // margin: 5, - marginLeft: 5, - marginRight: 5, - fontSize: SizeConfig.textMultiplier * 2.3, + Container( + width: MediaQuery.of(context).size.width *0.45, + child: Expanded( + child: AppText( + widget.title, + marginLeft: 5, + marginRight: 5, + color:widget.color ??Color(0xFF2E303A), + fontSize: SizeConfig.textMultiplier * 2.0, + fontFamily: 'Poppins', + fontWeight: FontWeight.bold, + ), + ), ), AppText( widget.subTitle, From eadfe2d6bcf1f3257caaafc31241bd900ffb207f Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 29 Mar 2021 16:21:48 +0300 Subject: [PATCH 412/421] bug fixes --- assets/images/booked.png | Bin 0 -> 412 bytes assets/images/edit.png | Bin 0 -> 435 bytes assets/images/livecare.png | Bin 0 -> 753 bytes assets/images/walkin.png | Bin 0 -> 698 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 20 +- .../patients/patient_search_screen.dart | 7 +- .../add-rescheduleleave.dart | 492 ++++++++---------- .../reschedule-leaves/reschedule_leave.dart | 314 ++++++----- lib/util/translations_delegate_base.dart | 37 +- lib/widgets/patients/PatientCard.dart | 54 +- 11 files changed, 491 insertions(+), 437 deletions(-) create mode 100644 assets/images/booked.png create mode 100644 assets/images/edit.png create mode 100644 assets/images/livecare.png create mode 100644 assets/images/walkin.png diff --git a/assets/images/booked.png b/assets/images/booked.png new file mode 100644 index 0000000000000000000000000000000000000000..e07b7d35bb7696fa8c329f6643552c0b02a91700 GIT binary patch literal 412 zcmeAS@N?(olHy`uVBq!ia0vp^fAw!@bh@lP?1WTzKTB#daL)jpe zU|C};h%%@yW2hDlAj24>7i0pE4Kod*?EnA&*WX0c0iC5^666=mz|JA8q+x1iZV?(6 zpHNWW&^T@8qE&0QZrgw0(BU)Z&tG`<^3A*VA3uHj_Wj3?Uw?M~OSlBo%9!Ns?qaa+ zj_wm6r^eI8F+}3>($lfRP7V?d4~2i-%FzhQN)8OF`2Tq&-}L(e~*Y00pVZFzwM zJA+@v>NSQtpB%gKN=nD#-d~+SukJ9dlYbr^NIqJ|`KIA%TWN2FPi0fd{FQzacGi1^ z@cmxcqo$hsR3-P<>#FmIy1nn)xck;0>&>;@wDC9V{j18ymTs`)1G~rG|!?p`op=v8BGgwZ6WMo}RU?p{0R=jjo}EzP^>dzNN0AwZ5UXo`IFVft8+t zrJezZt!D^iSm}a9fNT({YhVdh02YCWg9SkfKnSEB16k_ng9QKo{~!By{&S%Fj7oz1 zf*DxZ_yq)oghe&9ZEWowT-@9}>smXz`X_AKyk+a&efy7|JbmWe<*T>u-n;+c;hVSb zzI)Ke#gnhZo-E`|vgI*1&%Xl`I$FVdQ&MBb@01pb2-2eap literal 0 HcmV?d00001 diff --git a/assets/images/livecare.png b/assets/images/livecare.png new file mode 100644 index 0000000000000000000000000000000000000000..b1fd3f063a418da25f39e32b16fa730562be5c91 GIT binary patch literal 753 zcmVP000gM1^@s6+B&yD00006VoOIv0RI60 z0RN!9r;`8x0;WksK~y-6os>;zlvfmnpL4%&zC?#2ZID(MI)T<0hni%is0$V9riej9 zMeR-yiW`MmM7wEAH?7p4E-Heq)K&dy!KDq|h)A&s80>^<{DE$iNP_c|`R3l&h5g1! zoJ#0f-h1BjocEl|wXtF`Nz3VB%ngDTF~4|3(5e21<5%XBY$Ju0KVUjI&*H5iGkw%| zfBbs8%aQk270vry0je>kJ^up$U<$Sym<5?A6gsD@<0#&LAxI2xz~YviX~E9~Hk-Kk z?^%#zgUr4H?#!YXU9-Ah-m_`SI!1vnfh0S3Es|@YL9df8;n*OfnB};@Hi9a_`<-Ss z1f&2m)C6>|IECXnu;Mk#Bi%g#FlV+pD4YRX`-Tw(nYKFFK0zVPX?t8}^-LUo>-5p@ zKz}~19~A zGTu9MkauJwD7^2U~b5X$5cDc#tZyg4QpH$ybC;% jbaLRq_|Vwua5N#b&6-&E00000NkvXXu0mjf)&^&F literal 0 HcmV?d00001 diff --git a/assets/images/walkin.png b/assets/images/walkin.png new file mode 100644 index 0000000000000000000000000000000000000000..81f112f54416a587067a74098f04a8a62ad673f7 GIT binary patch literal 698 zcmV;r0!96aP)X1^@s61#ZvJ00006VoOIv0RI60 z0RN!9r;`8x0&ht~K~y-6eUZy=O;Hraf8RbwOB0WHrxhY7RY`AqRI5eqgo%h(A_jsX zBO>B4>cC%MVk!nAF)$!uAV_dksFt*Gl|)d3D^f(&BktMDz`e)0y^U{l_B!8h?{BRo zCaAf+ePJ=KIVoel0xstJa@W)URbg&!u8F749K>iWmCT#Az8uKiD0^HQh-+p>DKmha zV{h6MrVkc}1%*W`z1(YXPadE41nI-*hqqtmE?nf0HUjg^b7C4bR||zVKPLs&baX86 z-t9JN95E`aqbU10S{NCgwCSeSu5%_1Q>h={YHiN@-rgToP2;GiTGQ&jGy9(I7dcelb7{V+E zV8-^M;+!+yd2{VxR{%rw2%xF8Ye|0K!P_W`>c*}1Ik2Rh*7K~5HD`H(^v|&RP;C|6*Xips5DM?!m zzWkfNKT-vlx9(DiT^`$sX>$S@n<{{8HX8yvlHAzq;elMAGcJ`%^H;WZ*C#+>?ALLi zr97D_zk|yFUdko00x}L@MO$YRrk+yWBOMqVy#EBBdO_kUyh7B@CFCK-LDDED40YdFIM$<+IIyvihtTh-QeFbu+5Lyzx{Oazuk gUCX9;ztqe5KN)B4)-yZ*vj6}907*qoM6N<$f;aa*f&c&j literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..98393a63 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,7 +4,7 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; +//const BASE_URL = 'https://hmgwebservices.com/'; const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; @@ -234,6 +234,7 @@ const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; + ///Prescriptions const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const GET_PRESCRIPTIONS_ALL_ORDERS = @@ -246,7 +247,6 @@ const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh'; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; - var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a1f63710..e7871d86 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -394,7 +394,7 @@ const Map> localizedValues = { 'painManagement': {'en': "Pain Management", 'ar': 'إدارة الألم'}, 'holiday': {'en': "Holiday", 'ar': 'يوم الاجازة'}, 'to': {'en': "To", 'ar': 'إلى'}, - 'coveringDoctor': {'en': "Covering Doctor", 'ar': 'تغطية دكتور'}, + 'coveringDoctor': {'en': "Covering Doctor: ", 'ar': ' :تغطية دكتور'}, 'requestLeave': {'en': 'Request Leave', 'ar': 'طلب إجازة'}, 'pleaseEnterDate': { 'en': 'Please enter leave start date', @@ -785,7 +785,21 @@ const Map> localizedValues = { "prescriptions": {"en": "Prescriptions", "ar": "الوصفات الطبية"}, "notes": {"en": "Notes", "ar": "ملاحظات"}, "dailyDoses": {"en": "Daily Doses", "ar": "جرعات يومية"}, + "searchWithOther": { + "en": "Search With Other Criteria", + "ar": "البحث بمعايير أخرى" + }, + "hideOtherCriteria": { + "en": "Hide Other Criteria", + "ar": "إخفاء المعايير الأخرى" + }, + "applyForReschedule": { + "en": "Apply for leave or reschedule", + "ar": "تقدم بطلب للحصول على إجازة أو إعادة جدولة" + }, + "startDate": {"en": "Start Date: ", "ar": " :تاريخ البدء"}, + "endDate": {"en": "End Date: ", "ar": " :تاريخ الانتهاء"}, - - + "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, + "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, }; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 45d457cd..0ae5452b 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -210,11 +210,14 @@ class _PatientSearchScreenState extends State { InkWell( child: this.isView == false ? AppText( - 'Search With Other Critearia', + TranslationBase.of(context) + .searchWithOther, color: Colors.red, fontWeight: FontWeight.bold, ) - : AppText('Hide Other Criteria', + : AppText( + TranslationBase.of(context) + .hideOtherCriteria, color: Colors.red, fontWeight: FontWeight.bold), onTap: () { diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index 0dab0226..dacbba72 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -7,6 +7,8 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.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:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -18,287 +20,251 @@ class AddRescheduleLeavScreen extends StatelessWidget { Widget build(BuildContext context) { projectsProvider = Provider.of(context); return BaseView( - onModelReady: (model) => - {model.getRescheduleLeave(), model.getCoveringDoctors()}, - builder: (_, model, w) => AppScaffold( - baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: model.getReschduleLeave.length > 0 - ? SingleChildScrollView( + onModelReady: (model) => + {model.getRescheduleLeave(), model.getCoveringDoctors()}, + builder: (_, model, w) => AppScaffold( + baseViewModel: model, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, + body: Column(children: [ + Container( + width: MediaQuery.of(context).size.width, + margin: EdgeInsets.all(10), + padding: + EdgeInsets.only(left: 10, right: 10, top: 20, bottom: 20), + decoration: BoxDecoration( + color: HexColor('#EAEAEA'), + borderRadius: BorderRadius.all(Radius.circular(20))), + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openLeave( + context, + false, + ); + }), + ), + Padding( + child: AppText( + TranslationBase.of(context).applyForReschedule, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 18, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * .65, + child: SingleChildScrollView( + child: Column( + children: model.getReschduleLeave + .map((GetRescheduleLeavesResponse item) { + return RoundedContainer( child: Column( children: [ - SizedBox(height: 50), Container( - margin: - EdgeInsets.only(left: 15, right: 15, top: 20), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - InkWell( - child: Row( - children: [ - Expanded( - flex: 4, - child: AppText( - TranslationBase.of(context) - .requestLeave), - ), - IconButton( - icon: Icon( - Icons.add_circle, - color: Colors.red, - )) - ], - ) - // AppTextFormField( - // hintText: - // TranslationBase.of(context).requestLeave, - // borderColor: Colors.white, - // prefix: IconButton( - // icon: Icon( - // Icons.add_circle, - // color: Colors.red, - // )), - // // textInputType: TextInputType.text, - // readOnly: true, - // onTap: () { - // openLeave( - // context, - // false, - // ); - // return false; - // }, - // inputFormatter: ONLY_LETTERS, - // ) - , - onTap: () { - openLeave( - context, - false, - ); - }, - ) - ], - ), - ), - Column( - children: model.getReschduleLeave.map( - (GetRescheduleLeavesResponse 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( - children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: - EdgeInsets.all(3), - child: AppText( - item.status == 1 - ? TranslationBase - .of(context) - .approved - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : TranslationBase.of( - context) - .rejected, - fontWeight: - FontWeight.bold, - color: Colors.white, - ), - color: item.status == 1 - ? Colors.green - : item.status == 2 - ? Colors - .yellow[800] - : Colors.red[800], - ), - SizedBox( - height: 5, - ), - Container( - child: AppText( - item.requisitionType == 1 - ? TranslationBase.of( - context) - .offTime - : TranslationBase.of( - context) - .holiday + - ' ', - fontWeight: - FontWeight.bold, - )), - Row( - children: [ - Flexible( - child: Text( - DateUtils.convertStringToDateFormat( - item - .dateTimeFrom, - 'yyyy-MM-dd HH:mm') + - ' ' + - TranslationBase.of( - context) - .to + - ' ' + - DateUtils.convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm') - // overflow: - // TextOverflow.ellipsis, - )) - ], - ), - SizedBox( - height: 5, - ), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.all(3), + margin: EdgeInsets.only(top: 10), + child: AppText( + item.status == 1 + ? TranslationBase.of( + context) + .approved + : item.status == 2 + ? TranslationBase.of( + context) + .pending + : TranslationBase.of( + context) + .rejected, + fontWeight: FontWeight.bold, + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + fontSize: 14, + ), + ), + SizedBox( + height: 5, + ), + Container( + child: AppText( + item.requisitionType == 1 + ? TranslationBase.of(context) + .offTime + : TranslationBase.of(context) + .holiday + + ' ', + fontWeight: FontWeight.bold, + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText( + TranslationBase.of(context) + .startDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeFrom, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + + // overflow: + // TextOverflow.ellipsis, + ]), + + // overflow: + // TextOverflow.ellipsis, + + SizedBox( + height: 5, + ), + Row( + children: [ + AppText( + TranslationBase.of(context) + .endDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) + ], + ), + + SizedBox( + height: 5, + ), + model.coveringDoctors.length > 0 + ? Row(children: [ AppText( TranslationBase.of( context) .coveringDoctor, - fontWeight: - FontWeight.bold, ), - model.coveringDoctors - .length > - 0 - ? Row(children: [ - AppText(getDoctor( - model - .coveringDoctors, - item.coveringDoctorId)) - ]) - : SizedBox(), AppText( - TranslationBase.of( - context) - .reasons, + getDoctor( + model.coveringDoctors, + item.coveringDoctorId), fontWeight: FontWeight.bold, - ), - model.allReasons.length > 0 - ? Row(children: [ - AppText(getReasons( - model - .allReasons, - item.reasonId)) - ]) - : SizedBox(), - ], - ), - SizedBox( - width: 10, - ), - ], - ), - ), - (item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.edit_outlined, - size: 30, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave(context, true, - extendedData: item) - }, - )) - : SizedBox(), - ], - )), - SizedBox( - height: 10, - ), - Divider( - height: 1, + ) + ]) + : SizedBox(), + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 5), + child: AppText(getReasons( + model.allReasons, + item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => { + openLeave( + context, true, + extendedData: + item) + }, + ) + : SizedBox(), + ]), + ], + ), + SizedBox( + width: 10, + ), + ], + ), ), ], - )); - }).toList(), - ) + )), ], ), - ) - : new Builder(builder: (context) { - return Center( - child: SingleChildScrollView( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context).noReScheduleLeave, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - ), - )); - }), - )); + ); + }).toList(), + ))) + ])), + ); } openLeave(BuildContext context, isExtend, {extendedData}) { - showModalBottomSheet( - context: context, - builder: (context) { - return new Container( - child: RescheduleLeaveScreen( - isExtend, - extendedData, - )); - }); + // showModalBottomSheet( + // context: context, + // builder: (context) { + // return new Container( + // child: RescheduleLeaveScreen( + // isExtend, + // extendedData, + // )); + // }); + + Navigator.push( + context, + FadePage( + page: RescheduleLeaveScreen( + isExtend, + extendedData, + ), + ), + ); } getDoctor(model, doctorId) { diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index 7b034431..e873f9b1 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -114,12 +114,13 @@ class _RescheduleLeaveScreen extends State { model2.getCoveringDoctors() }, builder: (_, model2, w) => GestureDetector( - onTap: (){ - FocusScope.of(context).requestFocus(new FocusNode()); - }, - child: AppScaffold( + onTap: () { + FocusScope.of(context).requestFocus(new FocusNode()); + }, + child: AppScaffold( baseViewModel: model2, - isShowAppBar: false, + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).rescheduleLeaves, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -130,8 +131,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -139,7 +140,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -151,58 +153,64 @@ class _RescheduleLeaveScreen extends State { children: [ Expanded( // add Expanded to have your dropdown button fill remaining space - child: DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: Colors.grey, - isExpanded: true, - dropdownColor: - Colors.grey, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: [ - AppText( + child: + DropdownButtonHideUnderline( + child: new IgnorePointer( + ignoring: true, + child: DropdownButton( + focusColor: + Colors.grey, + isExpanded: true, + dropdownColor: + Colors.grey, + value: getClinicName( + model) ?? + "", + iconSize: 0, + elevation: 16, + selectedItemBuilder: + (BuildContext + context) { + return model + .getClinicNameList() + .map((item) { + return Row( + mainAxisSize: + MainAxisSize + .max, + children: < + Widget>[ + AppText( + item, + fontSize: + SizeConfig.textMultiplier * + 2.1, + color: Colors + .grey[ + 500], + ), + ], + ); + }).toList(); + }, + onChanged: + (newValue) => + {}, + items: model + .getClinicNameList() + .map((item) { + return DropdownMenuItem( + value: item + .toString(), + child: Text( item, - fontSize: SizeConfig - .textMultiplier * - 2.1, - color: Colors - .grey[500], + textAlign: + TextAlign + .end, ), - ], - ); - }).toList(); - }, - onChanged: (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: - item.toString(), - child: Text( - item, - textAlign: - TextAlign.end, - ), - ); - }).toList(), - ))), + ); + }).toList(), + ))), ), ], ) @@ -216,7 +224,8 @@ class _RescheduleLeaveScreen extends State { borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -238,8 +247,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -247,7 +256,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -262,7 +272,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( // focusColor: Colors.grey, isExpanded: true, value: offTime == null @@ -272,12 +283,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allOffTime .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( item[ @@ -297,12 +310,22 @@ class _RescheduleLeaveScreen extends State { offTime = newValue; }), if (offTime == '1') - {model2.getReasons(18)} + { + model2 + .getReasons(18) + } else if (offTime == '2') - {model2.getReasons(19)} - else if (offTime == '3' || + { + model2 + .getReasons(19) + } + else if (offTime == + '3' || offTime == '5') - {model2.getReasons(102)} + { + model2 + .getReasons(102) + } }, items: model2.allOffTime .map((item) { @@ -335,20 +358,21 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: - TranslationBase.of(context) - .fromDate, + hintText: TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons.calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: _toDateController, @@ -372,11 +396,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -387,8 +412,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .fromTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller4, onChanged: (val) => fromTime = val, @@ -411,11 +436,12 @@ class _RescheduleLeaveScreen extends State { decoration: BoxDecoration( borderRadius: BorderRadius.all( - Radius.circular(6.0)), + Radius.circular( + 6.0)), border: Border.all( width: 1.0, - color: - HexColor("#CCCCCC"))), + color: HexColor( + "#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: @@ -426,8 +452,8 @@ class _RescheduleLeaveScreen extends State { TranslationBase.of( context) .toTime, - type: - DateTimePickerType.time, + type: DateTimePickerType + .time, controller: _controller5, onChanged: (val) => toTime = val, @@ -457,23 +483,26 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase.of( - context) - .fromDate, + hintText: + TranslationBase.of( + context) + .fromDate, borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons .calendar_today)), textInputType: TextInputType.number, - controller: _toDateController, + controller: + _toDateController, onTap: () { _presentDatePicker( 'fromDate'); @@ -493,21 +522,22 @@ class _RescheduleLeaveScreen extends State { Radius.circular(6.0)), border: Border.all( width: 1.0, - color: HexColor("#CCCCCC"))), + color: + HexColor("#CCCCCC"))), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ AppTextFormField( - hintText: TranslationBase - .of(context) - .toDate, + hintText: + TranslationBase + .of(context) + .toDate, borderColor: Colors.white, prefix: IconButton( - icon: Icon( - Icons - .calendar_today)), + icon: Icon(Icons + .calendar_today)), textInputType: TextInputType.number, controller: @@ -529,8 +559,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -538,7 +568,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -553,7 +584,8 @@ class _RescheduleLeaveScreen extends State { // add Expanded to have your dropdown button fill remaining space child: DropdownButtonHideUnderline( - child: DropdownButton( + child: + DropdownButton( focusColor: Colors.grey, isExpanded: true, value: reason == null @@ -564,12 +596,14 @@ class _RescheduleLeaveScreen extends State { iconSize: 40, elevation: 16, selectedItemBuilder: - (BuildContext context) { + (BuildContext + context) { return model2.allReasons .map((item) { return Row( mainAxisSize: - MainAxisSize.max, + MainAxisSize + .max, children: [ AppText( projectsProvider @@ -603,7 +637,8 @@ class _RescheduleLeaveScreen extends State { projectsProvider .isArabic ? item['nameAr'] - : item['nameEn'], + : item[ + 'nameEn'], textAlign: TextAlign.end, ), @@ -621,8 +656,8 @@ class _RescheduleLeaveScreen extends State { Container( margin: EdgeInsets.all(8), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), + borderRadius: BorderRadius.all( + Radius.circular(6.0)), border: Border.all( width: 1.0, color: HexColor("#CCCCCC"))), @@ -630,7 +665,8 @@ class _RescheduleLeaveScreen extends State { child: Padding( padding: EdgeInsets.only( top: SizeConfig.widthMultiplier * 0.9, - bottom: SizeConfig.widthMultiplier * 0.9, + bottom: + SizeConfig.widthMultiplier * 0.9, right: SizeConfig.widthMultiplier * 3, left: SizeConfig.widthMultiplier * 3), child: Column( @@ -649,33 +685,36 @@ class _RescheduleLeaveScreen extends State { dropdownSearchDecoration: InputDecoration( contentPadding: - EdgeInsets.all( - 0), - border: InputBorder - .none), + EdgeInsets + .all(0), + border: + InputBorder + .none), //maxHeight: 300, items: model2 .coveringDoctors .map((item) { return projectsProvider .isArabic - ? item['doctorNameN'] - : item['doctorName']; + ? item[ + 'doctorNameN'] + : item[ + 'doctorName']; }).toList(), // label: "Doctor List", onChanged: (item) { model2.coveringDoctors - .forEach((newVal) => { - if (newVal['doctorName'] == - item || - newVal['doctorName'] == - item) - { - doctorID = - newVal[ - 'DoctorID'] - } - }); + .forEach( + (newVal) => { + if (newVal['doctorName'] == + item || + newVal['doctorName'] == + item) + { + doctorID = + newVal['DoctorID'] + } + }); }, selectedItem: getSelectedDoctor( @@ -693,8 +732,10 @@ class _RescheduleLeaveScreen extends State { ), popupTitle: Container( height: 50, - decoration: BoxDecoration( - color: Theme.of(context) + decoration: + BoxDecoration( + color: Theme.of( + context) .primaryColorDark, borderRadius: BorderRadius.only( @@ -712,8 +753,10 @@ class _RescheduleLeaveScreen extends State { style: TextStyle( fontSize: 24, fontWeight: - FontWeight.bold, - color: Colors.white, + FontWeight + .bold, + color: + Colors.white, ), ), ), @@ -723,9 +766,11 @@ class _RescheduleLeaveScreen extends State { borderRadius: BorderRadius.only( topLeft: - Radius.circular(24), + Radius.circular( + 24), topRight: - Radius.circular(24), + Radius.circular( + 24), ), ), ), @@ -805,8 +850,11 @@ class _RescheduleLeaveScreen extends State { children: [ AppButton( title: widget.isUpdate == true - ? TranslationBase.of(context).update - : TranslationBase.of(context).add, + ? TranslationBase.of(context) + .updateReschedule + : TranslationBase.of(context) + .addReschedule, + color: HexColor('#359846'), onPressed: () { if (offTime == '1' || offTime == '2') { if (widget.isUpdate == true) { @@ -837,7 +885,7 @@ class _RescheduleLeaveScreen extends State { ), ), ), - ))); + ))); } getProfile() async { diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 331b2812..b2ed3aff 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1145,26 +1145,45 @@ class TranslationBase { String get billNo => localizedValues['BillNo'][locale.languageCode]; String get labResults => localizedValues['labResults'][locale.languageCode]; String get sendSuc => localizedValues['sendSuc'][locale.languageCode]; - String get specialResult => localizedValues['SpecialResult'][locale.languageCode]; - String get noDataAvailable => localizedValues['noDataAvailable'][locale.languageCode]; - String get showMoreBtn => localizedValues['show-more-btn'][locale.languageCode]; + String get specialResult => + localizedValues['SpecialResult'][locale.languageCode]; + String get noDataAvailable => + localizedValues['noDataAvailable'][locale.languageCode]; + String get showMoreBtn => + localizedValues['show-more-btn'][locale.languageCode]; String get fileNumber => localizedValues['fileNumber'][locale.languageCode]; String get reschedule => localizedValues['reschedule'][locale.languageCode]; String get leaves => localizedValues['leaves'][locale.languageCode]; String get openRad => localizedValues['open-rad'][locale.languageCode]; - String get totalApproval => localizedValues['totalApproval'][locale.languageCode]; - String get procedureStatus => localizedValues['procedureStatus'][locale.languageCode]; + String get totalApproval => + localizedValues['totalApproval'][locale.languageCode]; + String get procedureStatus => + localizedValues['procedureStatus'][locale.languageCode]; String get unusedCount => localizedValues['unusedCount'][locale.languageCode]; String get companyName => localizedValues['companyName'][locale.languageCode]; - String get procedureName => localizedValues['procedureName'][locale.languageCode]; + String get procedureName => + localizedValues['procedureName'][locale.languageCode]; String get usageStatus => localizedValues['usageStatus'][locale.languageCode]; - String get prescriptions => localizedValues['prescriptions'][locale.languageCode]; + String get prescriptions => + localizedValues['prescriptions'][locale.languageCode]; String get notes => localizedValues['notes'][locale.languageCode]; String get dailyDoses => localizedValues['dailyDoses'][locale.languageCode]; - - + String get searchWithOther => + localizedValues['searchWithOther'][locale.languageCode]; + String get hideOtherCriteria => + localizedValues['hideOtherCriteria'][locale.languageCode]; + String get applyForReschedule => + localizedValues['applyForReschedule'][locale.languageCode]; + + String get startDate => localizedValues['startDate'][locale.languageCode]; + String get endDate => localizedValues['endDate'][locale.languageCode]; + + String get addReschedule => + localizedValues['add-reschedule'][locale.languageCode]; + String get updateReschedule => + localizedValues['update-reschedule'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/PatientCard.dart b/lib/widgets/patients/PatientCard.dart index 9ecc6a23..c53a38d7 100644 --- a/lib/widgets/patients/PatientCard.dart +++ b/lib/widgets/patients/PatientCard.dart @@ -84,13 +84,15 @@ class PatientCard extends StatelessWidget { fontFamily: 'Poppins', fontWeight: FontWeight.w600, ) - : AppText( - DateUtils.convertStringToDateFormat( - patientInfo.arrivedOn, - 'MM-dd-yyyy HH:mm'), - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - ) + : patientInfo.arrivedOn != null + ? AppText( + DateUtils.convertStringToDateFormat( + patientInfo.arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + : SizedBox() ], )) : SizedBox(), @@ -124,7 +126,9 @@ class PatientCard extends StatelessWidget { AppText( patientInfo.nationalityName != null ? patientInfo.nationalityName - : patientInfo.nationality, + : patientInfo.nationality != null + ? patientInfo.nationality + : "", fontWeight: FontWeight.bold, fontSize: 14, ), @@ -286,29 +290,29 @@ class PatientCard extends StatelessWidget { children: [ Container( padding: EdgeInsets.all(4), - decoration: BoxDecoration( - borderRadius: BorderRadius.only( - bottomRight: Radius.circular(8), - topLeft: Radius.circular(8), - ), - color: patientInfo.appointmentType == - 'Regular' && - patientInfo.visitTypeId == 100 - ? HexColor('#D02127') - : patientInfo.appointmentType == - 'Walkin' - ? HexColor('#28323A') - : HexColor('#6C7379'), - ), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.only( + // bottomRight: Radius.circular(8), + // topLeft: Radius.circular(8), + // ), + // color: patientInfo.appointmentType == + // 'Regular' && + // patientInfo.visitTypeId == 100 + // ? HexColor('#D02127') + // : patientInfo.appointmentType == + // 'Walkin' + // ? HexColor('#28323A') + // : HexColor('#6C7379'), + // ), child: Image.asset( patientInfo.appointmentType == 'Regular' && patientInfo.visitTypeId == 100 - ? 'assets/images/type-livecare.png' + ? 'assets/images/livecare.png' : patientInfo.appointmentType == 'Walkin' - ? 'assets/images/type-walkin.png' - : 'assets/images/type-booked.png', + ? 'assets/images/walkin.png' + : 'assets/images/booked.png', height: 25, width: 35, )), From f74fdc80f6fb34bc5e79fb47c39c9a3b46ef3cc6 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 29 Mar 2021 16:50:06 +0300 Subject: [PATCH 413/421] fix doctor replay --- lib/widgets/doctor/doctor_reply_widget.dart | 618 +++++++++++++------- 1 file changed, 414 insertions(+), 204 deletions(-) diff --git a/lib/widgets/doctor/doctor_reply_widget.dart b/lib/widgets/doctor/doctor_reply_widget.dart index f3882e23..5660fde6 100644 --- a/lib/widgets/doctor/doctor_reply_widget.dart +++ b/lib/widgets/doctor/doctor_reply_widget.dart @@ -1,13 +1,13 @@ import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; +import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; +import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; class DoctorReplyWidget extends StatefulWidget { final ListGtMyPatientsQuestions reply; @@ -22,224 +22,434 @@ class DoctorReplyWidget extends StatefulWidget { class _DoctorReplyWidgetState extends State { @override Widget build(BuildContext context) { - return Stack( - children: [ - Container( - margin: EdgeInsets.symmetric(vertical: 10.0), - width: double.infinity, - decoration: BoxDecoration( - color: HexColor('#FFFFFF'), - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - SizedBox(height: 18,), - Container( - margin: EdgeInsets.only(right: 15), - child: Row( + return Container( + child: CardWithBgWidget( + bgColor: + widget.reply.status == 1 + ? Color(0xffc4aa54) + : Colors.red[700], + hasBorder: false, + widget: Container( + // padding: EdgeInsets.only(left: 20, right: 0, bottom: 0), + child: InkWell( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: widget.reply.infoStatus!=null ? widget.reply.infoStatus :'', + style: TextStyle( + color: widget.reply.status != null + ? widget.reply.status == 1 + ? Color(0xffc4aa54) + : widget.reply.status == 2 + ? Colors.green[700] + : Colors.red[700] + : Colors.grey[500], + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 2.0 * SizeConfig.textMultiplier)), + ], + ), + ), + AppText( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .day + .toString() + + " " + + DateUtils.getMonth( + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .month) + .toString() + .substring(0, 3) + + ' ' + + DateUtils.getDateTimeFromServerFormat( + widget.reply.createdOn) + .year + .toString(), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ) + ], + ), + Row( + children: [ + Expanded( + child: AppText( + Helpers.capitalize( widget.reply.patientName), + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + ), + SizedBox( + width: 4, + ), + widget.reply.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ], + ), + SizedBox( + height: 20, + ), + + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.start, children: [ - SizedBox(width: 5,), - //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[200], - ]), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), - ), - width: 80, - height: 80, - child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + margin: EdgeInsets.only(top: 5), + width: 60, + height: 60, + child: Image.asset( + widget.reply.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), - SizedBox(width: 15,), - Expanded( - child: Container( - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - widget.reply.patientName, - fontSize: 1.5 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 5, - ), + ], + ), + SizedBox( + width: 20, + ), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // SizedBox(height: 10,), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, - Row( - children: [ - AppText( - TranslationBase.of(context).fileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - '${widget.reply.patientID}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), - ], - ), - SizedBox( - height: 5, - ), - Row( - children: [ - AppText( - TranslationBase.of(context).mobileNo, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - Container( - margin: EdgeInsets.only(left: 5), - child: AppText( - widget.reply.mobileNumber, - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - ), + children: [ + + RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).fileNumber, + style: TextStyle( + fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold, fontFamily: 'Poppins')), + new TextSpan( + text: widget.reply.patientID.toString(), + style: TextStyle( + fontWeight: FontWeight.w700, + fontFamily: 'Poppins', + fontSize: 15)), ], ), - SizedBox( - height: 5, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - width: 70, - height: 20, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(60.0)), - color: Colors.green[600] - ), - child: Center( - child: AppText( - widget.reply.requestTime, - fontSize: 1.5 * SizeConfig.textMultiplier, - color: Colors.white, - ), - ), - ), - Container( - - child: AppText( - '${Helpers.getDate(widget.reply.requestDate)}', - fontSize: 1.7 * SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - color: Colors.black, - ), + ), + Container( + width: MediaQuery.of(context).size.width*0.45, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', ), - ], + children: [ + new TextSpan( + text: TranslationBase.of(context).age + + " : ", + style: TextStyle(fontSize: 14,color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(widget.reply.dateofBirth, context)}", + style: TextStyle( + fontWeight: FontWeight.w700, + fontSize: 15)), + ], + ), ), - - ], - ), + ) + ], ), - ) - ], - ), - ), - !widget.isShowMore ? SizedBox(height: 18,) : - AnimatedContainer( - duration: Duration(milliseconds: 200), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Divider(color: Colors.grey), - SizedBox(height: 5,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).remarks + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.remarks, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), ], ), - SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).doctorResponse + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.doctorResponse, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), + Container( + width: MediaQuery.of(context).size.width * 0.5, + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 2.0 * SizeConfig.textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: TranslationBase.of(context).doctorResponse + " : ", + style: + TextStyle(fontSize: 14, fontFamily: 'Poppins', color: Color(0xFF575757),fontWeight: FontWeight.bold)), + new TextSpan( + text: widget.reply.remarks, + style: TextStyle( + fontFamily: 'Poppins', + color: Color(0xFF575757), + fontSize: 15)), + ], ), - ], - ),SizedBox(height: 10,), - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).infoStatus + " : ", - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ),Expanded( - child: AppText( - widget.reply.infoStatus, - fontSize: 2.5 * SizeConfig.textMultiplier, - //fontWeight: FontWeight.bold, - ), - ), - ], - ) - ], - ), + ), + ), + ],) + ], ), - ], - ), + SizedBox( + height: 20, + ), + ], ), - ), - Positioned( - right: 5, - top: 20, - child: InkWell( - onTap: (){ - setState(() { - widget.isShowMore = !widget.isShowMore; - }); - }, - child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), - ) - ], - + // onTap: onTap, + )), + ), ); + // Stack( + // children: [ + // Container( + // margin: EdgeInsets.symmetric(vertical: 10.0), + // width: double.infinity, + // decoration: BoxDecoration( + // color: HexColor('#FFFFFF'), + // borderRadius: BorderRadius.all( + // Radius.circular(20.0), + // ), + // ), + // child: Container( + // margin: EdgeInsets.all(5), + // child: Column( + // children: [ + // SizedBox(height: 18,), + // Container( + // margin: EdgeInsets.only(right: 15), + // child: Row( + // children: [ + // SizedBox(width: 5,), + // //LargeAvatar(icon: widget.reply.gender == 0 ? DoctorApp.male : DoctorApp.femaleicon ,), + // Container( + // decoration: BoxDecoration( + // gradient: LinearGradient( + // begin: Alignment(-1, -1), + // end: Alignment(1, 1), + // colors: [ + // Colors.grey[100], + // Colors.grey[200], + // ]), + // boxShadow: [ + // BoxShadow( + // color: Color.fromRGBO(0, 0, 0, 0.08), + // offset: Offset(0.0, 5.0), + // blurRadius: 16.0) + // ], + // borderRadius: BorderRadius.all(Radius.circular(50.0)), + // ), + // width: 80, + // height: 80, + // child: Icon(widget.reply.gender == 1 ? DoctorApp.male : DoctorApp.female_icon,size: 80,)), + // + // SizedBox(width: 15,), + // Expanded( + // child: Container( + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // widget.reply.patientName, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // SizedBox( + // height: 5, + // ), + // + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).fileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // '${widget.reply.patientID}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // children: [ + // AppText( + // TranslationBase.of(context).mobileNo, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // Container( + // margin: EdgeInsets.only(left: 5), + // child: AppText( + // widget.reply.mobileNumber, + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox( + // height: 5, + // ), + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // Container( + // width: 70, + // height: 20, + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all(Radius.circular(60.0)), + // color: Colors.green[600] + // ), + // child: Center( + // child: AppText( + // widget.reply.requestTime, + // fontSize: 1.5 * SizeConfig.textMultiplier, + // color: Colors.white, + // ), + // ), + // ), + // Container( + // + // child: AppText( + // '${Helpers.getDate(widget.reply.requestDate)}', + // fontSize: 1.7 * SizeConfig.textMultiplier, + // fontWeight: FontWeight.bold, + // color: Colors.black, + // ), + // ), + // ], + // ), + // + // ], + // ), + // ), + // ) + // + // ], + // ), + // ), + // + // !widget.isShowMore ? SizedBox(height: 18,) : + // AnimatedContainer( + // duration: Duration(milliseconds: 200), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // Divider(color: Colors.grey), + // SizedBox(height: 5,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).remarks + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.remarks, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ), + // SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).doctorResponse + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.doctorResponse, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ),SizedBox(height: 10,), + // Row( + // mainAxisAlignment: MainAxisAlignment.start, + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // AppText( + // TranslationBase.of(context).infoStatus + " : ", + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ),Expanded( + // child: AppText( + // widget.reply.infoStatus, + // fontSize: 2.5 * SizeConfig.textMultiplier, + // //fontWeight: FontWeight.bold, + // ), + // ), + // ], + // ) + // ], + // ), + // ), + // + // ], + // ), + // ), + // ), + // Positioned( + // right: 5, + // top: 20, + // child: InkWell( + // onTap: (){ + // setState(() { + // widget.isShowMore = !widget.isShowMore; + // }); + // }, + // child: Icon(widget.isShowMore? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down)), + // ) + // ], + // + // ); } } From e4bfdd198be189a63b15895704930d0207569847 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Mon, 29 Mar 2021 17:53:41 +0300 Subject: [PATCH 414/421] Add Prescription Form New Design --- .../prescription/add_prescription_form.dart | 117 ++++++++++++------ lib/widgets/shared/app_buttons_widget.dart | 5 +- 2 files changed, 83 insertions(+), 39 deletions(-) diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 0ca9b49e..a7e10f25 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -225,6 +225,7 @@ class _PrescriptionFormWidgetState extends State { return SingleChildScrollView( child: Container( height: MediaQuery.of(context).size.height * 1.45, + color: Color(0xffF8F8F8), child: Padding( padding: EdgeInsets.symmetric( horizontal: 12.0, vertical: 10.0), @@ -232,9 +233,26 @@ class _PrescriptionFormWidgetState extends State { crossAxisAlignment: CrossAxisAlignment.start, //mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ - AppText( - TranslationBase.of(context).medicines.toUpperCase(), - fontWeight: FontWeight.w900, + Row( + children: [ + AppText( + 'New Prescription Order', + fontWeight: FontWeight.w700, + fontSize: 20, + ), + SizedBox( + width: MediaQuery.of(context).size.width * 0.32, + ), + InkWell( + child: Icon( + Icons.close, + size: 23.0, + ), + onTap: () { + Navigator.pop(context); + }, + ) + ], ), SizedBox( height: spaceBetweenTextFileds, @@ -248,6 +266,7 @@ class _PrescriptionFormWidgetState extends State { Container( height: MediaQuery.of(context).size.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -340,17 +359,17 @@ class _PrescriptionFormWidgetState extends State { itemID: _selectedMedication .itemId); }, - decoration: - textFieldSelectorDecoration( - TranslationBase.of(context) - .searchMedicineNameHere, - _selectedMedication != null - ? _selectedMedication - .description + - ('${_selectedMedication.genericName}') - : null, - true, - ), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context) + .searchMedicineNameHere, + _selectedMedication != null + ? _selectedMedication + .description + + ('${_selectedMedication.genericName}') + : null, + false, + suffixIcon: + Icon(Icons.search)), enabled: false, ), ), @@ -361,7 +380,10 @@ class _PrescriptionFormWidgetState extends State { Container( child: Row( children: [ - AppText('Order Type'), + AppText( + 'Order Type', + fontWeight: FontWeight.w600, + ), Radio( activeColor: Color(0xFFB9382C), value: 1, @@ -445,6 +467,7 @@ class _PrescriptionFormWidgetState extends State { width: 10.0, ), Container( + color: Colors.white, width: MediaQuery.of(context) .size .width * @@ -489,7 +512,7 @@ class _PrescriptionFormWidgetState extends State { child: TextField( decoration: textFieldSelectorDecoration( - 'UNIT Type', + 'UNIT', units != null ? units['description'] : null, @@ -504,6 +527,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.itemMedicineListRoute != null ? () { @@ -553,6 +577,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.itemMedicineList != null ? () { @@ -620,6 +645,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.medicationDoseTimeList != null @@ -667,6 +693,7 @@ class _PrescriptionFormWidgetState extends State { Container( height: screenSize.height * 0.070, width: double.infinity, + color: Colors.white, child: Row( children: [ Container( @@ -692,7 +719,7 @@ class _PrescriptionFormWidgetState extends State { indication != null ? indication['name'] : null, - true), + false), enabled: true, readOnly: true, ), @@ -703,6 +730,7 @@ class _PrescriptionFormWidgetState extends State { .size .width * 0.65, + color: Colors.white, child: InkWell( onTap: indicationList != null ? () { @@ -722,7 +750,7 @@ class _PrescriptionFormWidgetState extends State { indication != null ? indication['name'] : null, - true), + false), enabled: true, readOnly: true, ), @@ -734,22 +762,21 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: () => selectDate(context, widget.model), child: TextField( - decoration: - Helpers.textFieldSelectorDecoration( - TranslationBase.of(context) - .date, - selectedDate != null - ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" - : null, - true, - suffixIcon: Icon( - Icons.calendar_today, - color: Colors.black, - )), + decoration: textFieldSelectorDecoration( + TranslationBase.of(context).date, + selectedDate != null + ? "${DateUtils.convertStringToDateFormat(selectedDate.toString(), "yyyy-MM-dd")}" + : null, + true, + suffixIcon: Icon( + Icons.calendar_today, + color: Colors.black, + )), enabled: false, ), ), @@ -757,6 +784,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.medicationDurationList != null @@ -825,6 +853,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -857,7 +886,7 @@ class _PrescriptionFormWidgetState extends State { decoration: textFieldSelectorDecoration( "UOM", uom != null ? uom : null, - true), + false), //enabled: false, readOnly: true, ), @@ -866,6 +895,7 @@ class _PrescriptionFormWidgetState extends State { SizedBox(height: spaceBetweenTextFileds), Container( height: screenSize.height * 0.070, + color: Colors.white, child: InkWell( onTap: model.allMedicationList != null ? () { @@ -901,7 +931,7 @@ class _PrescriptionFormWidgetState extends State { ? "Box Quantity: " + model.boxQuintity.toString() : null, - true), + false), //enabled: false, readOnly: true, ), @@ -932,8 +962,10 @@ class _PrescriptionFormWidgetState extends State { alignment: WrapAlignment.center, children: [ AppButton( + color: Color(0xff359846), title: TranslationBase.of(context) .addMedication, + fontWeight: FontWeight.w600, onPressed: () { // formKey.currentState.save(); // Navigator.pop(context); @@ -1093,11 +1125,11 @@ class _PrescriptionFormWidgetState extends State { borderRadius: BorderRadius.circular(8), ), enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), borderRadius: BorderRadius.circular(8), ), disabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderSide: BorderSide(color: Color(0xFFEFEFEF), width: 2.0), borderRadius: BorderRadius.circular(8), ), hintText: selectedText != null ? selectedText : hintText, @@ -1105,13 +1137,22 @@ class _PrescriptionFormWidgetState extends State { ? suffixIcon != null ? suffixIcon : Icon( - Icons.arrow_drop_down, - color: Colors.black, + Icons.keyboard_arrow_down_sharp, + color: Color(0xff2E303A), ) : null, hintStyle: TextStyle( - fontSize: 14, - color: Colors.grey.shade600, + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + ), + labelText: selectedText != null ? '$hintText\n$selectedText' : null, + labelStyle: TextStyle( + fontSize: 13, + color: Color(0xff2E303A), + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, ), ); } diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index 38a66595..165e1680 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -15,6 +15,7 @@ class AppButton extends StatefulWidget { final Color fontColor; final bool loading; final bool disabled; + final FontWeight fontWeight; AppButton( {@required this.onPressed, @@ -25,7 +26,8 @@ class AppButton extends StatefulWidget { this.padding = 13, this.loading = false, this.disabled = false, - this.fontColor = Colors.white}); + this.fontColor = Colors.white, + this.fontWeight}); _AppButtonState createState() => _AppButtonState(); } @@ -76,6 +78,7 @@ class _AppButtonState extends State { widget.title.toUpperCase(), color: widget.fontColor, fontSize: SizeConfig.textMultiplier * widget.fontSize, + fontWeight: widget.fontWeight, ), ], ), From e14e004700b62b361f8f5bf720a6a490f468d438 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 30 Mar 2021 11:57:54 +0300 Subject: [PATCH 415/421] page updated --- lib/config/localized_values.dart | 7 +- .../reschedule-leaves/reschedule_leave.dart | 229 ++++++------- lib/screens/sick-leave/add-sickleave.dart | 310 ++++++++++++------ lib/screens/sick-leave/show-sickleave.dart | 113 ++++--- lib/util/translations_delegate_base.dart | 1 + 5 files changed, 405 insertions(+), 255 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 18bc5118..5a66b0ae 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -277,7 +277,7 @@ const Map> localizedValues = { "doc-name": {"en": "Doctor Name", "ar": "اسم الطبيب"}, "clinicname": {"en": "Clinic Name", "ar": "اسم العيادة"}, "sick-leave-date": {"en": "Sick leave date ", "ar": "تاريخ الاجازة."}, - "sick-leave-days": {"en": "Sick leave days", "ar": "عدد ايام الاجازة."}, + "sick-leave-days": {"en": "Leave Days: ", "ar": " :أيام الإجازة"}, 'admissionDetail': {'en': 'ADMISSION DETAIL: ', 'ar': 'تفاصيل القبول: '}, 'dateTime': {'en': 'DATE / TIME:', 'ar': 'التاريخ / الوقت:'}, 'date': {'en': 'Date', 'ar': 'التاريخ'}, @@ -302,8 +302,8 @@ const Map> localizedValues = { "ar": "يرجى ادخال هذا الحقل" }, 'no-sickleve-applied': { - 'en': "No sick leave applied", - 'ar': 'لم تطبق إجازة مرضية' + 'en': "No sick leave available, apply Now", + 'ar': 'لا توجد إجازة مرضية متاحة ، تقدم بطلب الآن' }, 'applynow': {'en': "Apply Now", 'ar': 'قدم الآن'}, 'add-sickleave': {'en': "ADD SICK LEAVE", 'ar': 'أضف إجازة مرضية'}, @@ -802,4 +802,5 @@ const Map> localizedValues = { "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, + "sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, }; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e873f9b1..7af6b72c 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -128,121 +128,121 @@ class _RescheduleLeaveScreen extends State { widthFactor: 0.9, child: ListView( children: [ - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - 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: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - mainAxisSize: MainAxisSize.max, - children: [ - Expanded( - // add Expanded to have your dropdown button fill remaining space - child: - DropdownButtonHideUnderline( - child: new IgnorePointer( - ignoring: true, - child: DropdownButton( - focusColor: - Colors.grey, - isExpanded: true, - dropdownColor: - Colors.grey, - value: getClinicName( - model) ?? - "", - iconSize: 0, - elevation: 16, - selectedItemBuilder: - (BuildContext - context) { - return model - .getClinicNameList() - .map((item) { - return Row( - mainAxisSize: - MainAxisSize - .max, - children: < - Widget>[ - AppText( - item, - fontSize: - SizeConfig.textMultiplier * - 2.1, - color: Colors - .grey[ - 500], - ), - ], - ); - }).toList(); - }, - onChanged: - (newValue) => - {}, - items: model - .getClinicNameList() - .map((item) { - return DropdownMenuItem( - value: item - .toString(), - child: Text( - item, - textAlign: - TextAlign - .end, - ), - ); - }).toList(), - ))), - ), - ], - ) - ], - ), - )), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: BorderRadius.all( + // Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // 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: Column( + // crossAxisAlignment: + // CrossAxisAlignment.start, + // children: [ + // Row( + // mainAxisSize: MainAxisSize.max, + // children: [ + // Expanded( + // // add Expanded to have your dropdown button fill remaining space + // child: + // DropdownButtonHideUnderline( + // child: new IgnorePointer( + // ignoring: true, + // child: DropdownButton( + // focusColor: + // Colors.grey, + // isExpanded: true, + // dropdownColor: + // Colors.grey, + // value: getClinicName( + // model) ?? + // "", + // iconSize: 0, + // elevation: 16, + // selectedItemBuilder: + // (BuildContext + // context) { + // return model + // .getClinicNameList() + // .map((item) { + // return Row( + // mainAxisSize: + // MainAxisSize + // .max, + // children: < + // Widget>[ + // AppText( + // item, + // fontSize: + // SizeConfig.textMultiplier * + // 2.1, + // color: Colors + // .grey[ + // 500], + // ), + // ], + // ); + // }).toList(); + // }, + // onChanged: + // (newValue) => + // {}, + // items: model + // .getClinicNameList() + // .map((item) { + // return DropdownMenuItem( + // value: item + // .toString(), + // child: Text( + // item, + // textAlign: + // TextAlign + // .end, + // ), + // ); + // }).toList(), + // ))), + // ), + // ], + // ) + // ], + // ), + // )), - Container( - margin: EdgeInsets.all(8), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), - padding: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - new IgnorePointer( - ignoring: true, - child: AppTextFormField( - readOnly: true, - hintText: profile != null - ? profile['DoctorName'] - : "", - borderColor: Colors.white, - onSaved: (value) {}, - inputFormatter: ONLY_NUMBERS)) - ], - ), - ), + // Container( + // margin: EdgeInsets.all(8), + // decoration: BoxDecoration( + // borderRadius: + // BorderRadius.all(Radius.circular(6.0)), + // border: Border.all( + // width: 1.0, + // color: HexColor("#CCCCCC"))), + // padding: EdgeInsets.all(5), + // child: Column( + // crossAxisAlignment: CrossAxisAlignment.start, + // children: [ + // new IgnorePointer( + // ignoring: true, + // child: AppTextFormField( + // readOnly: true, + // hintText: profile != null + // ? profile['DoctorName'] + // : "", + // borderColor: Colors.white, + // onSaved: (value) {}, + // inputFormatter: ONLY_NUMBERS)) + // ], + // ), + // ), Container( margin: EdgeInsets.all(8), @@ -842,6 +842,7 @@ class _RescheduleLeaveScreen extends State { ], ), )), + SizedBox(height: SizeConfig.screenHeight * .3), Container( margin: EdgeInsets.all( SizeConfig.widthMultiplier * 5), diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index ad74b760..3c4cac26 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -6,12 +6,15 @@ 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/date-utils.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/patients/profile/patient-profile-header-new-design.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:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -25,19 +28,94 @@ class AddSickLeavScreen extends StatelessWidget { onModelReady: (model) => model.getSickLeave(patient.patientMRN), builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).sickleave, body: SingleChildScrollView( child: Column(children: [ - PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign( + patient, routeArgs['patientType'], routeArgs['arrivalType']), + Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ], + )), + Container( + width: SizeConfig.screenWidth, + margin: EdgeInsets.only( + left: 20, right: 20, top: 10, bottom: 10), + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HexColor('#EAEAEA')), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: BorderRadius.circular(10)), + padding: EdgeInsets.all(3), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + )), + Padding( + child: AppText( + TranslationBase.of(context).noSickLeaveApplied, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 16, + textAlign: TextAlign.center, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + )), + ], + ), model.getAllSIckLeave.length > 0 ? Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { - return CardWithBgWidgetNew( - widget: Column( + return RoundedContainer( + child: Column( children: [ Container( - padding: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -66,42 +144,77 @@ class AddSickLeavScreen extends StatelessWidget { context) .all, fontWeight: FontWeight.bold, - color: Colors.white, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, ), - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + ), + Row( + children: [ + AppText(TranslationBase.of( + context) + .daysSickleave), + AppText( + item.noOfDays.toString(), + fontWeight: FontWeight.bold, + ), + ], ), Row( children: [ AppText( TranslationBase.of(context) - .leaveStartDate + + .startDate + ' ', - fontWeight: FontWeight.bold, ), Flexible( - child: Text( - item.startDate, - overflow: - TextOverflow.ellipsis, + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - AppText( - item.noOfDays.toString() + - ' ' + - TranslationBase.of(context) - .daysSickleave, - fontWeight: FontWeight.bold, - ), - Row(children: [ - AppText( - item.remarks ?? "", - ) - ]), + Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1 || + item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == + 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + else + { + openSickLeave( + context, + true, + extendedData: + item) + } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -110,86 +223,81 @@ class AddSickLeavScreen extends StatelessWidget { ], ), ), - (item.status == 1 || item.status == 2) - ? Expanded( - flex: 1, - child: IconButton( - icon: Icon( - Icons.open_in_full, - size: 25, - color: item.status == 1 - ? Colors.grey[400] - : Colors.black, - ), - // color: Colors.green, //Colors.black, - onPressed: () => { - if (item.status == 1) - { - DrAppToastMsg.showErrorToast( - TranslationBase.of( - context) - .sickleaveonhold) - } - else - { - openSickLeave(context, true, - extendedData: item) - } - }, - )) - : SizedBox(), ], )), - SizedBox( - height: 20, - ), - Divider( - height: 1, - ), ], )); }).toList(), ) : new Builder(builder: (context) { - return Container( - height: MediaQuery.of(context).size.height * .7, - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - padding: EdgeInsets.all(40), - decoration: BoxDecoration( - border: Border.all( - color: HexColor('#B8382C'), width: 4), - borderRadius: - BorderRadius.all(Radius.circular(100))), - child: IconButton( - icon: Icon( - Icons.add, - size: 35, - ), - onPressed: () { - openSickLeave( - context, - false, - ); - }), - ), - Padding( - child: AppText( - TranslationBase.of(context) - .noSickLeaveApplied, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10), - ), - AppText( - TranslationBase.of(context).applyNow, - fontWeight: FontWeight.bold, - color: HexColor('#B8382C'), - ) - ], - )); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).patient, + fontWeight: FontWeight.bold, + ), + AppText( + TranslationBase.of(context).sickLeave, + fontSize: 24, + fontWeight: FontWeight.bold, + ), + ], + )), + Container( + width: SizeConfig.screenWidth, + margin: EdgeInsets.only( + left: 20, right: 20, top: 20, bottom: 20), + padding: EdgeInsets.all(20), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: HexColor('#EAEAEA')), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Container( + child: Container( + decoration: BoxDecoration( + color: Colors.grey, + borderRadius: + BorderRadius.circular(10)), + padding: EdgeInsets.all(3), + child: IconButton( + icon: Icon( + Icons.add, + size: 35, + color: Colors.white, + ), + onPressed: () { + openSickLeave( + context, + false, + ); + }), + )), + Padding( + child: AppText( + TranslationBase.of(context) + .noSickLeaveApplied, + fontWeight: FontWeight.bold, + fontFamily: 'Poppins', + fontSize: 16, + textAlign: TextAlign.center, + color: HexColor('#7E7E7E')), + padding: EdgeInsets.all(10), + ), + ], + )), + SizedBox( + height: SizeConfig.screenHeight * .6, + ) + ], + ); }), ])))); } diff --git a/lib/screens/sick-leave/show-sickleave.dart b/lib/screens/sick-leave/show-sickleave.dart index c3bd3178..52ec7094 100644 --- a/lib/screens/sick-leave/show-sickleave.dart +++ b/lib/screens/sick-leave/show-sickleave.dart @@ -6,12 +6,15 @@ 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/date-utils.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/patients/profile/patient-profile-header-new-design.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:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -23,22 +26,34 @@ class ShowSickLeaveScreen extends StatelessWidget { final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patient']; return BaseView( - onModelReady: (model) => model.getSickLeave(patient.patientMRN ?? patient.patientId), + 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), + PatientProfileHeaderNewDesign( + patient, routeArgs['patientType'], routeArgs['arrivalType']), Column( children: model.getAllSIckLeave .map((GetAllSickLeaveResponse item) { - return CardWithBgWidgetNew( - widget: Column( + return RoundedContainer( + child: Column( children: [ Container( - padding: EdgeInsets.only(left: 10, right: 10), + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, + width: 5.0, + ))), + padding: EdgeInsets.all(10), child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ @@ -66,41 +81,74 @@ class ShowSickLeaveScreen extends StatelessWidget { context) .all, fontWeight: FontWeight.bold, - color: Colors.white, + color: item.status == 1 + ? Colors.yellow[800] + : item.status == 2 + ? Colors.green + : Colors.black, ), - color: item.status == 1 - ? Colors.yellow[800] - : item.status == 2 - ? Colors.green - : Colors.black, + ), + Row( + children: [ + AppText(TranslationBase.of(context) + .daysSickleave), + AppText( + item.noOfDays.toString(), + fontWeight: FontWeight.bold, + ), + ], ), Row( children: [ AppText( TranslationBase.of(context) - .leaveStartDate + + .startDate + ' ', - fontWeight: FontWeight.bold, ), Flexible( - child: Text( - item.startDate, - overflow: TextOverflow.ellipsis, + child: AppText( + DateUtils + .convertStringToDateFormat( + item.startDate, + 'dd-MMM-yyyy'), + fontWeight: FontWeight.bold, )) ], ), - AppText( - item.noOfDays.toString() + - ' ' + - TranslationBase.of(context) - .daysSickleave, - fontWeight: FontWeight.bold, - ), - Row(children: [ - AppText( - item.remarks ?? "", - ) - ]), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + AppText( + item.remarks ?? "", + ), + (item.status == 1 || + item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + + // color: Colors.green, //Colors.black, + onPressed: () => { + if (item.status == 1) + { + DrAppToastMsg.showErrorToast( + TranslationBase.of( + context) + .sickleaveonhold) + } + // else + // { + // openSickLeave( + // context, + // true, + // extendedData: + // item) + // } + }, + ) + : SizedBox() + ]), ], ), SizedBox( @@ -109,15 +157,8 @@ class ShowSickLeaveScreen extends StatelessWidget { ], ), ), - ], )), - SizedBox( - height: 20, - ), - Divider( - height: 1, - ), ], )); }).toList(), @@ -128,6 +169,4 @@ class ShowSickLeaveScreen extends StatelessWidget { ), ); } - - } diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index b2ed3aff..83f43cbc 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1184,6 +1184,7 @@ class TranslationBase { localizedValues['add-reschedule'][locale.languageCode]; String get updateReschedule => localizedValues['update-reschedule'][locale.languageCode]; + String get sickLeave => localizedValues['sick_leave'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From 672535fc94679fac05bb58a0dc76650809cb5909 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 30 Mar 2021 12:25:52 +0300 Subject: [PATCH 416/421] add Lab Order Form & Radiology --- lib/screens/procedures/add_lab_orders.dart | 319 ++++++++++++++++++ .../procedures/add_radiology_order.dart | 319 ++++++++++++++++++ .../entity_list_checkbox_search_widget.dart | 95 +++--- 3 files changed, 690 insertions(+), 43 deletions(-) create mode 100644 lib/screens/procedures/add_lab_orders.dart create mode 100644 lib/screens/procedures/add_radiology_order.dart diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart new file mode 100644 index 00000000..ada0641b --- /dev/null +++ b/lib/screens/procedures/add_lab_orders.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +import 'entity_list_checkbox_search_widget.dart'; +import 'entity_list_procedure_widget.dart'; + +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, + List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + + procedureValadteRequestModel.patientMRN = patient.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; +} + +postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + helpers.showErrorToast(model.error); + } +} + +void addSelectedLabOrder( + context, ProcedureViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return AddSelectedLabOrder( + model: model, + patient: patient, + ); + }); +} + +class AddSelectedLabOrder extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + + const AddSelectedLabOrder({Key key, this.model, this.patient}) + : super(key: key); + @override + _AddSelectedLabOrderState createState() => + _AddSelectedLabOrderState(patient: patient, model: model); +} + +class _AddSelectedLabOrderState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedLabOrderState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + List entityListProcedure = List(); + + dynamic selectedCategory; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getProcedureCategory( + categoryName: "Laboratory", categoryID: "02"), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'New Lab Order', + fontWeight: FontWeight.w900, + fontSize: 18.0, + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart new file mode 100644 index 00000000..c523c2b0 --- /dev/null +++ b/lib/screens/procedures/add_radiology_order.dart @@ -0,0 +1,319 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/viewstate.dart'; +import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; +import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; +import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; +import 'package:doctor_app_flutter/core/model/procedure/procedure_valadate_request_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.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/dr_app_toast_msg.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/shared/TextFields.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/dialogs/dailog-list-select.dart'; +import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; +import 'package:flutter/material.dart'; + +import 'entity_list_checkbox_search_widget.dart'; +import 'entity_list_procedure_widget.dart'; + +valdateProcedure(ProcedureViewModel model, PatiantInformtion patient, + List entityList) async { + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + + procedureValadteRequestModel.patientMRN = patient.appointmentNo; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; +} + +postProcedure( + {ProcedureViewModel model, + String remarks, + String orderType, + PatiantInformtion patient, + List entityList}) async { + PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); + ProcedureValadteRequestModel procedureValadteRequestModel = + new ProcedureValadteRequestModel(); + procedureValadteRequestModel.patientMRN = patient.patientMRN; + procedureValadteRequestModel.episodeID = patient.episodeNo; + procedureValadteRequestModel.appointmentNo = patient.appointmentNo; + + List controlsProcedure = List(); + + postProcedureReqModel.appointmentNo = patient.appointmentNo; + + postProcedureReqModel.episodeID = patient.episodeNo; + postProcedureReqModel.patientMRN = patient.patientMRN; + + entityList.forEach((element) { + procedureValadteRequestModel.procedure = [element.procedureId]; + List controls = List(); + controls.add( + Controls( + code: "remarks", + controlValue: element.remarks != null ? element.remarks : ""), + ); + controls.add( + Controls(code: "ordertype", controlValue: "0"), + ); + controlsProcedure.add(Procedures( + category: element.categoryID, + procedure: element.procedureId, + controls: controls)); + }); + + postProcedureReqModel.procedures = controlsProcedure; + await model.valadteProcedure(procedureValadteRequestModel); + if (model.state == ViewState.Idle) { + if (model.valadteProcedureList[0].entityList.length == 0) { + await model.postProcedure(postProcedureReqModel, patient.patientMRN); + + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + DrAppToastMsg.showSuccesToast('procedure has been added'); + } + } else { + if (model.state == ViewState.ErrorLocal) { + helpers.showErrorToast(model.error); + model.getProcedure(mrn: patient.patientMRN); + } else if (model.state == ViewState.Idle) { + helpers.showErrorToast( + model.valadteProcedureList[0].entityList[0].warringMessages); + } + } + } else { + helpers.showErrorToast(model.error); + } +} + +void addSelectedRadiologyOrder( + context, ProcedureViewModel model, PatiantInformtion patient) { + showModalBottomSheet( + context: context, + isScrollControlled: true, + builder: (BuildContext bc) { + return AddSelectedRadiologyOrder( + model: model, + patient: patient, + ); + }); +} + +class AddSelectedRadiologyOrder extends StatefulWidget { + final ProcedureViewModel model; + final PatiantInformtion patient; + + const AddSelectedRadiologyOrder({Key key, this.model, this.patient}) + : super(key: key); + @override + _AddSelectedRadiologyOrderState createState() => + _AddSelectedRadiologyOrderState(patient: patient, model: model); +} + +class _AddSelectedRadiologyOrderState extends State { + int selectedType; + ProcedureViewModel model; + PatiantInformtion patient; + _AddSelectedRadiologyOrderState({this.patient, this.model}); + TextEditingController procedureController = TextEditingController(); + TextEditingController remarksController = TextEditingController(); + List entityList = List(); + List entityListProcedure = List(); + + dynamic selectedCategory; + + setSelectedType(int val) { + setState(() { + selectedType = val; + }); + } + + @override + Widget build(BuildContext context) { + final screenSize = MediaQuery.of(context).size; + return BaseView( + onModelReady: (model) => model.getProcedureCategory( + categoryName: "Radiology", categoryID: "03"), + builder: (BuildContext context, ProcedureViewModel model, Widget child) => + NetworkBaseView( + baseViewModel: model, + child: DraggableScrollableSheet( + minChildSize: 0.90, + initialChildSize: 0.95, + maxChildSize: 1.0, + builder: (BuildContext context, ScrollController scrollController) { + return SingleChildScrollView( + child: Container( + height: MediaQuery.of(context).size.height * 1.20, + child: Padding( + padding: EdgeInsets.all(12.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'New Radiology Order', + fontWeight: FontWeight.w900, + fontSize: 18.0, + ), + SizedBox( + height: 10.0, + ), + if (widget.model.categoriesList.length != 0) + NetworkBaseView( + baseViewModel: model, + child: EntityListCheckboxSearchWidget( + model: widget.model, + masterList: + widget.model.categoriesList[0].entityList, + removeHistory: (item) { + setState(() { + entityList.remove(item); + }); + }, + addHistory: (history) { + setState(() { + entityList.add(history); + }); + }, + addSelectedHistories: () { + //TODO build your fun herr + // widget.addSelectedHistories(); + }, + isEntityListSelected: (master) => + isEntityListSelected(master), + )), + SizedBox( + height: 15.0, + ), + Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + // Container( + // child: Row( + // children: [ + // AppText( + // TranslationBase.of(context).orderType), + // Radio( + // activeColor: Color(0xFFB9382C), + // value: 1, + // groupValue: selectedType, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text('routine'), + // Radio( + // activeColor: Color(0xFFB9382C), + // groupValue: selectedType, + // value: 0, + // onChanged: (value) { + // setSelectedType(value); + // }, + // ), + // Text(TranslationBase.of(context).urgent), + // ], + // ), + // ), + // SizedBox( + // height: 15.0, + // ), + // TextFields( + // hintText: TranslationBase.of(context).remarks, + // controller: remarksController, + // minLines: 3, + // maxLines: 5, + // ), + SizedBox( + height: 100.0, + ), + Container( + margin: EdgeInsets.all( + SizeConfig.widthMultiplier * 5), + child: Wrap( + alignment: WrapAlignment.center, + children: [ + AppButton( + title: TranslationBase.of(context) + .addSelectedProcedures, + color: Color(0xff359846), + onPressed: () { + //print(entityList.toString()); + onPressed: + if (entityList.isEmpty == true) { + DrAppToastMsg.showErrorToast( + "Fill the mandatory procedure details"); + return; + } + + Navigator.pop(context); + postProcedure( + orderType: selectedType.toString(), + entityList: entityList, + patient: patient, + model: widget.model, + remarks: remarksController.text); + }, + ), + ], + ), + ), + ], + ) + ], + ), + ), + ), + ); + }), + ), + ); + } + + bool isEntityListSelected(EntityList masterKey) { + Iterable history = entityList + .where((element) => masterKey.procedureId == element.procedureId); + if (history.length > 0) { + return true; + } + return false; + } + + InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon}) { + return InputDecoration( + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + hintText: selectedText != null ? selectedText : hintText, + suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: Colors.black, + ) + : null, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + ); + } +} diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index b36f11c4..3426e4cd 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -69,7 +69,7 @@ class _EntityListCheckboxSearchWidgetState NetworkBaseView( baseViewModel: widget.model, child: Container( - height: MediaQuery.of(context).size.height * 0.45, + height: MediaQuery.of(context).size.height * 0.55, child: Center( child: Container( margin: EdgeInsets.only(top: 15), @@ -120,61 +120,70 @@ class _EntityListCheckboxSearchWidgetState historyInfo.procedureName, variant: "bodyText", bold: true, - color: Colors.black), + color: Color(0xff575757)), ), ), ], ), children: [ Container( - child: Row( - children: [ - AppText(TranslationBase.of(context) - .orderType), - Radio( - activeColor: Color(0xFFB9382C), - value: 0, - groupValue: selectedType, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + child: Padding( + padding: EdgeInsets.symmetric( + horizontal: 12), + child: Row( + children: [ + AppText( + TranslationBase.of(context) + .orderType), + Radio( + activeColor: Color(0xFFB9382C), + value: 0, + groupValue: selectedType, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); - historyInfo.type = - value.toString(); - }, - ), - Text('routine'), - Radio( - activeColor: Color(0xFFB9382C), - groupValue: selectedType, - value: 1, - onChanged: (value) { - historyInfo.type = - setSelectedType(value) - .toString(); + historyInfo.type = + value.toString(); + }, + ), + Text('routine'), + Radio( + activeColor: Color(0xFFB9382C), + groupValue: selectedType, + value: 1, + onChanged: (value) { + historyInfo.type = + setSelectedType(value) + .toString(); - historyInfo.type = - value.toString(); - }, - ), - Text(TranslationBase.of(context) - .urgent), - ], + historyInfo.type = + value.toString(); + }, + ), + Text(TranslationBase.of(context) + .urgent), + ], + ), ), ), SizedBox( height: 15.0, ), - TextFields( - hintText: - TranslationBase.of(context).remarks, - //controller: remarksController, - onChanged: (value) { - historyInfo.remarks = value; - }, - minLines: 3, - maxLines: 5, + Padding( + padding: EdgeInsets.symmetric( + horizontal: 12), + child: TextFields( + hintText: TranslationBase.of(context) + .remarks, + //controller: remarksController, + onChanged: (value) { + historyInfo.remarks = value; + }, + minLines: 3, + maxLines: 5, + ), ), ], ), From ee2e3fbbd6a3872ed7229af4d64db0b737417a20 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 30 Mar 2021 12:36:03 +0300 Subject: [PATCH 417/421] sick leave --- lib/screens/sick-leave/add-sickleave.dart | 34 +++--- lib/screens/sick-leave/sick_leave.dart | 135 +++++++++++++--------- 2 files changed, 99 insertions(+), 70 deletions(-) diff --git a/lib/screens/sick-leave/add-sickleave.dart b/lib/screens/sick-leave/add-sickleave.dart index 3c4cac26..1297a673 100644 --- a/lib/screens/sick-leave/add-sickleave.dart +++ b/lib/screens/sick-leave/add-sickleave.dart @@ -15,6 +15,7 @@ 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:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -304,20 +305,23 @@ class AddSickLeavScreen extends StatelessWidget { openSickLeave(BuildContext context, isExtend, {GetAllSickLeaveResponse extendedData}) { - showModalBottomSheet( - context: context, - builder: (context) { - return new Container( - child: SickLeaveScreen( - appointmentNo: isExtend == true - ? extendedData.appointmentNo - : patient.appointmentNo, //extendedData.appointmentNo, - patientMRN: isExtend == true - ? extendedData.patientMRN - : patient.patientMRN, - isExtended: isExtend, - extendedData: extendedData, - patient: patient)); - }); + // showModalBottomSheet( + // context: context, + // builder: (context) { + // return new Container( + // child: + Navigator.push( + context, + FadePage( + page: SickLeaveScreen( + appointmentNo: isExtend == true + ? extendedData.appointmentNo + : patient.appointmentNo, //extendedData.appointmentNo, + patientMRN: isExtend == true + ? extendedData.patientMRN + : patient.patientMRN, + isExtended: isExtend, + extendedData: extendedData, + patient: patient))); } } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index f8433fb0..8188c302 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -89,7 +89,10 @@ class _SickLeaveScreenState extends State { }, child: AppScaffold( baseViewModel: model2, - isShowAppBar: false, + appBarTitle: widget.isExtended == true + ? TranslationBase.of(context).extendSickLeave + : TranslationBase.of(context).addSickLeave, + isShowAppBar: true, body: Center( child: Container( margin: EdgeInsets.only(top: 10), @@ -97,29 +100,40 @@ class _SickLeaveScreenState extends State { widthFactor: 0.9, child: ListView( children: [ - Padding( - child: AppText( - widget.isExtended == true - ? TranslationBase.of(context) - .extendSickLeave - : TranslationBase.of(context) - .addSickLeave, - fontWeight: FontWeight.bold, - ), - padding: EdgeInsets.all(10)), + // Padding( + // child: AppText( + // widget.isExtended == true + // ? TranslationBase.of(context) + // .extendSickLeave + // : TranslationBase.of(context) + // .addSickLeave, + // fontWeight: FontWeight.bold, + // ), + // padding: EdgeInsets.all(10)), Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + width: 1.0, + color: HexColor("#CCCCCC"), + ), + color: Colors.white), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .sickLeave + + ' ' + + TranslationBase.of(context) + .days)), AppTextFormField( borderColor: Colors.white, onChanged: (value) { @@ -132,8 +146,7 @@ class _SickLeaveScreenState extends State { hintText: widget.extendedData != null ? widget.extendedData.noOfDays .toString() - : TranslationBase.of(context) - .sickLeaveDays, + : '', // validator: (value) { // return TextValidator().validateName(value); // }, @@ -146,25 +159,28 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).sickLeaveDate, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .sickLeaveDate, + )), AppTextFormField( hintText: widget.extendedData != null ? widget.extendedData.startDate - : TranslationBase.of(context) - .sickLeaveDate, + : '', borderColor: Colors.white, prefix: IconButton( icon: Icon(Icons.calendar_today)), @@ -188,11 +204,12 @@ class _SickLeaveScreenState extends State { margin: EdgeInsets.only( top: 10, left: 10, right: 10), decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), width: double.infinity, child: Padding( padding: EdgeInsets.only( @@ -205,10 +222,12 @@ class _SickLeaveScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).clinicName, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only(top: 5), + child: AppText( + TranslationBase.of(context) + .clinicName, + )), Row( mainAxisSize: MainAxisSize.max, children: [ @@ -291,19 +310,23 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).doctorName, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context) + .doctorName, + )), new IgnorePointer( ignoring: true, child: AppTextFormField( @@ -324,19 +347,22 @@ class _SickLeaveScreenState extends State { Container( margin: EdgeInsets.only(left: 10, right: 10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(6.0)), - border: Border.all( - width: 1.0, - color: HexColor("#CCCCCC"))), + borderRadius: + BorderRadius.all(Radius.circular(6.0)), + border: Border.all( + width: 1.0, color: HexColor("#CCCCCC")), + color: Colors.white, + ), padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - // AppText( - // TranslationBase.of(context).remarks, - // fontSize: 10, - // ), + Padding( + padding: EdgeInsets.only( + top: 5, left: 10, right: 10), + child: AppText( + TranslationBase.of(context).remarks, + )), TextField( maxLines: 3, decoration: InputDecoration( @@ -344,8 +370,7 @@ class _SickLeaveScreenState extends State { border: InputBorder.none, hintText: widget.extendedData != null ? widget.extendedData.remarks - : TranslationBase.of(context) - .remarks), + : ''), onChanged: (value) { addSickLeave.remarks = value; if (widget.extendedData != null) { From 9c111b07dddd3a2c88af46756cfcc6e51b8cefa6 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 30 Mar 2021 13:08:05 +0300 Subject: [PATCH 418/421] design updates --- lib/config/localized_values.dart | 8 + .../add-rescheduleleave.dart | 332 +++++++++--------- lib/screens/sick-leave/sick_leave.dart | 4 +- lib/util/translations_delegate_base.dart | 5 +- 4 files changed, 184 insertions(+), 165 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 5a66b0ae..662111d0 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -803,4 +803,12 @@ const Map> localizedValues = { "add-reschedule": {"en": "Add reschedule", "ar": "أضف إعادة الجدولة"}, "update-reschedule": {"en": "Update reschedule", "ar": "تحديث إعادة الجدولة"}, "sick_leave": {"en": "Sick Leave", "ar": "أجازة مرضية"}, + "addSickLeaveRequest": { + "en": "Add Sick Leave Request", + "ar": "إضافة طلب إجازة مرضية" + }, + "extendSickLeaveRequest": { + "en": "Extend Sick Leave Request", + "ar": "تمديد طلب الإجازة المرضية" + }, }; diff --git a/lib/screens/reschedule-leaves/add-rescheduleleave.dart b/lib/screens/reschedule-leaves/add-rescheduleleave.dart index dacbba72..aaafa380 100644 --- a/lib/screens/reschedule-leaves/add-rescheduleleave.dart +++ b/lib/screens/reschedule-leaves/add-rescheduleleave.dart @@ -26,7 +26,8 @@ class AddRescheduleLeavScreen extends StatelessWidget { baseViewModel: model, isShowAppBar: true, appBarTitle: TranslationBase.of(context).rescheduleLeaves, - body: Column(children: [ + body: SingleChildScrollView( + child: Column(children: [ Container( width: MediaQuery.of(context).size.width, margin: EdgeInsets.all(10), @@ -68,180 +69,185 @@ class AddRescheduleLeavScreen extends StatelessWidget { ], ), ), - Container( - height: MediaQuery.of(context).size.height * .65, - child: SingleChildScrollView( - child: Column( - children: model.getReschduleLeave - .map((GetRescheduleLeavesResponse item) { - return RoundedContainer( - child: Column( - children: [ - Container( - decoration: BoxDecoration( - border: Border( - left: BorderSide( - color: item.status == 1 - ? Colors.green - : item.status == 2 - ? HexColor('#CC9B14') - : Colors.red[800], - width: 5.0, - ))), - padding: EdgeInsets.only(left: 10, right: 10), - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Expanded( - flex: 4, - child: Wrap( + Column( + children: model.getReschduleLeave + .map((GetRescheduleLeavesResponse item) { + return RoundedContainer( + child: Column( + children: [ + Container( + decoration: BoxDecoration( + border: Border( + left: BorderSide( + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + width: 5.0, + ))), + padding: EdgeInsets.only(left: 10, right: 10), + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Expanded( + flex: 4, + child: Wrap( + children: [ + Column( + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Container( - padding: EdgeInsets.all(3), - margin: EdgeInsets.only(top: 10), - child: AppText( - item.status == 1 - ? TranslationBase.of( - context) - .approved - : item.status == 2 - ? TranslationBase.of( - context) - .pending - : TranslationBase.of( - context) - .rejected, - fontWeight: FontWeight.bold, - color: item.status == 1 - ? Colors.green - : item.status == 2 - ? HexColor('#CC9B14') - : Colors.red[800], - fontSize: 14, - ), - ), - SizedBox( - height: 5, - ), - Container( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: EdgeInsets.all(3), + margin: + EdgeInsets.only(top: 10), child: AppText( - item.requisitionType == 1 - ? TranslationBase.of(context) - .offTime - : TranslationBase.of(context) - .holiday + - ' ', - fontWeight: FontWeight.bold, - )), - SizedBox( - height: 5, - ), - Row(children: [ - AppText( - TranslationBase.of(context) - .startDate), - AppText( - DateUtils - .convertStringToDateFormat( - item.dateTimeFrom, - 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - ) - - // overflow: - // TextOverflow.ellipsis, + item.status == 1 + ? TranslationBase.of( + context) + .approved + : item.status == 2 + ? TranslationBase.of( + context) + .pending + : TranslationBase.of( + context) + .rejected, + fontWeight: FontWeight.bold, + color: item.status == 1 + ? Colors.green + : item.status == 2 + ? HexColor('#CC9B14') + : Colors.red[800], + fontSize: 14, + ), + ), + Padding( + padding: + EdgeInsets.only(top: 10), + child: AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + )) ]), + SizedBox( + height: 5, + ), + Container( + child: AppText( + item.requisitionType == 1 + ? TranslationBase.of(context) + .offTime + : TranslationBase.of(context) + .holiday + + ' ', + fontWeight: FontWeight.bold, + )), + SizedBox( + height: 5, + ), + Row(children: [ + AppText(TranslationBase.of(context) + .startDate), + AppText( + DateUtils.convertStringToDateFormat( + item.dateTimeFrom, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) - // overflow: - // TextOverflow.ellipsis, + // overflow: + // TextOverflow.ellipsis, + ]), - SizedBox( - height: 5, - ), - Row( - children: [ - AppText( - TranslationBase.of(context) - .endDate), - AppText( - DateUtils - .convertStringToDateFormat( - item.dateTimeTo, - 'yyyy-MM-dd HH:mm'), - fontWeight: FontWeight.bold, - ) - ], - ), + // overflow: + // TextOverflow.ellipsis, - SizedBox( - height: 5, - ), - model.coveringDoctors.length > 0 - ? Row(children: [ - AppText( - TranslationBase.of( - context) - .coveringDoctor, - ), - AppText( - getDoctor( - model.coveringDoctors, - item.coveringDoctorId), - fontWeight: - FontWeight.bold, - ) - ]) - : SizedBox(), - // AppText( - // TranslationBase.of(context) - // .reasons, - // fontWeight: FontWeight.bold, - // ), - Row( - mainAxisAlignment: - MainAxisAlignment - .spaceBetween, - children: [ - Padding( - padding: EdgeInsets.only( - bottom: 5), - child: AppText(getReasons( - model.allReasons, - item.reasonId))), - (item.status == 2) - ? IconButton( - icon: Image.asset( - 'assets/images/edit.png'), - // color: Colors.green, //Colors.black, - onPressed: () => { - openLeave( - context, true, - extendedData: - item) - }, - ) - : SizedBox(), - ]), + SizedBox( + height: 5, + ), + Row( + children: [ + AppText(TranslationBase.of(context) + .endDate), + AppText( + DateUtils + .convertStringToDateFormat( + item.dateTimeTo, + 'yyyy-MM-dd HH:mm'), + fontWeight: FontWeight.bold, + ) ], ), + SizedBox( - width: 10, + height: 5, ), + model.coveringDoctors.length > 0 + ? Row(children: [ + AppText( + TranslationBase.of(context) + .coveringDoctor, + ), + AppText( + getDoctor( + model.coveringDoctors, + item.coveringDoctorId), + fontWeight: FontWeight.bold, + ) + ]) + : SizedBox(), + // AppText( + // TranslationBase.of(context) + // .reasons, + // fontWeight: FontWeight.bold, + // ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Padding( + padding: EdgeInsets.only( + bottom: 5), + child: AppText(getReasons( + model.allReasons, + item.reasonId))), + (item.status == 2) + ? IconButton( + icon: Image.asset( + 'assets/images/edit.png'), + // color: Colors.green, //Colors.black, + onPressed: () => { + openLeave(context, true, + extendedData: item) + }, + ) + : SizedBox(), + ]), ], ), - ), - ], - )), - ], - ), - ); - }).toList(), - ))) - ])), + SizedBox( + width: 10, + ), + ], + ), + ), + ], + )), + ], + ), + ); + }).toList(), + ) + ]))), ); } diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 8188c302..12f157c2 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -390,7 +390,9 @@ class _SickLeaveScreenState extends State { AppButton( title: widget.isExtended == true ? TranslationBase.of(context).extend - : TranslationBase.of(context).add, + : TranslationBase.of(context) + .addSickLeaverequest, + color: Colors.green, onPressed: () async { if (widget.isExtended) { await model2.extendSickLeave( diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 83f43cbc..da9e5f75 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -523,7 +523,10 @@ class TranslationBase { localizedValues['add-sickleave'][locale.languageCode]; String get add => localizedValues['add'][locale.languageCode]; - + String get addSickLeaverequest => + localizedValues['addSickLeaveRequest'][locale.languageCode]; + String get extendSickLeaverequest => + localizedValues['extendSickLeaveRequest'][locale.languageCode]; String get approved => localizedValues['approved'][locale.languageCode]; String get extended => localizedValues['extended'][locale.languageCode]; From 83762fbd6ea1f37804468c7e8d8b73c97b88ef2d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 30 Mar 2021 16:32:02 +0300 Subject: [PATCH 419/421] change the lab result design --- .../lab_result/laboratory_result_page.dart | 44 +- .../profile/lab_result/labs_home_page.dart | 8 +- ..._profile_header_with_appointment_card.dart | 460 ++++++++++++++++++ 3 files changed, 496 insertions(+), 16 deletions(-) create mode 100644 lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart index 398479c4..ddbbcd45 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_page.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_page.dart @@ -3,18 +3,21 @@ import 'package:doctor_app_flutter/core/viewModel/labs_view_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'laboratory_result_widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; class LaboratoryResultPage extends StatefulWidget { final PatientLabOrders patientLabOrders; final PatiantInformtion patient; - - LaboratoryResultPage({Key key, this.patientLabOrders, this.patient}); + final String patientType; + final String arrivalType; + LaboratoryResultPage({Key key, this.patientLabOrders, this.patient, this.patientType, this.arrivalType}); @override _LaboratoryResultPageState createState() => _LaboratoryResultPageState(); @@ -31,22 +34,35 @@ class _LaboratoryResultPageState extends State { orderNo: widget.patientLabOrders.orderNo, patient: widget.patient), builder: (_, model, w) => AppScaffold( - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).labResults, + isShowAppBar: false, + // appBarTitle: TranslationBase.of(context).labResults, baseViewModel: model, body: Scaffold( - body: ListView.builder( - itemBuilder: (context, index) => LaboratoryResultWidget( - onTap: () async { + body: SingleChildScrollView( + child: Column( + children: [ + PatientProfileHeaderWhitAppointment(patient: widget.patient, + patientType: widget.patientType??"0", + arrivalType: widget.arrivalType??"0", + orderNo: widget.patientLabOrders.orderNo, + appointmentDate:widget.patientLabOrders.orderDate, + doctorName: widget.patientLabOrders.doctorName, + profileUrl: widget.patientLabOrders.doctorImageURL, + invoiceNO: widget.patientLabOrders.invoiceNo, + ), + ...List.generate(model.patientLabSpecialResult.length, (index) => LaboratoryResultWidget( + onTap: () async { + + }, + billNo: widget.patientLabOrders.invoiceNo, + details: model.patientLabSpecialResult[index].resultDataHTML, + orderNo: widget.patientLabOrders.orderNo, + patientLabOrder: widget.patientLabOrders, + patient: widget.patient, + )), - }, - billNo: widget.patientLabOrders.invoiceNo, - details: model.patientLabSpecialResult[index].resultDataHTML, - orderNo: widget.patientLabOrders.orderNo, - patientLabOrder: widget.patientLabOrders, - patient: widget.patient, + ], ), - itemCount: model.patientLabSpecialResult.length, ), ), ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index e2388156..1cf19edb 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -18,12 +18,14 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class LabsHomePage extends StatelessWidget { + String patientType; + String arrivalType; @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - String patientType = routeArgs['patient-type']; - String arrivalType = routeArgs['arrival-type']; + patientType = routeArgs['patient-type']; + arrivalType = routeArgs['arrival-type']; return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -63,6 +65,8 @@ class LabsHomePage extends StatelessWidget { page: LaboratoryResultPage( patientLabOrders: labOrder, patient: patient, + arrivalType: arrivalType, + patientType: patientType, ), ), ), diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart new file mode 100644 index 00000000..26f474e2 --- /dev/null +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card.dart @@ -0,0 +1,460 @@ +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; +import 'package:doctor_app_flutter/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/helpers.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/material.dart'; +import 'package:hexcolor/hexcolor.dart'; +import 'package:intl/intl.dart'; +import 'package:provider/provider.dart'; + +import 'large_avatar.dart'; + +class PatientProfileHeaderWhitAppointment extends StatelessWidget { + + final PatiantInformtion patient; + final String patientType; + final String arrivalType; + final String doctorName; + final String branch; + final DateTime appointmentDate; + final String profileUrl; + final String invoiceNO; + final String orderNo; + + PatientProfileHeaderWhitAppointment( + {this.patient, + this.patientType, + this.arrivalType, + this.doctorName, + this.branch, + this.appointmentDate, + this.profileUrl, + this.invoiceNO, + this.orderNo}); + + @override + Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + return Container( + padding: EdgeInsets.only( + left: 0, right: 5, bottom: 5, top: 5), + decoration: BoxDecoration( + color: Colors.white, + ), + height: 300, + child: Container( + padding: EdgeInsets.only(left: 10, right: 10, bottom: 10), + margin: EdgeInsets.only(top: 50), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + padding: EdgeInsets.only(left: 12.0), + child: Row(children: [ + IconButton( + icon: Icon(Icons.arrow_back_ios), + color: Colors.black, //Colors.black, + onPressed: () => Navigator.pop(context), + ), + AppText( + (Helpers.capitalize(patient.firstName) + + " " + + Helpers.capitalize( + patient.lastName)), + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), + patient.gender == 1 + ? Icon( + DoctorApp.male_2, + color: Colors.blue, + ) + : Icon( + DoctorApp.female_1, + color: Colors.pink, + ), + ]), + ), + Row(children: [ + Padding( + padding: EdgeInsets.only(left: 12.0), + child: Container( + width: 60, + height: 60, + child: Image.asset( + patient.gender == 1 + ? 'assets/images/male_avatar.png' + : 'assets/images/female_avatar.png', + fit: BoxFit.cover, + ), + ), + ), + SizedBox( + width: 10, + ), + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SERVICES_PATIANT2[ + int.parse(patientType)] == + "patientArrivalList" + ? Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment + .spaceBetween, + children: [ + patient.patientStatusType == + 43 + ? AppText( + TranslationBase.of( + context) + .arrivedP, + color: Colors.green, + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ) + : AppText( + TranslationBase.of( + context) + .notArrived, + color: + Colors.red[800], + fontWeight: + FontWeight.bold, + fontFamily: + 'Poppins', + fontSize: 12, + ), + arrivalType == '1' + ? AppText( + patient.startTime != + null + ? patient + .startTime + : '', + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + : AppText( + DateUtils.convertStringToDateFormat( + patient + .arrivedOn, + 'MM-dd-yyyy HH:mm'), + fontFamily: + 'Poppins', + fontWeight: + FontWeight.w600, + ) + ], + )) + : SizedBox(), + if (SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient") + Container( + child: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .appointmentDate + + " : ", + fontSize: 14, + ), + patient.startTime != null + ? Container( + height: 15, + width: 60, + decoration: + BoxDecoration( + borderRadius: + BorderRadius + .circular( + 25), + color: HexColor( + "#20A169"), + ), + child: AppText( + patient.startTime, + color: Colors.white, + fontSize: 1.5 * + SizeConfig + .textMultiplier, + textAlign: TextAlign + .center, + fontWeight: + FontWeight.bold, + ), + ) + : SizedBox(), + SizedBox( + width: 3.5, + ), + Container( + child: AppText( + convertDateFormat2(patient + .appointmentDate + .toString()), + fontSize: 1.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + ), + SizedBox( + height: 0.5, + ) + ], + ), + margin: EdgeInsets.only( + top: 8, + ), + ), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + RichText( + text: TextSpan( + style: TextStyle( + fontSize: 1.6 * + SizeConfig + .textMultiplier, + color: Colors.black), + children: [ + new TextSpan( + text: + TranslationBase.of( + context) + .fileNumber, + style: TextStyle( + fontSize: 12, + fontFamily: + 'Poppins')), + new TextSpan( + text: patient.patientId + .toString(), + style: TextStyle( + fontWeight: + FontWeight.w700, + fontFamily: + 'Poppins', + fontSize: 14)), + ], + ), + ), + Row( + children: [ + AppText( + patient.nationalityName ?? + patient.nationality, + fontWeight: FontWeight.bold, + fontSize: 12, + ), + patient.nationality != null + ? ClipRRect( + borderRadius: + BorderRadius + .circular( + 20.0), + child: Image.network( + patient + .nationalityFlagURL, + height: 25, + width: 30, + errorBuilder: + (BuildContext + context, + Object + exception, + StackTrace + stackTrace) { + return Text( + 'No Image'); + }, + )) + : SizedBox() + ], + ) + ], + ), + Container( + child: RichText( + text: new TextSpan( + style: new TextStyle( + fontSize: 1.6 * + SizeConfig.textMultiplier, + color: Colors.black, + fontFamily: 'Poppins', + ), + children: [ + new TextSpan( + text: TranslationBase.of( + context) + .age + + " : ", + style: TextStyle( + fontSize: 14)), + new TextSpan( + text: + "${DateUtils.getAgeByBirthday(patient.dateofBirth, context)}", + style: TextStyle( + fontWeight: + FontWeight.w700, + fontSize: 14)), + ], + ), + ), + ), + ], + ), + ), + ]), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 30, + height: 30, + margin: EdgeInsets.only(left: projectViewModel.isArabic?10:85, right: projectViewModel.isArabic?85:10,top: 5), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + border: Border( + bottom:BorderSide(color: Colors.grey[400],width: 2.5), + left: BorderSide(color: Colors.grey[400],width: 2.5), + ) + ), + ), + Expanded( + child: Container( + margin: EdgeInsets.only(top: 10), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + child: LargeAvatar( + name: doctorName, + url: profileUrl, + ), + width: 25, + height: 25, + margin: EdgeInsets.only(top: 10), + ), + Expanded( + flex: 4, + child: Container( + margin: EdgeInsets.all(10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + '${TranslationBase.of(context).dr}.$doctorName', + color: Colors.black, + fontWeight: FontWeight.w600, + fontSize: 14, + ), + if (orderNo != null) + Row( + children: [ + Texts( + 'Order No:', + color: Colors.grey[800], + ), + Texts( + orderNo ?? '', + ) + ], + ), + if (invoiceNO != null) + Row( + children: [ + Texts( + 'Invoice:', + color: Colors.grey[800], + ), + Texts( + invoiceNO, + ) + ], + ), + Row( + children: [ + Texts( + 'Result Date:', + color: Colors.grey[800], + ), + Texts( + '${DateUtils.getDayMonthYearDateFormatted(appointmentDate, isArabic: projectViewModel.isArabic)}', + ) + ], + ) + ]), + ), + ), + + ], + ), + ), + ), + ], + ) + ], + ), + ), + ); + } + + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + + return newDate.toString(); + } + + isToday(date) { + DateTime tempDate = new DateFormat("yyyy-MM-dd").parse(date); + return DateFormat("yyyy-MM-dd").format(tempDate) == + DateFormat("yyyy-MM-dd").format(DateTime.now()); + } + + myBoxDecoration() { + return BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.green, + width: 5, + ), + ), + borderRadius: BorderRadius.circular(10)); + } +} From 6eaf448d5ad59ea7ff0492ea9912d0c3a10bac44 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 30 Mar 2021 16:43:30 +0300 Subject: [PATCH 420/421] working on new design for vital sign and admission request --- .../patient/vital_signs/Obese_BMI-r.png | Bin 0 -> 2088 bytes .../images/patient/vital_signs/Obese_BMI.png | Bin 0 -> 2088 bytes .../patient/vital_signs/blood_pressure.png | Bin 0 -> 733 bytes .../patient/vital_signs/health_BMI-r.png | Bin 0 -> 1991 bytes .../images/patient/vital_signs/health_BMI.png | Bin 0 -> 1991 bytes .../images/patient/vital_signs/heart_rate.png | Bin 0 -> 940 bytes assets/images/patient/vital_signs/height.png | Bin 0 -> 417 bytes .../patient/vital_signs/ovrweight_BMI-r.png | Bin 0 -> 1966 bytes .../patient/vital_signs/ovrweight_BMI.png | Bin 0 -> 1966 bytes .../patient/vital_signs/respiration_rate.png | Bin 0 -> 995 bytes .../patient/vital_signs/temperature.png | Bin 0 -> 854 bytes .../patient/vital_signs/underweight_BMI-r.png | Bin 0 -> 1859 bytes .../patient/vital_signs/underweight_BMI.png | Bin 0 -> 1859 bytes assets/images/patient/vital_signs/weight.png | Bin 0 -> 399 bytes lib/config/config.dart | 4 +- lib/config/localized_values.dart | 9 +- .../patient-vital-sign-viewmodel.dart | 13 + .../admission-request-first-screen.dart | 51 +- .../profile/patient_profile_screen.dart | 2 +- .../referral/my-referral-patient-screen.dart | 2 +- .../vital_sign/vital_sign_details_screen.dart | 518 ++++++++++++------ .../profile/vital_sign/vital_sign_item.dart | 110 ++-- lib/util/translations_delegate_base.dart | 9 +- .../patient-referral-item-widget.dart | 14 +- .../patient-profile-header-new-design.dart | 2 +- lib/widgets/shared/app-textfield-custom.dart | 140 +++++ pubspec.yaml | 1 + 27 files changed, 632 insertions(+), 243 deletions(-) create mode 100644 assets/images/patient/vital_signs/Obese_BMI-r.png create mode 100644 assets/images/patient/vital_signs/Obese_BMI.png create mode 100644 assets/images/patient/vital_signs/blood_pressure.png create mode 100644 assets/images/patient/vital_signs/health_BMI-r.png create mode 100644 assets/images/patient/vital_signs/health_BMI.png create mode 100644 assets/images/patient/vital_signs/heart_rate.png create mode 100644 assets/images/patient/vital_signs/height.png create mode 100644 assets/images/patient/vital_signs/ovrweight_BMI-r.png create mode 100644 assets/images/patient/vital_signs/ovrweight_BMI.png create mode 100644 assets/images/patient/vital_signs/respiration_rate.png create mode 100644 assets/images/patient/vital_signs/temperature.png create mode 100644 assets/images/patient/vital_signs/underweight_BMI-r.png create mode 100644 assets/images/patient/vital_signs/underweight_BMI.png create mode 100644 assets/images/patient/vital_signs/weight.png create mode 100644 lib/widgets/shared/app-textfield-custom.dart diff --git a/assets/images/patient/vital_signs/Obese_BMI-r.png b/assets/images/patient/vital_signs/Obese_BMI-r.png new file mode 100644 index 0000000000000000000000000000000000000000..50b3282278f74fe59d8e039517ad1ad66e03f651 GIT binary patch literal 2088 zcmaKsc~lcw8pQ(vI;;XB5D28QkW|=Y38K*;$PyNXkRT%3G>af%Q6>t=qO!{-w8(0U zhP`PT1Vv=fmURFzkOUeOrv((HgUF`LjBPW}RRL$_kC{2=Rn>d1?)SU*dzF(craMDf z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&CQboZUGx z)~14>9{ndR&ju4uzB-zponi1oNE~Hn%N`z0YMbTz2aUGh^u~zcadX@WHM&)>JLzF* z13N3I1a+u*lry{zI~<&{V!UR%BgLiCL=RVycyT?Z>3ieHOzA(F%Td+R@W9^k;ud!Q zP`oSra>L<_%W&9=uB}{y+19q-D98G0`rgn^3FldD6LDZDUApzrd5grx0XjEg%Mpv% zKF@Qh1DS*~OLBUo)>K=J$nOCxELQ{uRnn@~DH#Bb9>IF)#E}Z7v#+*v5L?P=i=`U8SPZQgm z&5qmBYTaO)K~0YHyobjGVff*$mgQw~>G`MpUj9CJzMo9Z=@eeiiRPAGD^--^9|s>Z zsSlSAYA^CT{p<7PUVULHh1=>yJn>i$zGR7Y&ZT)v)50w6P=S1A&f0zCW=*c3(G6>G zy=qO@hFX#Y){3iIx_M=?%j&VkdAZ&mtcA-(crSLld literal 0 HcmV?d00001 diff --git a/assets/images/patient/vital_signs/respiration_rate.png b/assets/images/patient/vital_signs/respiration_rate.png new file mode 100644 index 0000000000000000000000000000000000000000..ff695dec77fe9328985304e7e976322b4ac58af2 GIT binary patch literal 995 zcmeAS@N?(olHy`uVBq!ia0vp^Qa~)p!3-oN7|sC&7$*hzgt!8^KoA-l>fqpDY;3IH z;9zNK31sN$=>bUt0|#AQ8$&}|Jv}QO9dm6{Q$s^*9UVJELo1-Tj!0 zP>qhEwSj?^zP_cNk+rU&m5za>fq?}?R@V^7w$U@R)HSrwF|gLxhbRMbt#v_MOFcas zT?0#feQQ0S$p)5sAaSr72p1$}rDtHR3)E<631lF#f#N`9sjF|TZwOMOr*8#P22ul( z0$QP`Z>bMtgG~UFKv^r0W55dZpq7I5f=qxRFdL*2h(LOQ4#SWFs{uI}=vufen2S)1 zDh@Xd#K1uR|NpG|nTnlIn{bEeYY_xAnds@j6gGqZEMc1*uw`|Y6Z;=D^MABruUDskjg%R23n7y7)_ z3HrQSr@UI$vE%{6#Bw8b!+L}Eha77CmWnThePV7$v9>)_3+RlU+mN}EIpWRTO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RCS)3gVqul$>SEWQ-IOV>fjzT<4A4{vOZ(G`8t zJ8(C#`M0icWTXC=M@i9v8#52Y+}wLns`)goXroSss%&RRj_x)i+Q;g=PFe?z9__)k zJ%2xS%o#^YmwW1$dj;8csFIDXF7P8ck7QwAhHd?&YVZT$@^WOOGE^U3DhWyUD)m9O zolXhe5a#ZG(fn2LfQ9NtKC`kW@4)5oAz99D-F!WPSy{c!1?3U0MEx9^{>-w?q+)xm zOEt6O>~d@rJwKF@eWB^meBF2`uJS7)yw<5lJjGrLK4K-daF3`fs zHLm+kh_VTs^Rbdkq9{VVb&8}y^bE#j951x)EOrSCX)3hroaL++=W}qc3!f#aA@|j@ zbVMxY#z^JD&a<}cWfj(E3EH3b>H|gs^i^E%*T}oLsfeuvVYR2#NK`(tGsyj}>D`XY zXGEj8i$_XvP6dL!>C0T&N9^Oq&3uh$=0k8ootz$XM(z=pVErMEZ=;|lh~(>IF34Tt z9+`JR)n<+b9#@B!4N8e{TAj{nO#01xFA8)k$0VhUsmd9h$yn{Lrfw6c_^_>zB&Zlq zAMxDbSrOoY&x)ubKZXwBw_i8z&bXC}?@b}yoPDBgPiiY;Thv5`BOe7-l#izq`H^L# zHO<9la6yOu$UB5Zz F=pXBfFgpMM literal 0 HcmV?d00001 diff --git a/assets/images/patient/vital_signs/underweight_BMI.png b/assets/images/patient/vital_signs/underweight_BMI.png new file mode 100644 index 0000000000000000000000000000000000000000..83b0260af2994b7e46f585cd2cdb33e7afff991f GIT binary patch literal 1859 zcmY+F2~-p38ipfCR02gz6@dy`6wzcRGa1M-3Em*PEJ6riC|+4CvIrtILJ>iwS3wpR z1S3(=pd*q(xtfY>UV;?s2C`KexIk@bkpi|zj<#0lKY@E~=gdsL_xs=HTXJ$vas&K5 zO^vOLDHMvSx0jn3eADG1AHa!K+avk!NDSt2*a?|A`zd@2LTMj z42Ed^dI6Wq1rk9-5F~Wqa4<}SqRudkGnrh5lM{wHqo{zz;=?eP$=t-igeZz52oHug z0Y4MN8Eig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8nx4@}!A}FAt>*SUw#jBc qODVRU#Q!keVOu#Ae(rl^)`DjPiC?`5u<0ZJ3ccO^-KsZ79QhNu1IM2L literal 0 HcmV?d00001 diff --git a/assets/images/patient/vital_signs/weight.png b/assets/images/patient/vital_signs/weight.png new file mode 100644 index 0000000000000000000000000000000000000000..4a3bd2cce8158afed222d004714590b022e34970 GIT binary patch literal 399 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM3?#3wJbMaAwFLNtxB_V)2n`K&aBwg-HrCeG z29n0c4mvvKhK9EK`qp}SHhM|G$JuyBW|CS|ve#!3<2yEUau?BH~)w<`$NI{sEa; zIR!-v7A{)8|IpFnSFT>W`|SCv*YAJ){HHu^>ldId#w2fd7j2cDPdI>_W=|K#5RLQ6 z4?-^-VtP_3v7w7ORl;PWcZSh{2(3p=f0&$vRvFlZIC)NJW#oxyoib51#X{miLoAo# z!gI$C98f*YF*WhB!;1+iX$e73nmdfU6mKh@JEEX;_T*6}@pjJ)PlL{;IcjHA+Foht x>Y9phc{0iJ)N{@W>{d2BVff)hvgmU*2K5QS!5a$vb^@Kl;OXk;vd$@?2>@KYeF*>n literal 0 HcmV?d00001 diff --git a/lib/config/config.dart b/lib/config/config.dart index 3a72faba..0f615af5 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -4,8 +4,8 @@ const MAX_SMALL_SCREEN = 660; const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z &'\"]"; const ONLY_DATE = "[0-9/]"; -// const BASE_URL = 'https://hmgwebservices.com/'; -const BASE_URL = 'https://uat.hmgwebservices.com/'; +const BASE_URL = 'https://hmgwebservices.com/'; +// const BASE_URL = 'https://uat.hmgwebservices.com/'; const PHARMACY_ITEMS_URL = "Services/Lists.svc/REST/GetPharmcyItems_Region_enh"; const PHARMACY_LIST_URL = "Services/Patients.svc/REST/GetPharmcyList"; const PATIENT_PROGRESS_NOTE_URL = diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f30a86e5..aa57f29a 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -84,7 +84,7 @@ const Map> localizedValues = { 'speciality': {'en': 'Speciality', 'ar': 'التخصص'}, 'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'}, 'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'}, - 'vitalSign': {'en': 'Vital Sign', 'ar': 'المؤشرات الحيوية'}, + 'vitalSign': {'en': 'Vital Signs', 'ar': 'المؤشرات الحيوية'}, 'vital': {'en': 'Vital', 'ar': 'الحيوية'}, 'signs': {'en': 'Signs', 'ar': 'المؤشرات'}, 'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'}, @@ -377,6 +377,11 @@ const Map> localizedValues = { 'headCircum': {'en': "Head Circum", 'ar': 'محيط الرأس'}, 'leanBodyWeight': {'en': "Lean Body Weight", 'ar': 'وزن الجسم الهزيل'}, 'bodyMassIndex': {'en': "Body Mass Index", 'ar': 'مؤشر كتلة الجسم'}, + 'yourBodyMassIndex': {'en': "Your Body Mass Index is", 'ar': 'مؤشر كتلة جسمك هو'}, + 'bmiUnderWeight': {'en': "UnderWeight", 'ar': 'تحت الوزن'}, + 'bmiHealthy': {'en': "Healthy", 'ar': 'صحي'}, + 'bmiOverWeight': {'en': "OverWeight", 'ar': 'فوق الوزن'}, + 'bmiObese': {'en': "Obese", 'ar': 'سمين'}, 'method': {'en': "Method", 'ar': 'الطريقة'}, 'pulseBeats': {'en': 'Pulse(beats/minute)', 'ar': ' (دقة/دقيقة)النبض'}, 'rhythm': {'en': "Rhythm", 'ar': 'الإيقاع'}, @@ -608,7 +613,7 @@ const Map> localizedValues = { "sys-dias": {"en": "SBP/DBP", "ar": "إنقباض/إنبساط"}, "body": {"en": "Body \n Mass", "ar": "كتلة\nالجسم"}, 'respirationRate': {'en': 'Respiration Rate', 'ar': 'معدل التنفس'}, - 'heart': {'en': 'Heart', 'ar': 'قلب'}, + 'heart': {'en': 'Heart rate', 'ar': 'معدل ضربات القلب'}, 'medicalReport': {'en': "medical Report", 'ar': "تقرير طبي"}, 'visitDate': {'en': "Visit Date", 'ar': "تاريخ الزيارة"}, 'test': {'en': "Procedures/Test", 'ar': "عمليات/تحاليل"}, diff --git a/lib/core/viewModel/patient-vital-sign-viewmodel.dart b/lib/core/viewModel/patient-vital-sign-viewmodel.dart index 2def78db..0a51f7f5 100644 --- a/lib/core/viewModel/patient-vital-sign-viewmodel.dart +++ b/lib/core/viewModel/patient-vital-sign-viewmodel.dart @@ -99,6 +99,19 @@ class VitalSignsViewModel extends BaseViewModel { } } + int getBMIStatus() { + var bodyMassIndex = double.parse(bodyMax); + if (bodyMassIndex <= 18.5) { + return 1; + } else if (bodyMassIndex <= 25.0) { + return 2; + } else if (bodyMassIndex <= 30) { + return 3; + } else { + return 4; + } + } + String getTempratureMethod(int temperatureCelciusMethod) { // temperatureCelciusMethod ( vital sign response field )- master 2005 if (temperatureCelciusMethod == 1) { diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 0c1f0de2..1cf69da8 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -1,4 +1,3 @@ -import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/admissionRequest/admission-request.dart'; @@ -6,11 +5,12 @@ import 'package:doctor_app_flutter/core/viewModel/patient-admission-request-view import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.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/patients/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; @@ -47,12 +47,15 @@ class _AdmissionRequestThirdScreenState Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; final screenSize = MediaQuery.of(context).size; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( builder: (_, model, w) => AppScaffold( baseViewModel: model, + isShowAppBar: false, appBarTitle: TranslationBase.of(context).admissionRequest, body: GestureDetector( onTap: (){ @@ -62,27 +65,57 @@ class _AdmissionRequestThirdScreenState } }, child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - PatientPageHeaderWidget(patient), + // PatientPageHeaderWidget(patient), + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), Container( - margin: EdgeInsets.symmetric( - vertical: 16, horizontal: 16), + margin: EdgeInsets.all(16.0), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - SizedBox( - height: 16, + AppText( + "${TranslationBase.of(context).admission}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, ), + AppText( + "${TranslationBase.of(context).request}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + margin: EdgeInsets.symmetric( + vertical: 0, horizontal: 16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ AppText( TranslationBase.of(context) .specialityAndDoctorDetail, - fontWeight: FontWeight.bold, - fontSize: SizeConfig.textMultiplier * 2.5, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.8, + fontWeight: FontWeight.w700, + ), + SizedBox( + height: 10, + ), + AppTextFieldCustom( + height: screenSize.height * 0.070, + hintText: "test field", + isDropDown: true, + controller: _sickLeaveCommentsController, ), SizedBox( height: 10, diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 85c93e2f..70c9f5b9 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -96,7 +96,7 @@ class PatientProfileScreen extends StatelessWidget { if (int.parse(patientType) == 7 || int.parse(patientType) == 6) Positioned( - top: 195, + top: 175, left: 20, right: 20, child: Row( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 3cab440c..e6cccf48 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -33,7 +33,7 @@ class MyReferralPatientScreen extends StatelessWidget { ) : SingleChildScrollView( child: Container( - margin: EdgeInsets.only(top: 50), + margin: EdgeInsets.only(top: 70), // color: Colors.white, // height: MediaQuery.of(context).size.height, child: Column( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index 2b4877e8..3dd45782 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -6,6 +6,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.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/transitions/fade_page.dart'; @@ -29,191 +30,378 @@ class VitalSignDetailsScreen extends StatelessWidget { String from = routeArgs['from']; String to = routeArgs['to']; String imageBasePath = 'assets/images/'; + String assetBasePath = "${imageBasePath}patient/vital_signs/"; return BaseView( onModelReady: (model) => model.getPatientVitalSignHistory(patient, from, to), builder: (_, mode, widget) => AppScaffold( - isShowAppBar: true, + isShowAppBar: false, baseViewModel: mode, appBarTitle: TranslationBase.of(context).vitalSign, body: mode.patientVitalSignsHistory.length > 0 - ? Container( - child: ListView( - children: [ - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Height, - pageTitle: - TranslationBase.of(context).height, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: Container( - child: VitalSignItem( - des: TranslationBase.of(context).height, - imagePath: "${imageBasePath}vital_height.png", - lastVal: mode.heightCm, - unit: TranslationBase.of(context).cm, - ), - ), + ? Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + PatientProfileHeaderNewDesign( + patient, patientType, arrivalType), + Container( + margin: EdgeInsets.all(16.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${patient.firstName ?? patient.patientDetails.firstName}'s", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w600, ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Weight, - pageTitle: - TranslationBase.of(context).weight, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).weight, - imagePath: "${imageBasePath}vital_weight.png", - unit: TranslationBase.of(context).kg, - lastVal: mode.weightKg, - ), + AppText( + TranslationBase.of(context).vitalSign, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 3, + fontWeight: FontWeight.bold, + ) + ], + ), + ), + Container( + height: MediaQuery.of(context).size.height * 0.21, + width: double.infinity, + padding: EdgeInsets.all(12.0), + margin: EdgeInsets.symmetric(horizontal: 16.0), + decoration: BoxDecoration( + shape: BoxShape.rectangle, + color: Colors.white, + borderRadius: BorderRadius.circular(16), + border: Border.fromBorderSide(BorderSide( + color: Colors.grey.shade400, + width: 0.4, + )), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + "${TranslationBase.of(context).yourBodyMassIndex} ${mode.bodyMax}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 2.0, + fontWeight: FontWeight.w700, ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 1 + ? '${assetBasePath}underweight_BMI.png' + : '${assetBasePath}underweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiUnderWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + AppText( + "(1-10)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + color: mode.getBMIStatus() == 1 + ? Color(0XFFD02127) + : null, + fontWeight: FontWeight.w700, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 2 + ? '${assetBasePath}health_BMI.png' + : '${assetBasePath}health_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiHealthy}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(11-20)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 2 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 3 + ? '${assetBasePath}ovrweight_BMI.png' + : '${assetBasePath}ovrweight_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiOverWeight}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(21-30)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 3 + ? Color(0XFFD02127) + : null, + ), + ], + )), + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Image.asset( + mode.getBMIStatus() != 4 + ? '${assetBasePath}Obese_BMI.png' + : '${assetBasePath}Obese_BMI-r.png', + height: + MediaQuery.of(context).size.height * 0.10, + ), + const SizedBox( + height: 4, + ), + AppText( + "${TranslationBase.of(context).bmiObese}", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + AppText( + "(31-40>)", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w700, + color: mode.getBMIStatus() == 4 + ? Color(0XFFD02127) + : null, + ), + ], + )), + ], + ) ], ), - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: - vitalSignDetails.BodyMeasurements, - pageTitle: TranslationBase.of(context) - .bodyMeasurements, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).body, - imagePath: "${imageBasePath}vital_body_mass.png", - lastVal: mode.bodyMax, - unit: TranslationBase.of(context).mass, + ), + Expanded( + child: Container( + margin: EdgeInsets.symmetric(horizontal: 8.0), + child : GridView.count( + shrinkWrap: true, + physics: NeverScrollableScrollPhysics(), + crossAxisSpacing: 4, + mainAxisSpacing: 4, + childAspectRatio: 1 / 1.0, + crossAxisCount: 3, + children: [ + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Height, + pageTitle: + TranslationBase.of(context) + .height, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: TranslationBase.of(context).height, + imagePath: + "${assetBasePath}height.png", + lastVal: mode.heightCm, + unit: TranslationBase.of(context).cm, + ), + ), ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Temperature, - pageTitle: TranslationBase.of(context) - .temperature, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: Container( + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.Weight, + pageTitle: + TranslationBase.of(context) + .weight, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, child: VitalSignItem( - des: TranslationBase.of(context).temperature, - imagePath: - "${imageBasePath}vital_temperature.png", - lastVal: mode.temperatureCelcius, - unit: TranslationBase.of(context).tempC, + des: TranslationBase.of(context).weight, + imagePath: "${assetBasePath}weight.png", + unit: TranslationBase.of(context).kg, + lastVal: mode.weightKg, ), ), - ), - ], - ), - Row( - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.heart, - pageTitle: - TranslationBase.of(context).heart, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).heart, - imagePath: "${imageBasePath}vital_heart_rate.png", - lastVal: mode.hartRat, - unit: TranslationBase.of(context).bpm, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.Temperature, + pageTitle: + TranslationBase.of(context) + .temperature, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: Container( + child: VitalSignItem( + des: + TranslationBase.of(context).temperature, + imagePath: + "${assetBasePath}temperature.png", + lastVal: mode.temperatureCelcius, + unit: TranslationBase.of(context).tempC, + ), + ), ), - ), - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.Respiration, - pageTitle: TranslationBase.of(context) - .respirationRate, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).respirationRate, - imagePath: "${imageBasePath}vital_respiration.png", - lastVal: mode.respirationBeatPerMinute, - unit: TranslationBase.of(context).respirationSigns, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: vitalSignDetails.heart, + pageTitle: + TranslationBase.of(context) + .heart, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context).heart, + imagePath: + "${assetBasePath}heart_rate.png", + lastVal: mode.hartRat, + unit: TranslationBase.of(context).bpm, + ), ), - ), - ], - ), - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - InkWell( - onTap: () => isNotOneAppointment - ? Navigator.push( - context, - FadePage( - page: VitalSignItemDetailsScreen( - pageKey: vitalSignDetails.BloodPressure, - pageTitle: TranslationBase.of(context) - .bloodPressure, - vitalList: mode.patientVitalSignsHistory, - ), - ), - ) - : null, - child: VitalSignItem( - des: TranslationBase.of(context).bloodPressure, - imagePath: - "${imageBasePath}vital_blood-pressure.png", - lastVal: mode.bloodPressure, - unit: TranslationBase.of(context).sysDias, + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.Respiration, + pageTitle: + TranslationBase.of(context) + .respirationRate, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: VitalSignItem( + des: TranslationBase.of(context) + .respirationRate, + imagePath: + "${assetBasePath}respiration_rate.png", + lastVal: mode.respirationBeatPerMinute, + unit: TranslationBase.of(context) + .respirationSigns, + ), ), - ), - ], + InkWell( + onTap: () => isNotOneAppointment + ? Navigator.push( + context, + FadePage( + page: VitalSignItemDetailsScreen( + pageKey: + vitalSignDetails.BloodPressure, + pageTitle: + TranslationBase.of(context) + .bloodPressure, + vitalList: + mode.patientVitalSignsHistory, + ), + ), + ) + : null, + child: VitalSignItem( + des: + TranslationBase.of(context).bloodPressure, + imagePath: + "${assetBasePath}blood_pressure.png", + lastVal: mode.bloodPressure, + unit: TranslationBase.of(context).sysDias, + ), + ), + ], + ), ), - ], - ), + ), + ], ) : Center( child: AppText( diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart index 33b25e82..e99e7bad 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_item.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_item.dart @@ -1,9 +1,17 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class VitalSignItem extends StatelessWidget { + final String des; + final String lastVal; + final String unit; + final String imagePath; + final double height; + final double width; + const VitalSignItem( {Key key, @required this.des, @@ -14,77 +22,71 @@ class VitalSignItem extends StatelessWidget { @required this.imagePath}) : super(key: key); - final String des; - final String lastVal; - final String unit; - final String imagePath; - final double height; - final double width; - @override Widget build(BuildContext context) { return RoundedContainer( - margin: 0.025 * SizeConfig.realScreenWidth, - height: 0.15 * SizeConfig.realScreenHeight, - width: 0.45 * SizeConfig.realScreenWidth, + // margin: 0.025 * SizeConfig.realScreenWidth, + // height: 0.15 * SizeConfig.realScreenHeight, + // width: 0.45 * SizeConfig.realScreenWidth, child: Container( padding: EdgeInsets.all(5), child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - height: 0.10 * SizeConfig.realScreenHeight, - child: Row( - children: [ - Expanded( - flex: 2, - child: Align( - alignment: Alignment.topLeft, - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Text( - des, - style: TextStyle( - fontSize: 1.7 * SizeConfig.textMultiplier, - color: HexColor('#B8382C'), - fontWeight: FontWeight.bold, - ), + Expanded( + child: Container( + padding: EdgeInsets.only(top: 8), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: Container( + padding: EdgeInsets.only(left: 8, right: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.start, + children: [ + AppText( + "$lastVal", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.6, + fontWeight: FontWeight.w800, + margin: 0, + ), + AppText( + "$unit", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.3, + fontWeight: FontWeight.w700, + color: HexColor('#B8382C'), + margin: 0, + ), + ], ), ), ), - ), - Expanded( - flex: 1, - child: Container( + Container( child: Image.asset( imagePath, width: 40, height: 40, - )), - ) - ], + )) + ], + ), ), ), - Expanded( - child: Container( - width: double.infinity, - child: Align( - alignment: Alignment.topRight, - child: Container( - margin: EdgeInsets.only(left: 5, right: 5), - child: RichText( - text: TextSpan( - style: TextStyle(color: Colors.black), - children: [ - TextSpan(text: "$lastVal "), - TextSpan( - text: unit, - style: TextStyle( - color: HexColor('#B8382C'), - ), - ), - ]), - ), + Container( + width: double.infinity, + child: Align( + alignment: Alignment.topLeft, + child: Container( + margin: EdgeInsets.only(left: 5, right: 5), + child: AppText( + "$des", + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.5, + fontWeight: FontWeight.w600, ), ), ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 331b2812..df880f9a 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -645,8 +645,13 @@ class TranslationBase { String get leanBodyWeight => localizedValues['leanBodyWeight'][locale.languageCode]; - String get bodyMassIndex => - localizedValues['bodyMassIndex'][locale.languageCode]; + String get bodyMassIndex => localizedValues['bodyMassIndex'][locale.languageCode]; + + String get yourBodyMassIndex => localizedValues['yourBodyMassIndex'][locale.languageCode]; + String get bmiUnderWeight => localizedValues['bmiUnderWeight'][locale.languageCode]; + String get bmiHealthy => localizedValues['bmiHealthy'][locale.languageCode]; + String get bmiOverWeight => localizedValues['bmiOverWeight'][locale.languageCode]; + String get bmiObese => localizedValues['bmiObese'][locale.languageCode]; String get method => localizedValues['method'][locale.languageCode]; diff --git a/lib/widgets/patients/patient-referral-item-widget.dart b/lib/widgets/patients/patient-referral-item-widget.dart index 6e9008e7..14afa5b6 100644 --- a/lib/widgets/patients/patient-referral-item-widget.dart +++ b/lib/widgets/patients/patient-referral-item-widget.dart @@ -313,12 +313,14 @@ class PatientReferralItemWidget extends StatelessWidget { ), Row( children: [ - AppText( - patientInfo.patientName, - fontSize: SizeConfig.textMultiplier * 2.5, - fontWeight: FontWeight.bold, - backGroundcolor: Colors.white, - fontFamily: 'Poppins', + Expanded( + child: AppText( + patientInfo.patientName, + fontSize: SizeConfig.textMultiplier * 2.5, + fontWeight: FontWeight.bold, + backGroundcolor: Colors.white, + fontFamily: 'Poppins', + ), ), SizedBox( width: 4, diff --git a/lib/widgets/patients/profile/patient-profile-header-new-design.dart b/lib/widgets/patients/profile/patient-profile-header-new-design.dart index 5979b8e1..b50a191b 100644 --- a/lib/widgets/patients/profile/patient-profile-header-new-design.dart +++ b/lib/widgets/patients/profile/patient-profile-header-new-design.dart @@ -26,7 +26,7 @@ class PatientProfileHeaderNewDesign extends StatelessWidget { decoration: BoxDecoration( color: Colors.white, ), - height: 220, + height: 200, child: Container( padding: EdgeInsets.only( left: 10, right: 10, bottom: 10), diff --git a/lib/widgets/shared/app-textfield-custom.dart b/lib/widgets/shared/app-textfield-custom.dart new file mode 100644 index 00000000..15c8865a --- /dev/null +++ b/lib/widgets/shared/app-textfield-custom.dart @@ -0,0 +1,140 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:flutter/material.dart'; + +import 'app_texts_widget.dart'; + +class AppTextFieldCustom extends StatefulWidget { + final double height; + final Function onClick; + final String hintText; + final TextEditingController controller; + final bool isDropDown; + final Icon suffixIcon; + final Color dropDownColor; + + AppTextFieldCustom( + {this.height = 0, + this.onClick, + this.hintText, + this.controller, + this.isDropDown = false, + this.suffixIcon, + this.dropDownColor}); + + @override + _AppTextFieldCustomState createState() => _AppTextFieldCustomState(); +} + +class _AppTextFieldCustomState extends State { + @override + Widget build(BuildContext context) { + return Container( + height: widget.height != 0 ? widget.height : null, + decoration: + containerBorderDecoration(Color(0Xffffffff), Color(0xFFEFEFEF)), + padding: EdgeInsets.only(top: 4.0, bottom: 4.0, left: 8.0, right: 8.0), + child: InkWell( + onTap: widget.onClick ?? null, + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + if (widget.controller.text != "") + AppText( + widget.hintText, + fontFamily: 'Poppins', + fontSize: SizeConfig.textMultiplier * 1.4, + fontWeight: FontWeight.w600, + ), + TextField( + textAlign: TextAlign.left, + decoration: textFieldSelectorDecoration( + widget.hintText, null, true), + style: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + controller: widget.controller, + ), + ], + ), + ), + widget.isDropDown + ? widget.suffixIcon != null + ? widget.suffixIcon + : Icon( + Icons.arrow_drop_down, + color: widget.dropDownColor != null + ? widget.dropDownColor + : Colors.black, + ) + : Container(), + ], + ), + ), + ); + } + + BoxDecoration containerBorderDecoration( + Color containerColor, Color borderColor, + {double borderWidth = -1}) { + return BoxDecoration( + color: containerColor, + shape: BoxShape.rectangle, + borderRadius: BorderRadius.all(Radius.circular(8)), + border: Border.fromBorderSide(BorderSide( + color: borderColor, + width: borderWidth == -1 ? 2.0 : borderWidth, + )), + ); + } + + static InputDecoration textFieldSelectorDecoration( + String hintText, String selectedText, bool isDropDown, + {Icon suffixIcon, Color dropDownColor}) { + return InputDecoration( + isDense: true, + contentPadding: EdgeInsets.symmetric(horizontal: 0, vertical: 0), + enabledBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + focusedBorder: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + border: UnderlineInputBorder( + borderSide: BorderSide(color: Color(0Xffffffff)), + ), + /*focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ), + disabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Color(0xFFCCCCCC), width: 2.0), + borderRadius: BorderRadius.circular(8), + ),*/ + hintText: selectedText != null ? selectedText : hintText, + hintStyle: TextStyle( + fontSize: 14, + color: Colors.grey.shade600, + ), + /*suffixIcon: isDropDown + ? suffixIcon != null + ? suffixIcon + : Icon( + Icons.arrow_drop_down, + color: dropDownColor != null ? dropDownColor : Colors.black, + ) + : null,*/ + // labelText: + // labelStyle: + ); + } +} diff --git a/pubspec.yaml b/pubspec.yaml index b564ffda..3aae565e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -107,6 +107,7 @@ flutter: - assets/images/dashboard/ - assets/images/login/ - assets/images/patient/ + - assets/images/patient/vital_signs/ # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware. From 920ec14bc200492add64db994a0e5ecbafc7852d Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Tue, 30 Mar 2021 21:36:17 +0300 Subject: [PATCH 421/421] add new design for Lab Result and Radiology Results --- lib/config/localized_values.dart | 4 +- lib/core/viewModel/labs_view_model.dart | 5 + .../profile/lab_result/LabResultWidget.dart | 157 ++++++++++-------- .../lab_result/laboratory_result_widget.dart | 120 ++----------- .../profile/lab_result/labs_home_page.dart | 42 ++++- .../radiology/radiology_details_page.dart | 85 +++++----- .../radiology/radiology_home_page.dart | 81 +++++---- .../prescription/prescription_items_page.dart | 44 +++++ .../prescription/prescriptions_page.dart | 134 +++++++-------- lib/widgets/shared/app_button.dart | 21 ++- 10 files changed, 364 insertions(+), 329 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 662111d0..7229f9f6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -124,10 +124,10 @@ const Map> localizedValues = { 'ar': 'ليس لديك اي ملاحظة تقدم ' }, 'invoiceNo:': {'en': 'Invoice No :', 'ar': 'رقم الفاتورة'}, - 'generalResult': {'en': 'General Result :', 'ar': 'النتيجة العامة'}, + 'generalResult': {'en': 'General Result ', 'ar': 'النتيجة العامة'}, 'description': {'en': 'Description', 'ar': 'الوصف'}, 'value': {'en': 'Value', 'ar': 'القيمة'}, - 'range': {'en': 'range', 'ar': 'النطاق'}, + 'range': {'en': 'Range', 'ar': 'النطاق'}, 'enterId': {'en': 'Enter ID', 'ar': 'الهوية'}, 'pleaseEnterYourID': { 'en': 'Please enter your ID', diff --git a/lib/core/viewModel/labs_view_model.dart b/lib/core/viewModel/labs_view_model.dart index 3f457956..43851649 100644 --- a/lib/core/viewModel/labs_view_model.dart +++ b/lib/core/viewModel/labs_view_model.dart @@ -88,6 +88,11 @@ class LabsViewModel extends BaseViewModel { List labResultLists = List(); + List get labResultListsCoustom { + + return labResultLists; + } + getLaboratoryResult( {String projectID, int clinicID, diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index 57b4614d..c20a48ae 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -13,11 +13,10 @@ import 'package:provider/provider.dart'; class LabResultWidget extends StatelessWidget { - final String filterName ; final List patientLabResultList; final PatientLabOrders patientLabOrder; final PatiantInformtion patient; - LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); + LabResultWidget({Key key, this.patientLabResultList, this.patientLabOrder, this.patient}) : super(key: key); ProjectViewModel projectViewModel; @override Widget build(BuildContext context) { @@ -29,38 +28,88 @@ class LabResultWidget extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, children: [ - Texts(filterName), - InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: FlowChartPage( - filterName: filterName, - patientLabOrder: patientLabOrder, - patient: patient, - ), + Expanded( + child: Container( + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - ); - }, - child: Texts( - TranslationBase.of(context).showMoreBtn, - textDecoration: TextDecoration.underline, - color: Colors.blue, + ), + ), + ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), ), + Expanded( + child: Container( + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), + ), + ) ], ), - Table( - border: TableBorder.symmetric( - inside: BorderSide( - width: 2.0, color: Colors.grey[300]), - ), - children: fullData(patientLabResultList,context), - ), + SizedBox(height: 7,), + Divider(color: Colors.black,thickness: 1,), + SizedBox(height: 12,), + ...List.generate(patientLabResultList.length, (index) => Column( + children: [ + Row( + children: [ + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + '${patientLabResultList[index].testCode}\n'+ + patientLabResultList[index].description, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].resultValue+" "+patientLabResultList[index].uOM, + textAlign: TextAlign.center, + ), + ), + ), + ), + Expanded( + child: Container( + padding: EdgeInsets.all(10), + color: Colors.white, + child: Center( + child: Texts( + patientLabResultList[index].referanceRange, + textAlign: TextAlign.center, + ), + ), + ), + ) + ], + ), + Divider(), + ], + )) + // Table( + // border: TableBorder.symmetric( + // inside: BorderSide(width: 2.0, color: Colors.grey[300],style: BorderStyle.solid), + // ), + // children: fullData(patientLabResultList,context), + // ), ], ), ); @@ -71,54 +120,22 @@ class LabResultWidget extends StatelessWidget { TableRow( children: [ Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - topRight: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context).description, - color: Colors.white, - ), + child: Center( + child: Texts( + TranslationBase.of(context).description, + color: Colors.black,bold: true, ), - height: 60, ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Texts(TranslationBase.of(context).value, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).value, color: Colors.black,bold: true,), + ), ), Container( - child: Container( - decoration: BoxDecoration( - color: Theme.of(context).primaryColor, - borderRadius: BorderRadius.only( - topLeft: projectViewModel.isArabic - ? Radius.circular(10.0) - : Radius.circular(0.0), - topRight: projectViewModel.isArabic - ? Radius.circular(0.0) - : Radius.circular(10.0), - ), - ), - child: Center( - child: Texts(TranslationBase.of(context).range, color: Colors.white), - ), - height: 60), + child: Center( + child: Texts(TranslationBase.of(context).range, color: Colors.black,bold: true,), + ), ), ], ), diff --git a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart index 25663fa6..a2c8411d 100644 --- a/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart +++ b/lib/screens/patients/profile/lab_result/laboratory_result_widget.dart @@ -34,7 +34,6 @@ class LaboratoryResultWidget extends StatefulWidget { } class _LaboratoryResultWidgetState extends State { - bool _isShowMore = true; bool _isShowMoreGeneral = true; ProjectViewModel projectViewModel; @@ -42,8 +41,7 @@ class _LaboratoryResultWidgetState extends State { Widget build(BuildContext context) { projectViewModel = Provider.of(context); return BaseView( - onModelReady: (model) => - model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), + onModelReady: (model) => model.getPatientLabResult(patientLabOrder: widget.patientLabOrder,patient: widget.patient), builder: (_, model, w) => NetworkBaseView( baseViewModel: model, child: Container( @@ -53,33 +51,6 @@ class _LaboratoryResultWidgetState extends State { Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Container( - margin: EdgeInsets.all(8), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - child: Container( - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Texts(TranslationBase.of(context).invoiceNo), - Texts(widget.billNo), - ], - ), - ), - ), - ], - ), - ), SizedBox( height: 12, ), @@ -106,20 +77,17 @@ class _LaboratoryResultWidgetState extends State { )), child: Row( children: [ - Expanded( - child: Texts(TranslationBase.of(context) - .generalResult)), + Expanded(child: Container( + margin: EdgeInsets.only(left: 10, right: 10), + child: Texts(TranslationBase.of(context).generalResult,bold: true,))), Container( width: 25, height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), child: Icon( _isShowMoreGeneral ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down, - color: Colors.white, + color: Colors.grey[800], size: 22, ), ) @@ -142,22 +110,10 @@ class _LaboratoryResultWidgetState extends State { duration: Duration(milliseconds: 7000), child: Container( width: double.infinity, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - ...List.generate( - model.labResultLists.length, - (index) => LabResultWidget( - patientLabOrder: widget.patientLabOrder, - filterName: model - .labResultLists[index].filterName, - patientLabResultList: model - .labResultLists[index] - .patientLabResultList, - patient:widget.patient, - ), - ) - ], + child: LabResultWidget( + patientLabOrder: widget.patientLabOrder, + patientLabResultList: model.labResultList, + patient:widget.patient, ), ), ), @@ -167,63 +123,7 @@ class _LaboratoryResultWidgetState extends State { SizedBox( height: 10, ), - InkWell( - onTap: () { - setState(() { - _isShowMore = !_isShowMore; - }); - }, - child: Container( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(5.0), - )), - child: Row( - children: [ - Expanded( - child: Texts( - TranslationBase.of(context).specialResult)), - Container( - width: 25, - height: 25, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor), - child: Icon( - _isShowMore - ? Icons.keyboard_arrow_up - : Icons.keyboard_arrow_down, - color: Colors.white, - size: 22, - ), - ) - ], - ), - ), - ), - if (_isShowMore) - AnimatedContainer( - padding: EdgeInsets.all(10.0), - margin: EdgeInsets.only(left: 5, right: 5), - decoration: BoxDecoration( - shape: BoxShape.rectangle, - color: Colors.white, - borderRadius: BorderRadius.only( - bottomLeft: Radius.circular(5.0), - bottomRight: Radius.circular(5.0), - )), - duration: Duration(milliseconds: 7000), - child: Container( - width: double.infinity, - child: Html( - data: widget.details ?? - TranslationBase.of(context).noDataAvailable, - )), - ), + ], ), ], diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 1cf19edb..aeca5508 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -24,8 +24,9 @@ class LabsHomePage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - patientType = routeArgs['patient-type']; - arrivalType = routeArgs['arrival-type']; + patientType = routeArgs['patientType']; + arrivalType = routeArgs['arrivalType']; + print(arrivalType); return BaseView( onModelReady: (model) => model.getLabs(patient), builder: (context, LabsViewModel model, widget) => AppScaffold( @@ -50,6 +51,43 @@ class LabsHomePage extends StatelessWidget { ], ), ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for New Lab Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], + ), + ), + ), + ), + ), ...List.generate( model.patientLabOrdersList.length, (index) => Column( diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index dedb5bd5..8d27e704 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -5,6 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.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/translations_delegate_base.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -15,8 +16,9 @@ import 'package:url_launcher/url_launcher.dart'; class RadiologyDetailsPage extends StatelessWidget { final FinalRadiology finalRadiology; final PatiantInformtion patient; - - RadiologyDetailsPage({Key key, this.finalRadiology, this.patient}); + final String patientType; + final String arrivalType; + RadiologyDetailsPage({Key key, this.finalRadiology, this.patient, this.patientType, this.arrivalType}); @override Widget build(BuildContext context) { @@ -27,54 +29,61 @@ class RadiologyDetailsPage extends StatelessWidget { lineItem: finalRadiology.invoiceLineItemNo, invoiceNo: finalRadiology.invoiceNo), builder: (_, model, widget) => AppScaffold( - appBarTitle: TranslationBase.of(context).radiologyReport, - isShowAppBar: true, + + isShowAppBar: false, baseViewModel: model, body: SingleChildScrollView( child: Column( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.center, - ), - Padding( - padding: const EdgeInsets.all(8.0), - child: Texts( - '${finalRadiology.reportData}', - textAlign: TextAlign.start, - fontSize: 17, - ), + PatientProfileHeaderWhitAppointment(patient: patient, + patientType: patientType??"0", + arrivalType: arrivalType??"0", + orderNo: finalRadiology.orderNo.toString(), + appointmentDate:finalRadiology.orderDate, + doctorName: finalRadiology.doctorName, + profileUrl: finalRadiology.doctorImageURL, + invoiceNO: finalRadiology.invoiceNo.toString(), ), SizedBox( height: MediaQuery.of(context).size.height * 0.2, - ) - ], - ), - ), - bottomSheet: Container( - width: double.infinity, - height: MediaQuery.of(context).size.height * 0.14, - // color: Colors.grey[100], - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Divider(), - if (model.radImageURL.isNotEmpty) - Container( - width: MediaQuery.of(context).size.width * 0.8, - child: Button( - - onTap: () { - launch(model.radImageURL); - }, - title: TranslationBase.of(context).openRad, - ), + ), + Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(12), + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox(height: 5,), + Texts(TranslationBase.of(context).generalResult), + SizedBox(height: 5,), + Texts( + '${finalRadiology.reportData}', + textAlign: TextAlign.start, + fontSize: 17, + color: Colors.grey, + ), + SizedBox(height: 25,), + Container( + width: MediaQuery.of(context).size.width * 0.8, + child: Button( + color: Colors.red, + onTap: () { + launch(model.radImageURL); + }, + title: TranslationBase.of(context).openRad, + ), + ), + ], ), + ), ], ), - )), + ), + ), ); } } diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 4698def1..6db06be5 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_details_page.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/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,6 +22,8 @@ class RadiologyHomePage extends StatelessWidget { ProjectViewModel projectViewModel = Provider.of(context); final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; return BaseView( onModelReady: (model) => model.getPatientRadOrders(patient), builder: (_, model, widget) => AppScaffold( @@ -31,42 +35,55 @@ class RadiologyHomePage extends StatelessWidget { child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), - ), + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Radiology',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Result',bold: true,fontSize: 22,), + ], + ), + ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), ), - ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model.setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for Radiology Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], ), ), ), - ) - ], - ), + ), + ), ...List.generate( model.finalRadiologyList.length, (index) => AppExpandableNotifier( diff --git a/lib/screens/prescription/prescription_items_page.dart b/lib/screens/prescription/prescription_items_page.dart index 67e957a2..031ee85f 100644 --- a/lib/screens/prescription/prescription_items_page.dart +++ b/lib/screens/prescription/prescription_items_page.dart @@ -30,6 +30,50 @@ class PrescriptionItemsPage extends StatelessWidget { child: Container( child: Column( children: [ + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(12), + color: Colors.white, + ), + margin: EdgeInsets.all(12), + child: Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + margin: EdgeInsets.only(left: 18,right: 18), + child: Texts('Name ',bold: true,)), + Row( + children: [ + SizedBox(width: 18,), + Container( + decoration: BoxDecoration( + shape: BoxShape.circle, + border: Border.all(width: 0.5,color: Colors.grey) + ), + height: 45, + width: 45, + ), + SizedBox(width: 10,), + Expanded(child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Route: Monthly'), + Texts('Does: 2 Time a day with 1 hour gap'), + SizedBox(height: 12,), + Texts('Note: 2 Time a day with 1 hour gap'), + ], + ),) + + + ], + ) + ], + ), + ), + ), + if (!prescriptions.isInOutPatient) ...List.generate( model.prescriptionReportList.length, diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index 039bd7f2..9f7e7f2f 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -6,6 +6,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_items_page.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/profile/patient-profile-header-new-design.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_expandable_notifier_new.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; @@ -20,92 +22,90 @@ class PrescriptionsPage extends StatelessWidget { Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; - + String patientType = routeArgs['patientType']; + String arrivalType = routeArgs['arrivalType']; ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getPrescriptions(patient), builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBarTitle: TranslationBase.of(context).prescriptions, + isShowAppBar: false, body: FractionallySizedBox( widthFactor: 1.0, child: ListView( physics: BouncingScrollPhysics(), children: [ - Row( - children: [ - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Clinic), - child: ListTile( - title: Text(TranslationBase.of(context).clinic), - leading: Radio( - value: FilterType.Clinic, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, + PatientProfileHeaderNewDesign(patient,arrivalType??'0',patientType), + SizedBox(height: 12,), + Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts('Order',style: "caption2",color: Colors.black,fontSize: 13,), + Texts('Prescriptions',bold: true,fontSize: 22,), + ], + ), + ), + if(patientType!=null && patientType=='7') + InkWell( + onTap: (){ + //TODO Hussam call the add page here + }, + child: Container( + width: double.maxFinite, + height: 140, + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Container( + height: 90, + child: Column( + children: [ + Container( + height: 40, + width: 40, + decoration: BoxDecoration( + color: Colors.grey[600], + borderRadius: BorderRadius.circular(10), + ), + child: Center( + child: Icon(Icons.add,color: Colors.white,), + ), + ), + SizedBox(height: 10,), + Texts('Apply for New Prescriptions Order',color: Colors.grey[600],fontWeight: FontWeight.w600,) + ], ), ), ), ), - Expanded( - flex: 1, - child: InkWell( - onTap: () => model - .setFilterType(FilterType.Hospital), - child: ListTile( - title: Text(TranslationBase.of(context).hospital), - leading: Radio( - value: FilterType.Hospital, - groupValue: model.filterType, - onChanged: (FilterType value) { - model.setFilterType(value); - }, - ), + ), + ...List.generate(model.prescriptionsList.length, (index) => InkWell( + onTap: () => Navigator.push( + context, + FadePage( + page: PrescriptionItemsPage( + prescriptions: model.prescriptionsList[index], + patient: patient, ), ), + ), + child: DoctorCard( + doctorName: model.prescriptionsList[index].doctorName, + profileUrl: model.prescriptionsList[index].doctorImageURL, + branch: model.prescriptionsList[index].name, + appointmentDate: DateUtils.getDateTimeFromServerFormat(model.prescriptionsList[index].appointmentDate,), + orderNo: model.prescriptionsList[index].appointmentNo.toString(), + invoiceNO:model.prescriptionsList[index].appointmentNo.toString(), + ) - ], - ), - ...List.generate( - model.prescriptionsOrderList.length, - (index) => AppExpandableNotifier( - title: model - .prescriptionsOrderList[index].filterName, - bodyWidget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: model - .prescriptionsOrderList[index].prescriptionsList - .map((prescriptions) { - return InkWell( - onTap: () => Navigator.push( - context, - FadePage( - page: PrescriptionItemsPage( - prescriptions: prescriptions, - patient: patient, - ), - ), - ), - child: DoctorCard( - doctorName: prescriptions.doctorName, - profileUrl: prescriptions.doctorImageURL, - branch: prescriptions.name, - appointmentDate: DateUtils.getDateTimeFromServerFormat(prescriptions.appointmentDate,), - orderNo: prescriptions.appointmentNo.toString(), - invoiceNO:prescriptions.appointmentNo.toString(), - ) + )) - ); - }).toList(), - )), - ) ], ), ), diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart index 984d4350..60a3528d 100644 --- a/lib/widgets/shared/app_button.dart +++ b/lib/widgets/shared/app_button.dart @@ -2,18 +2,22 @@ import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; class Button extends StatefulWidget { + final String title; + final Widget icon; + final VoidCallback onTap; + final bool loading; + final Color color; + Button({ Key key, - this.title: "", + this.title = "", this.icon, this.onTap, - this.loading: false, + this.loading= false, + this.color, }) : super(key: key); - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; + @override _ButtonState createState() => _ButtonState(); @@ -86,7 +90,8 @@ class _ButtonState extends State