From d78a3e168ec2c57d0ceca1b67886261a7d4cb221 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Thu, 22 Apr 2021 17:11:32 +0300 Subject: [PATCH 1/5] hoh design fixes --- lib/screens/patients/profile/lab_result/LabResultWidget.dart | 2 +- .../patient_profile_header_with_appointment_card_app_bar.dart | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/screens/patients/profile/lab_result/LabResultWidget.dart b/lib/screens/patients/profile/lab_result/LabResultWidget.dart index c63f5bdf..72131f59 100644 --- a/lib/screens/patients/profile/lab_result/LabResultWidget.dart +++ b/lib/screens/patients/profile/lab_result/LabResultWidget.dart @@ -135,7 +135,7 @@ class LabResultWidget extends StatelessWidget { color: Colors.white, child: Center( child: AppText( - patientLabResultList[index].resultValue + + "${patientLabResultList[index].resultValue ?? ""}" + " " + "${patientLabResultList[index].uOM ?? ""}", textAlign: TextAlign.center, diff --git a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart index ae85a574..5de6299c 100644 --- a/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart +++ b/lib/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart @@ -326,7 +326,7 @@ class PatientProfileHeaderWhitAppointmentAppBar extends StatelessWidget '${TranslationBase.of(context).dr}$doctorName', color: Colors.black, fontWeight: FontWeight.w600, - fontSize: 12, + fontSize: 9, ), if (orderNo != null && !isPrescriptions) Row( From c7275a3106642edde39c62ed770b488fc8e6afc5 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Thu, 22 Apr 2021 17:14:03 +0300 Subject: [PATCH 2/5] small update in procedure --- lib/screens/procedures/ProcedureCard.dart | 32 +++++++++++------------ 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/lib/screens/procedures/ProcedureCard.dart b/lib/screens/procedures/ProcedureCard.dart index f71b1ee8..0f865701 100644 --- a/lib/screens/procedures/ProcedureCard.dart +++ b/lib/screens/procedures/ProcedureCard.dart @@ -185,22 +185,22 @@ class ProcedureCard extends StatelessWidget { ), ), ),*/ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - AppText( - entityList.remarks.toString() ?? '', - fontSize: 12, - ), - if (entityList.categoryID == 2 || - entityList.categoryID == 4 && - doctorName == entityList.doctorName) - InkWell( - child: Icon(DoctorApp.edit), - onTap: onTap, - ) - ], - ) + // Row( + // mainAxisAlignment: MainAxisAlignment.spaceBetween, + // children: [ + // AppText( + // entityList.remarks.toString() ?? '', + // fontSize: 12, + // ), + // if (entityList.categoryID == 2 || + // entityList.categoryID == 4 && + // doctorName == entityList.doctorName) + // InkWell( + // child: Icon(DoctorApp.edit), + // onTap: onTap, + // ) + // ], + // ) ], ), //onTap: onTap, From 79037d8fc7fe30077d068f1e5cfb810ff2ee4b3b Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 22 Apr 2021 17:15:15 +0300 Subject: [PATCH 3/5] add condition --- lib/screens/patients/profile/patient_profile_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 59d10b25..db583482 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -65,7 +65,7 @@ class PatientProfileScreen extends StatelessWidget { IsLoginForDoctorApp: true, PatientOutSA: false); - if(patient.patientType ==1) { + if(patient.patientType ==1 || patient.admissionNo==null || patient.admissionNo =="0" ) { patientViewModel.getPatientList(patientReq, "1", isBusyLocal: false).then((response) { if (response['MessageStatus'] == 1) { From b37c607813cd7b3dfc99d0bd99c4af1bb8c533e6 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 22 Apr 2021 18:17:30 +0300 Subject: [PATCH 4/5] done the referral service --- lib/client/base_app_client.dart | 2 +- lib/core/model/ReferralRequest.dart | 108 ++++++++++++++++++ lib/core/service/ReferralService.dart | 56 +++++---- .../viewModel/patient-referral-viewmodel.dart | 24 +++- lib/locator.dart | 2 + .../refer-patient-screen-in-patient.dart | 29 +++-- 6 files changed, 175 insertions(+), 46 deletions(-) create mode 100644 lib/core/model/ReferralRequest.dart diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index afddce7f..eac29db8 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -100,7 +100,7 @@ class BaseAppClient { }); final int statusCode = response.statusCode; if (statusCode < 200 || statusCode >= 400) { - onFailure('Error While Fetching data', statusCode); + onFailure(Helpers.generateContactAdminMsg(), statusCode); } else { var parsed = json.decode(response.body.toString()); diff --git a/lib/core/model/ReferralRequest.dart b/lib/core/model/ReferralRequest.dart new file mode 100644 index 00000000..b3ad1f03 --- /dev/null +++ b/lib/core/model/ReferralRequest.dart @@ -0,0 +1,108 @@ +class ReferralRequest { + String roomID; + String referralClinic; + String referralDoctor; + int createdBy; + int editedBy; + int patientID; + int patientTypeID; + int referringClinic; + int referringDoctor; + int projectID; + int admissionNo; + String referringDoctorRemarks; + String priority; + String frequency; + String extension; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + ReferralRequest( + {this.roomID, + this.referralClinic, + this.referralDoctor, + this.createdBy, + this.editedBy, + this.patientID, + this.patientTypeID, + this.referringClinic, + this.referringDoctor, + this.projectID, + this.admissionNo, + this.referringDoctorRemarks, + this.priority, + this.frequency, + this.extension, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + ReferralRequest.fromJson(Map json) { + roomID = json['RoomID']; + referralClinic = json['ReferralClinic']; + referralDoctor = json['ReferralDoctor']; + createdBy = json['CreatedBy']; + editedBy = json['EditedBy']; + patientID = json['PatientID']; + patientTypeID = json['PatientTypeID']; + referringClinic = json['ReferringClinic']; + referringDoctor = json['ReferringDoctor']; + projectID = json['ProjectID']; + admissionNo = json['AdmissionNo']; + referringDoctorRemarks = json['ReferringDoctorRemarks']; + priority = json['Priority']; + frequency = json['Frequency']; + extension = json['Extension']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['RoomID'] = this.roomID; + data['ReferralClinic'] = this.referralClinic; + data['ReferralDoctor'] = this.referralDoctor; + data['CreatedBy'] = this.createdBy; + data['EditedBy'] = this.editedBy; + data['PatientID'] = this.patientID; + data['PatientTypeID'] = this.patientTypeID; + data['ReferringClinic'] = this.referringClinic; + data['ReferringDoctor'] = this.referringDoctor; + data['ProjectID'] = this.projectID; + data['AdmissionNo'] = this.admissionNo; + data['ReferringDoctorRemarks'] = this.referringDoctorRemarks; + data['Priority'] = this.priority; + data['Frequency'] = this.frequency; + data['Extension'] = this.extension; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/core/service/ReferralService.dart b/lib/core/service/ReferralService.dart index 532041dd..2887abde 100644 --- a/lib/core/service/ReferralService.dart +++ b/lib/core/service/ReferralService.dart @@ -1,48 +1,46 @@ import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/core/model/ReferralRequest.dart'; import 'package:doctor_app_flutter/core/service/base/base_service.dart'; class ReferralService extends BaseService { -//TODO Jammal Future referralPatient( - {String admissionNo, + {int admissionNo, String roomID, - String referralClinic, - String referralDoctor, - String patientID, - String patientTypeID, - String referringClinic, + int referralClinic, + int referralDoctor, + int patientID, + int patientTypeID, + int priority, + int frequency, String referringDoctorRemarks, - String priority,String frequency,String extension}) async { + String extension}) async { await getDoctorProfile(); - hasError = false; - Map body = Map(); - body['ProjectID'] = doctorProfile.projectID; - body['AdmissionNo'] = admissionNo; - body['RoomID'] = roomID; - body['ReferralClinic'] = referralClinic; - body['ReferralDoctor'] = referralDoctor; - body['CreatedBy'] = doctorProfile.doctorID; - body['EditedBy'] = doctorProfile.doctorID; - body['PatientID'] = patientID; - body['PatientTypeID'] = patientTypeID; - body['ReferringClinic'] = referringClinic; - body['ReferringDoctor'] = doctorProfile.doctorID; - body['ReferringDoctorRemarks'] = referringDoctorRemarks; - body['Priority'] = priority; - body['Frequency'] = frequency; - body['Extension'] = extension; + ReferralRequest referralRequest = ReferralRequest(); + referralRequest.admissionNo = admissionNo; + referralRequest.roomID = roomID; + referralRequest.referralClinic = referralClinic.toString(); + referralRequest.referralDoctor = referralDoctor.toString(); + referralRequest.patientID = patientID; + referralRequest.patientTypeID = patientTypeID; + referralRequest.priority = priority.toString(); + referralRequest.frequency = frequency.toString(); + referralRequest.referringDoctorRemarks = referringDoctorRemarks; + referralRequest.referringClinic = doctorProfile.clinicID; + referralRequest.referringDoctor = doctorProfile.doctorID; + referralRequest.extension = extension; + referralRequest.editedBy = doctorProfile.doctorID; + referralRequest.createdBy = doctorProfile.doctorID; + referralRequest.patientOutSA = false; await baseAppClient.post( REFER_TO_DOCTOR, - onSuccess: (dynamic response, int statusCode) { - - }, + onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) { hasError = true; super.error = error; }, - body: body, + body: referralRequest.toJson(), ); } } diff --git a/lib/core/viewModel/patient-referral-viewmodel.dart b/lib/core/viewModel/patient-referral-viewmodel.dart index 679aa0de..c4666f6f 100644 --- a/lib/core/viewModel/patient-referral-viewmodel.dart +++ b/lib/core/viewModel/patient-referral-viewmodel.dart @@ -1,5 +1,6 @@ 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/ReferralService.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'; @@ -16,6 +17,9 @@ class PatientReferralViewModel extends BaseViewModel { PatientReferralService _referralPatientService = locator(); + ReferralService _referralService = + locator(); + List get branchesList => _referralPatientService.projectsList; List get clinicsList => _referralPatientService.clinicsList; @@ -173,7 +177,25 @@ class PatientReferralViewModel extends BaseViewModel { String referralDate, String remarks, String ext}) async { - + setState(ViewState.Busy); + await _referralService.referralPatient( + patientID: patient.patientId, + roomID: patient.roomId, + referralClinic: clinicID, + admissionNo: patient.appointmentNo, + referralDoctor: doctorID, + patientTypeID: patient.patientType, + referringDoctorRemarks:remarks, + priority: priority, + frequency: frequencyCode, + extension: ext, + ); + if (_referralService.hasError) { + error = _referralService.error; + setState(ViewState.ErrorLocal); + } else { + setState(ViewState.Idle); + } } Future getPatientDetails( diff --git a/lib/locator.dart b/lib/locator.dart index d64a8ed3..79efbb9a 100644 --- a/lib/locator.dart +++ b/lib/locator.dart @@ -16,6 +16,7 @@ import 'package:get_it/get_it.dart'; import 'core/service/InsuranceCardService.dart'; import 'core/service/PatientMuseService.dart'; +import 'core/service/ReferralService.dart'; import 'core/service/SOAP_service.dart'; import 'core/service/labs_service.dart'; import 'core/service/patient-admission-request-service.dart'; @@ -72,6 +73,7 @@ void setupLocator() { locator.registerLazySingleton(() => InsuranceCardService()); locator.registerLazySingleton(() => RadiologyService()); locator.registerLazySingleton(() => PrescriptionsService()); + locator.registerLazySingleton(() => ReferralService()); /// View Model locator.registerFactory(() => DoctorReplayViewModel()); diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 2ac6d2e0..40ea26b7 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -383,11 +383,7 @@ class _PatientMakeInPatientReferralScreenState AppTextFieldCustom( hintText: TranslationBase.of(context).ext, controller: _extController, - inputType: TextInputType.number, - inputFormatters: [ - FilteringTextInputFormatter.allow( - RegExp(ONLY_NUMBERS)) - ], + inputType: TextInputType.text, ), SizedBox( height: 10, @@ -411,7 +407,7 @@ class _PatientMakeInPatientReferralScreenState title: TranslationBase.of(context).refer, fontWeight: FontWeight.w700, color: Color(0XFF359846), - onPressed: () { + onPressed: () async{ setState(() { if (_referTo == null) { branchError = @@ -449,9 +445,9 @@ class _PatientMakeInPatientReferralScreenState _selectedClinic == null || _selectedDoctor == null || _remarksController.text == null || - _extController.text == null) return; - model - .makeInPatientReferral( + _extController.text == null) return;{ + + await model.makeInPatientReferral( patient: patient, projectID: _selectedBranch['facilityId'], clinicID: _selectedClinic['ClinicID'], @@ -461,12 +457,15 @@ class _PatientMakeInPatientReferralScreenState remarks: _remarksController.text, priority: _activePriority, referralDate: appointmentDate - ) - .then((_) { - DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).referralSuccessMsg); - Navigator.pop(context); - }); + ); + if(model.state == ViewState.ErrorLocal) + DrAppToastMsg.showErrorToast(model.error); + else{ + DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); + Navigator.pop(context); + } + + } }, ), ) From 0ded3a5a0322537cf59db0e277e73d9fd15d5e45 Mon Sep 17 00:00:00 2001 From: Mohammad Aljammal Date: Thu, 22 Apr 2021 21:03:43 +0300 Subject: [PATCH 5/5] hot fixes --- lib/models/patient/patiant_info_model.dart | 10 +- .../profile/lab_result/labs_home_page.dart | 2 +- .../profile/patient_profile_screen.dart | 256 +++++++++--------- 3 files changed, 132 insertions(+), 136 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 8903791c..ec0b0bfb 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -175,25 +175,25 @@ class PatiantInformtion { startTime: json["startTime"], appointmentNo: json['appointmentNo'] ?? json['AppointmentNo'], appointmentType: json['appointmentType'], - appointmentTypeId: json['appointmentTypeId'], + appointmentTypeId: json['appointmentTypeId']?? json['appointmentTypeid'], arrivedOn: json['arrivedOn'], clinicGroupId: json['clinicGroupId'], companyName: json['companyName'], dischargeStatus: json['dischargeStatus'], doctorDetails: json['doctorDetails'], endTime: json['endTime'], - episodeNo: json['episodeNo'] ?? json['EpisodeID'], + episodeNo: json['episodeNo'] ?? json['EpisodeID'] ?? json['EpisodeNo'], fallRiskScore: json['fallRiskScore'], isSigned: json['isSigned'], medicationOrders: json['medicationOrders'], nationality: json['nationality'] ?? json['NationalityNameN'], patientMRN: json['patientMRN'] ?? json['PatientMRN'], - visitType: json['visitType'] ?? json['visitType'], + visitType: json['visitType'] ?? json['visitType']?? json['visitType'], nationalityFlagURL: json['NationalityFlagURL'] ?? json['NationalityFlagURL'], patientStatusType: - json['patientStatusType'] ?? json['patientStatusType'], - visitTypeId: json['visitTypeId'] ?? json['visitTypeId'], + json['patientStatusType'] ?? json['PatientStatusType'], + visitTypeId: json['visitTypeId'] ?? json['visitTypeId'] ?? json['visitTypeid'], startTimes: json['StartTime'] ?? json['StartTime'], ); } 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 ddb0d3de..188744c3 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -31,7 +31,7 @@ class LabsHomePage extends StatelessWidget { arrivalType = routeArgs['arrivalType']; print(arrivalType); return BaseView( - onModelReady: (model) => model.getLabs(patient,isArrived: (patientType != null && patientType == '7' && patient.patientStatusType == 43)), + onModelReady: (model) => model.getLabs(patient,isArrived: ( patient.patientStatusType == 43)), builder: (context, ProcedureViewModel model, widget) => AppScaffold( baseViewModel: model, backgroundColor: Colors.grey[100], diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index db583482..277bc472 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -43,57 +43,47 @@ class PatientProfileScreen extends StatelessWidget { return BaseView( onModelReady: (patientViewModel) async { - PatientModel patientReq = PatientModel( - ProjectID: 0, - ClinicID: 0, - DoctorID: 0, - FirstName: "0", - MiddleName: "0", - LastName: "0", - PatientMobileNumber: "0", - PatientIdentificationID: "0", - PatientID: patient.patientId, - From: "0", - To: "0", - LanguageID: 2, - stamp: "2020-03-02T13:56:39.170Z", - IPAdress: "11.11.11.11", - VersionID: 1.2, - Channel: 9, - TokenID: "@dm!n", - SessionID: "5G0yXn0Jnq", - IsLoginForDoctorApp: true, - PatientOutSA: false); - - if(patient.patientType ==1 || patient.admissionNo==null || patient.admissionNo =="0" ) { - patientViewModel.getPatientList(patientReq, "1", isBusyLocal: false).then((response) { - if (response['MessageStatus'] == 1) { - - if (response['List_MyInPatient'] != null) { - - List patientList = - ModelResponse.fromJson(response['List_MyInPatient']) - .list; - patient.admissionNo = patientList[0].admissionNo; - patient.admissionDate = patientList[0].admissionDate; - } else { - - DrAppToastMsg.showErrorToast('No patient'); - } - + PatientModel patientReq = PatientModel( + ProjectID: 0, + ClinicID: 0, + DoctorID: 0, + FirstName: "0", + MiddleName: "0", + LastName: "0", + PatientMobileNumber: "0", + PatientIdentificationID: "0", + PatientID: patient.patientId, + From: "0", + To: "0", + LanguageID: 2, + stamp: "2020-03-02T13:56:39.170Z", + IPAdress: "11.11.11.11", + VersionID: 1.2, + Channel: 9, + TokenID: "@dm!n", + SessionID: "5G0yXn0Jnq", + IsLoginForDoctorApp: true, + PatientOutSA: false); + + if (patientType == "1" && + (patient.admissionNo == null || + patient.admissionNo == "0")) { + patientViewModel + .getPatientList(patientReq, "1", isBusyLocal: false) + .then((response) { + if (response['MessageStatus'] == 1) { + if (response['List_MyInPatient'] != null) { + List patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; + patient.admissionNo = patientList[0].admissionNo; + patient.admissionDate = patientList[0].admissionDate; + } else { + DrAppToastMsg.showErrorToast('No patient'); } - - }).catchError((error) { - // setState(() { - // isLoading = false; - // }); - Helpers.showErrorToast(error.message); - //DrAppToastMsg.showErrorToast(error); - }); - - - - } + } + }).catchError((error) { + print(error); + }); + } }, builder: (_, patientViewModel, w) => AppScaffold( baseViewModel: patientViewModel, @@ -109,9 +99,9 @@ class PatientProfileScreen extends StatelessWidget { children: [ !isFromSearch && patientType == "1" ? PatientProfileHeaderNewDesignInPatient( - patient, patientType, arrivalType) + patient, patientType, arrivalType) : PatientProfileHeaderNewDesign( - patient, patientType, arrivalType), + patient, patientType, arrivalType), Expanded( child: Padding( padding: const EdgeInsets.all(16.0), @@ -120,8 +110,8 @@ class PatientProfileScreen extends StatelessWidget { children: [ isFromSearch ? ProfileMedicalInfoWidgetSearch( - patient: patient, - patientType: patientType, + patient: patient, + patientType: patientType, arrivalType: arrivalType, from: from, to: to, @@ -149,82 +139,89 @@ class PatientProfileScreen extends StatelessWidget { ], ), ), - if (int.parse(patientType) == 7 || - int.parse(patientType) == 6) - BaseView( - onModelReady: (model) async { - }, - builder: (_, model, w) => Positioned( - top: 175, - left: 20, - right: 20, - child: Row( - children: [ - Expanded(child: Container()), - if (patient.episodeNo == 0) - AppButton( - title: - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/create-episod.png", - color: Colors.white, - height: 30, + if (patient.patientStatusType !=null && patient.patientStatusType == 43 ) + BaseView( + onModelReady: (model) async {}, + builder: (_, model, w) => Positioned( + top: 175, + left: 20, + right: 20, + child: Row( + children: [ + Expanded(child: Container()), + if (patient.episodeNo == 0) + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/create-episod.png", + color: Colors.white, + height: 30, + ), + onPressed: () async { + 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) + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, + vPadding: 8, + radius: 30, + hPadding: 20, + fontWeight: FontWeight.normal, + fontSize: 1.6, + icon: Image.asset( + "assets/images/modilfy-episode.png", + color: Colors.white, + height: 30, + ), + onPressed: () { + if (patient.patientStatusType == + 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: { + 'patient': patient + }); + } + }), + ], ), - onPressed: () async { - 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) - AppButton( - title: - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - color: patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - fontColor: Colors.white, - vPadding: 8, - radius: 30, - hPadding: 20, - fontWeight: FontWeight.normal, - fontSize: 1.6, - icon: Image.asset( - "assets/images/modilfy-episode.png", - color: Colors.white, - height: 30, - ), - onPressed: () { - if (patient.patientStatusType == 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); - } - }), - ], - ), - )), + )), ], ), ), @@ -254,4 +251,3 @@ class AvatarWidget extends StatelessWidget { ); } } -