diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 0351db77..08b3feb2 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -322,6 +322,7 @@ class PatientReferralViewModel extends BaseViewModel { patient.doctorId = referredPatient.doctorID; patient.doctorName = referredPatient.doctorName; patient.patientId = referredPatient.patientID; + patient.patientMRN = referredPatient.patientID; patient.firstName = referredPatient.firstName; patient.middleName = referredPatient.middleName; patient.lastName = referredPatient.lastName; @@ -339,6 +340,8 @@ class PatientReferralViewModel extends BaseViewModel { patient.nationalityFlagURL = referredPatient.nationalityFlagURL; patient.age = referredPatient.age; patient.clinicDescription = referredPatient.clinicDescription; + patient.appointmentNo = referredPatient.appointmentNo; + return patient; } diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index c95a28d8..8dce7d60 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -12,8 +12,13 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; -class ReferredPatientScreen extends StatelessWidget { +class ReferredPatientScreen extends StatefulWidget { + @override + _ReferredPatientScreenState createState() => _ReferredPatientScreenState(); +} + +class _ReferredPatientScreenState extends State { PatientType patientType = PatientType.IN_PATIENT; @override @@ -30,7 +35,9 @@ class ReferredPatientScreen extends StatelessWidget { margin: EdgeInsets.only(top: 70), child: PatientTypeRadioWidget( (patientType) async { - this.patientType = patientType; + setState(() { + this.patientType = patientType; + }); GifLoaderDialogUtils.showMyDialog(context); if (patientType == PatientType.IN_PATIENT) { await model.getMyReferredPatient(isFirstTime: false); @@ -75,7 +82,7 @@ class ReferredPatientScreen extends StatelessWidget { context, FadePage( page: ReferredPatientDetailScreen( - model.getReferredPatientItem(index)), + model.getReferredPatientItem(index), this.patientType), ), ); }, diff --git a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart index b3f11c51..f6d3b8d7 100644 --- a/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart +++ b/lib/screens/patients/profile/referral/referred_patient_detail_in-paint.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/core/enum/PatientType.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/icons_app/doctor_app_icons.dart'; @@ -18,8 +19,9 @@ import '../../../../routes.dart'; class ReferredPatientDetailScreen extends StatelessWidget { final MyReferredPatientModel referredPatient; + final PatientType patientType; - ReferredPatientDetailScreen(this.referredPatient); + ReferredPatientDetailScreen(this.referredPatient, this.patientType); @override Widget build(BuildContext context) { @@ -74,7 +76,8 @@ class ReferredPatientDetailScreen extends StatelessWidget { .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": true, + "isInpatient": + patientType == PatientType.IN_PATIENT, "arrivalType": "1", "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), @@ -93,14 +96,15 @@ class ReferredPatientDetailScreen extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ InkWell( - onTap: (){ + onTap: () { PatiantInformtion patient = - model.getPatientFromReferral(referredPatient); + model.getPatientFromReferral(referredPatient); Navigator.of(context) .pushNamed(PATIENTS_PROFILE, arguments: { "patient": patient, "patientType": "1", - "isInpatient": true, + "isInpatient": + patientType == PatientType.IN_PATIENT, "arrivalType": "1", "from": AppDateUtils.convertDateToFormat( DateTime.now(), 'yyyy-MM-dd'), @@ -236,36 +240,37 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ], ), - if(referredPatient - .frequencyDescription != null) - Row( - mainAxisAlignment: - MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .frequency + - ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * - SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient - .frequencyDescription, + if (referredPatient + .frequencyDescription != + null) + Row( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .frequency + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), + fontWeight: FontWeight.w600, + fontSize: 1.7 * + SizeConfig.textMultiplier, + color: Color(0XFF575757), ), - ), - ], - ), + Expanded( + child: AppText( + referredPatient + .frequencyDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, + color: Color(0XFF2E303A), + ), + ), + ], + ), ], ), ), @@ -303,56 +308,65 @@ class ReferredPatientDetailScreen extends StatelessWidget { ) ], ), - if(referredPatient.priorityDescription != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context).priority + - ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - AppText( - referredPatient.priorityDescription, - fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 14, - color: Color(0XFF2E303A), - ), - ], - ), - if(referredPatient.mAXResponseTime != null) - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( - TranslationBase.of(context) - .maxResponseTime + - ": ", - fontFamily: 'Poppins', - fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, - color: Color(0XFF575757), - ), - Expanded( - child: AppText( - referredPatient.mAXResponseTime != null?AppDateUtils.convertDateFromServerFormat( - referredPatient.mAXResponseTime, - "dd MMM,yyyy"):'', + if (referredPatient.priorityDescription != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context).priority + + ": ", fontFamily: 'Poppins', - fontWeight: FontWeight.w700, + fontWeight: FontWeight.w600, fontSize: - 1.8 * SizeConfig.textMultiplier, + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + AppText( + referredPatient.priorityDescription, + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: 14, color: Color(0XFF2E303A), ), - ), - ], - ), + ], + ), + if (referredPatient.mAXResponseTime != null) + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase.of(context) + .maxResponseTime + + ": ", + fontFamily: 'Poppins', + fontWeight: FontWeight.w600, + fontSize: + 1.7 * SizeConfig.textMultiplier, + color: Color(0XFF575757), + ), + Expanded( + child: AppText( + referredPatient.mAXResponseTime != + null + ? AppDateUtils + .convertDateFromServerFormat( + referredPatient + .mAXResponseTime, + "dd MMM,yyyy") + : '', + fontFamily: 'Poppins', + fontWeight: FontWeight.w700, + fontSize: + 1.8 * SizeConfig.textMultiplier, + color: Color(0XFF2E303A), + ), + ), + ], + ), Row( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -518,11 +532,15 @@ class ReferredPatientDetailScreen extends StatelessWidget { color: Color(0XFF2E303A), ), AppText( - referredPatient - .referredDoctorRemarks == null ?'':referredPatient - .referredDoctorRemarks.isNotEmpty - ? referredPatient.referredDoctorRemarks - : TranslationBase.of(context).notRepliedYet, + referredPatient.referredDoctorRemarks == + null + ? '' + : referredPatient.referredDoctorRemarks + .isNotEmpty + ? referredPatient + .referredDoctorRemarks + : TranslationBase.of(context) + .notRepliedYet, fontFamily: 'Poppins', fontWeight: FontWeight.w600, fontSize: 1.6 * SizeConfig.textMultiplier, @@ -538,6 +556,7 @@ class ReferredPatientDetailScreen extends StatelessWidget { ), ), ), + if (patientType == PatientType.IN_PATIENT) Container( margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16), child: AppButton( @@ -548,9 +567,11 @@ class ReferredPatientDetailScreen extends StatelessWidget { fontSize: 1.8, hPadding: 8, vPadding: 12, - disabled: referredPatient.referredDoctorRemarks == null? true: referredPatient.referredDoctorRemarks.isNotEmpty - ? false - : true, + disabled: referredPatient.referredDoctorRemarks == null + ? true + : referredPatient.referredDoctorRemarks.isNotEmpty + ? false + : true, onPressed: () async { await model.verifyReferralDoctorRemarks(referredPatient); if (model.state == ViewState.ErrorLocal) { diff --git a/pubspec.lock b/pubspec.lock index 18379111..a408ffd5 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.2" + version: "0.40.6" archive: dependency: transitive description: @@ -119,7 +119,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: @@ -280,7 +280,7 @@ packages: name: dart_style url: "https://pub.dartlang.org" source: hosted - version: "1.3.12" + version: "1.3.10" date_time_picker: dependency: "direct main" description: @@ -629,7 +629,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: @@ -921,7 +921,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1119,5 +1119,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"