Radiology Orders implemented
							parent
							
								
									4c241b0dac
								
							
						
					
					
						commit
						6f07bc7c2c
					
				| @ -0,0 +1,232 @@ | ||||
| class PatientRadiologyResponseModel { | ||||
|   String? setupID; | ||||
|   int? projectID; | ||||
|   dynamic patientID; | ||||
|   int? invoiceLineItemNo; | ||||
|   int? invoiceNo; | ||||
|   int? doctorID; | ||||
|   int? clinicID; | ||||
|   String? orderDate; | ||||
|   String? reportData; | ||||
|   String? imageURL; | ||||
|   String? procedureID; | ||||
|   int? appointmentNo; | ||||
|   dynamic dIAPacsURL; | ||||
|   bool? isRead; | ||||
|   String? readOn; | ||||
|   dynamic admissionNo; | ||||
|   bool? isInOutPatient; | ||||
|   int? actualDoctorRate; | ||||
|   dynamic admissionDate; | ||||
|   dynamic admissionNumber; | ||||
|   dynamic appointmentDate; | ||||
|   dynamic appointmentNumber; | ||||
|   dynamic appointmentTime; | ||||
|   String? clinicDescription; | ||||
|   String? dIAPACSURL; | ||||
|   dynamic decimalDoctorRate; | ||||
|   String? description; | ||||
|   String? doctorImageURL; | ||||
|   String? doctorName; | ||||
|   num? doctorRate; | ||||
|   num? doctorStarsRate; | ||||
|   String? doctorTitle; | ||||
|   String? examId; | ||||
|   int? gender; | ||||
|   dynamic genderDescription; | ||||
|   int? invoiceNoVP; | ||||
|   String? invoiceType; | ||||
|   bool? isActiveDoctorProfile; | ||||
|   bool? isExecludeDoctor; | ||||
|   String? isInOutPatientDescription; | ||||
|   String? isInOutPatientDescriptionN; | ||||
|   bool? isLiveCareAppointment; | ||||
|   dynamic nationalityFlagURL; | ||||
|   int? noOfPatientsRate; | ||||
|   int? orderNo; | ||||
|   dynamic procedureName; | ||||
|   String? projectName; | ||||
|   String? qR; | ||||
|   String? reportDataHTML; | ||||
|   String? reportDataTextString; | ||||
|   dynamic strAppointmentDate; | ||||
|   dynamic strOrderDate; | ||||
|   bool? isCVI; | ||||
|   bool? isRadMedicalReport; | ||||
|   dynamic vida3Id; | ||||
| 
 | ||||
|   PatientRadiologyResponseModel( | ||||
|       {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.admissionDate, | ||||
|       this.admissionNumber, | ||||
|       this.appointmentDate, | ||||
|       this.appointmentNumber, | ||||
|       this.appointmentTime, | ||||
|       this.clinicDescription, | ||||
|       this.dIAPACSURL, | ||||
|       this.decimalDoctorRate, | ||||
|       this.description, | ||||
|       this.doctorImageURL, | ||||
|       this.doctorName, | ||||
|       this.doctorRate, | ||||
|       this.doctorStarsRate, | ||||
|       this.doctorTitle, | ||||
|       this.examId, | ||||
|       this.gender, | ||||
|       this.genderDescription, | ||||
|       this.invoiceNoVP, | ||||
|       this.invoiceType, | ||||
|       this.isActiveDoctorProfile, | ||||
|       this.isExecludeDoctor, | ||||
|       this.isInOutPatientDescription, | ||||
|       this.isInOutPatientDescriptionN, | ||||
|       this.isLiveCareAppointment, | ||||
|       this.nationalityFlagURL, | ||||
|       this.noOfPatientsRate, | ||||
|       this.orderNo, | ||||
|       this.procedureName, | ||||
|       this.projectName, | ||||
|       this.qR, | ||||
|       this.reportDataHTML, | ||||
|       this.reportDataTextString, | ||||
|       this.strAppointmentDate, | ||||
|       this.strOrderDate, | ||||
|       this.isCVI, | ||||
|       this.isRadMedicalReport, | ||||
|       this.vida3Id}); | ||||
| 
 | ||||
|   PatientRadiologyResponseModel.fromJson(Map<String, dynamic> json) { | ||||
|     setupID = json['SetupID']; | ||||
|     projectID = json['ProjectID']; | ||||
|     patientID = json['PatientID']; | ||||
|     invoiceLineItemNo = json['InvoiceLineItemNo']; | ||||
|     invoiceNo = json['InvoiceNo']; | ||||
|     doctorID = json['DoctorID']; | ||||
|     clinicID = json['ClinicID']; | ||||
|     orderDate = 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']; | ||||
|     admissionDate = json['AdmissionDate']; | ||||
|     admissionNumber = json['AdmissionNumber']; | ||||
|     appointmentDate = json['AppointmentDate']; | ||||
|     appointmentNumber = json['AppointmentNumber']; | ||||
|     appointmentTime = json['AppointmentTime']; | ||||
|     clinicDescription = json['ClinicDescription']; | ||||
|     dIAPACSURL = json['DIA_PACS_URL']; | ||||
|     decimalDoctorRate = json['DecimalDoctorRate']; | ||||
|     description = json['Description']; | ||||
|     doctorImageURL = json['DoctorImageURL']; | ||||
|     doctorName = json['DoctorName']; | ||||
|     doctorRate = json['DoctorRate']; | ||||
|     doctorStarsRate = json['DoctorStarsRate']; | ||||
|     doctorTitle = json['DoctorTitle']; | ||||
|     examId = json['Exam_id']; | ||||
|     gender = json['Gender']; | ||||
|     genderDescription = json['GenderDescription']; | ||||
|     invoiceNoVP = json['InvoiceNo_VP']; | ||||
|     invoiceType = json['InvoiceType']; | ||||
|     isActiveDoctorProfile = json['IsActiveDoctorProfile']; | ||||
|     isExecludeDoctor = json['IsExecludeDoctor']; | ||||
|     isInOutPatientDescription = json['IsInOutPatientDescription']; | ||||
|     isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN']; | ||||
|     isLiveCareAppointment = json['IsLiveCareAppointment']; | ||||
|     nationalityFlagURL = json['NationalityFlagURL']; | ||||
|     noOfPatientsRate = json['NoOfPatientsRate']; | ||||
|     orderNo = json['OrderNo']; | ||||
|     procedureName = json['ProcedureName']; | ||||
|     projectName = json['ProjectName']; | ||||
|     qR = json['QR']; | ||||
|     reportDataHTML = json['ReportDataHTML']; | ||||
|     reportDataTextString = json['ReportDataTextString']; | ||||
|     strAppointmentDate = json['StrAppointmentDate']; | ||||
|     strOrderDate = json['StrOrderDate']; | ||||
|     isCVI = json['isCVI']; | ||||
|     isRadMedicalReport = json['isRadMedicalReport']; | ||||
|     vida3Id = json['vida3Id']; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     final Map<String, dynamic> data = new Map<String, dynamic>(); | ||||
|     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['AdmissionDate'] = this.admissionDate; | ||||
|     data['AdmissionNumber'] = this.admissionNumber; | ||||
|     data['AppointmentDate'] = this.appointmentDate; | ||||
|     data['AppointmentNumber'] = this.appointmentNumber; | ||||
|     data['AppointmentTime'] = this.appointmentTime; | ||||
|     data['ClinicDescription'] = this.clinicDescription; | ||||
|     data['DIA_PACS_URL'] = this.dIAPACSURL; | ||||
|     data['DecimalDoctorRate'] = this.decimalDoctorRate; | ||||
|     data['Description'] = this.description; | ||||
|     data['DoctorImageURL'] = this.doctorImageURL; | ||||
|     data['DoctorName'] = this.doctorName; | ||||
|     data['DoctorRate'] = this.doctorRate; | ||||
|     data['DoctorStarsRate'] = this.doctorStarsRate; | ||||
|     data['DoctorTitle'] = this.doctorTitle; | ||||
|     data['Exam_id'] = this.examId; | ||||
|     data['Gender'] = this.gender; | ||||
|     data['GenderDescription'] = this.genderDescription; | ||||
|     data['InvoiceNo_VP'] = this.invoiceNoVP; | ||||
|     data['InvoiceType'] = this.invoiceType; | ||||
|     data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile; | ||||
|     data['IsExecludeDoctor'] = this.isExecludeDoctor; | ||||
|     data['IsInOutPatientDescription'] = this.isInOutPatientDescription; | ||||
|     data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN; | ||||
|     data['IsLiveCareAppointment'] = this.isLiveCareAppointment; | ||||
|     data['NationalityFlagURL'] = this.nationalityFlagURL; | ||||
|     data['NoOfPatientsRate'] = this.noOfPatientsRate; | ||||
|     data['OrderNo'] = this.orderNo; | ||||
|     data['ProcedureName'] = this.procedureName; | ||||
|     data['ProjectName'] = this.projectName; | ||||
|     data['QR'] = this.qR; | ||||
|     data['ReportDataHTML'] = this.reportDataHTML; | ||||
|     data['ReportDataTextString'] = this.reportDataTextString; | ||||
|     data['StrAppointmentDate'] = this.strAppointmentDate; | ||||
|     data['StrOrderDate'] = this.strOrderDate; | ||||
|     data['isCVI'] = this.isCVI; | ||||
|     data['isRadMedicalReport'] = this.isRadMedicalReport; | ||||
|     data['vida3Id'] = this.vida3Id; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,82 @@ | ||||
| import 'package:hmg_patient_app_new/core/api/api_client.dart'; | ||||
| import 'package:hmg_patient_app_new/core/api_consts.dart'; | ||||
| import 'package:hmg_patient_app_new/core/exceptions/api_failure.dart'; | ||||
| import 'package:hmg_patient_app_new/core/common_models/generic_api_model.dart'; | ||||
| import 'package:dartz/dartz.dart'; | ||||
| import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; | ||||
| import 'package:hmg_patient_app_new/features/radiology/models/resp_models/patient_radiology_response_model.dart'; | ||||
| import 'package:hmg_patient_app_new/services/logger_service.dart'; | ||||
| 
 | ||||
| abstract class RadiologyRepo { | ||||
|   Future<Either<Failure, GenericApiModel<List<PatientRadiologyResponseModel>>>> getPatientRadiologyOrders({required String patientId}); | ||||
| } | ||||
| 
 | ||||
| class RadiologyRepoImp implements RadiologyRepo { | ||||
|   final ApiClient apiClient; | ||||
|   final LoggerService loggerService; | ||||
| 
 | ||||
|   RadiologyRepoImp({required this.loggerService, required this.apiClient}); | ||||
| 
 | ||||
|   @override | ||||
|   Future<Either<Failure, GenericApiModel<List<PatientRadiologyResponseModel>>>> getPatientRadiologyOrders({required String patientId}) async { | ||||
|     final mapDevice = { | ||||
|       "isDentalAllowedBackend": false, | ||||
|       "VersionID": 50.0, | ||||
|       "Channel": 3, | ||||
|       "LanguageID": 2, | ||||
|       "IPAdress": "10.20.10.20", | ||||
|       "generalid": "Cs2020@2016\$2958", | ||||
|       "Latitude": 0.0, | ||||
|       "Longitude": 0.0, | ||||
|       "DeviceTypeID": 1, | ||||
|       "PatientType": 1, | ||||
|       "PatientTypeID": 1, | ||||
|       "TokenID": "@dm!n", | ||||
|       "PatientID": "1018977", | ||||
|       "PatientOutSA": "0", | ||||
|       "SessionID": "03478TYC02N80874CTYN04883475!?" | ||||
|     }; | ||||
| 
 | ||||
|     try { | ||||
|       GenericApiModel<List<PatientRadiologyResponseModel>>? apiResponse; | ||||
|       Failure? failure; | ||||
|       await apiClient.post( | ||||
|         GET_PATIENT_ORDERS, | ||||
|         body: mapDevice, | ||||
|         onFailure: (error, statusCode, {messageStatus, failureType}) { | ||||
|           failure = failureType; | ||||
|         }, | ||||
|         onSuccess: (response, statusCode, {messageStatus}) { | ||||
|           final radOrders; | ||||
|           try { | ||||
|             if (response['FinalRadiologyList'] != null && response['FinalRadiologyList'].length != 0) { | ||||
|               final list = response['FinalRadiologyList']; | ||||
|               radOrders = list.map((item) => PatientRadiologyResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientRadiologyResponseModel>(); | ||||
|             } else { | ||||
|               final list = response['FinalRadiologyListAPI']; | ||||
|               radOrders = list.map((item) => PatientRadiologyResponseModel.fromJson(item as Map<String, dynamic>)).toList().cast<PatientRadiologyResponseModel>(); | ||||
|             } | ||||
|             // final list = response['ListPLO']; | ||||
|             // if (list == null || list.isEmpty) { | ||||
|             //   throw Exception("lab list is empty"); | ||||
|             // } | ||||
| 
 | ||||
|             apiResponse = GenericApiModel<List<PatientRadiologyResponseModel>>( | ||||
|               messageStatus: messageStatus, | ||||
|               statusCode: statusCode, | ||||
|               errorMessage: null, | ||||
|               data: radOrders, | ||||
|             ); | ||||
|           } catch (e) { | ||||
|             failure = DataParsingFailure(e.toString()); | ||||
|           } | ||||
|         }, | ||||
|       ); | ||||
|       if (failure != null) return Left(failure!); | ||||
|       if (apiResponse == null) return Left(ServerFailure("Unknown error")); | ||||
|       return Right(apiResponse!); | ||||
|     } catch (e) { | ||||
|       return Left(UnknownFailure(e.toString())); | ||||
|     } | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,45 @@ | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:hmg_patient_app_new/features/lab/lab_repo.dart'; | ||||
| import 'package:hmg_patient_app_new/features/lab/models/resp_models/patient_lab_orders_response_model.dart'; | ||||
| import 'package:hmg_patient_app_new/features/radiology/radiology_repo.dart'; | ||||
| import 'package:hmg_patient_app_new/services/error_handler_service.dart'; | ||||
| 
 | ||||
| import 'models/resp_models/patient_radiology_response_model.dart'; | ||||
| 
 | ||||
| class RadiologyViewModel extends ChangeNotifier { | ||||
|   bool isRadiologyOrdersLoading = false; | ||||
| 
 | ||||
|   RadiologyRepo radiologyRepo; | ||||
|   ErrorHandlerService errorHandlerService; | ||||
| 
 | ||||
|   List<PatientRadiologyResponseModel> patientRadiologyOrders = []; | ||||
| 
 | ||||
|   RadiologyViewModel({required this.radiologyRepo, required this.errorHandlerService}); | ||||
| 
 | ||||
|   initRadiologyProvider() { | ||||
|     patientRadiologyOrders.clear(); | ||||
|     isRadiologyOrdersLoading = true; | ||||
|     getPatientRadiologyOrders(); | ||||
|     notifyListeners(); | ||||
|   } | ||||
| 
 | ||||
|   Future<void> getPatientRadiologyOrders({Function(dynamic)? onSuccess, Function(String)? onError}) async { | ||||
|     final result = await radiologyRepo.getPatientRadiologyOrders(patientId: "1231755"); | ||||
| 
 | ||||
|     result.fold( | ||||
|       (failure) async => await errorHandlerService.handleError(failure: failure), | ||||
|       (apiResponse) { | ||||
|         if (apiResponse.messageStatus == 2) { | ||||
|           // dialogService.showErrorDialog(message: apiResponse.errorMessage!, onOkPressed: () {}); | ||||
|         } else if (apiResponse.messageStatus == 1) { | ||||
|           patientRadiologyOrders = apiResponse.data!; | ||||
|           isRadiologyOrdersLoading = false; | ||||
|           notifyListeners(); | ||||
|           if (onSuccess != null) { | ||||
|             onSuccess(apiResponse); | ||||
|           } | ||||
|         } | ||||
|       }, | ||||
|     ); | ||||
|   } | ||||
| } | ||||
| @ -0,0 +1,251 @@ | ||||
| import 'dart:async'; | ||||
| 
 | ||||
| import 'package:easy_localization/easy_localization.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
| import 'package:flutter_staggered_animations/flutter_staggered_animations.dart'; | ||||
| import 'package:hmg_patient_app_new/core/app_assets.dart'; | ||||
| import 'package:hmg_patient_app_new/core/utils/date_util.dart'; | ||||
| import 'package:hmg_patient_app_new/core/utils/size_utils.dart'; | ||||
| import 'package:hmg_patient_app_new/core/utils/utils.dart'; | ||||
| import 'package:hmg_patient_app_new/extensions/string_extensions.dart'; | ||||
| import 'package:hmg_patient_app_new/extensions/widget_extensions.dart'; | ||||
| import 'package:hmg_patient_app_new/generated/locale_keys.g.dart'; | ||||
| import 'package:hmg_patient_app_new/features/lab/lab_view_model.dart'; | ||||
| import 'package:hmg_patient_app_new/theme/colors.dart'; | ||||
| import 'package:hmg_patient_app_new/widgets/buttons/custom_button.dart'; | ||||
| import 'package:hmg_patient_app_new/widgets/shimmer/movies_shimmer_widget.dart'; | ||||
| import 'package:provider/provider.dart'; | ||||
| 
 | ||||
| import '../../features/radiology/radiology_view_model.dart'; | ||||
| 
 | ||||
| class RadiologyOrdersPage extends StatefulWidget { | ||||
|   const RadiologyOrdersPage({super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   State<RadiologyOrdersPage> createState() => _RadiologyOrdersPageState(); | ||||
| } | ||||
| 
 | ||||
| class _RadiologyOrdersPageState extends State<RadiologyOrdersPage> { | ||||
|   late RadiologyViewModel radiologyViewModel; | ||||
| 
 | ||||
|   int? expandedIndex; | ||||
| 
 | ||||
|   @override | ||||
|   void initState() { | ||||
|     scheduleMicrotask(() { | ||||
|       radiologyViewModel.initRadiologyProvider(); | ||||
|     }); | ||||
|     super.initState(); | ||||
|   } | ||||
| 
 | ||||
|   @override | ||||
|   Widget build(BuildContext context) { | ||||
|     radiologyViewModel = Provider.of<RadiologyViewModel>(context); | ||||
|     return Scaffold( | ||||
|       backgroundColor: AppColors.bgScaffoldColor, | ||||
|       appBar: AppBar( | ||||
|         title: LocaleKeys.radiology.tr(context: context).toText18(), | ||||
|         backgroundColor: AppColors.bgScaffoldColor, | ||||
|       ), | ||||
|       body: Padding( | ||||
|         padding: EdgeInsets.all(24.h), | ||||
|         child: SingleChildScrollView( | ||||
|           child: Consumer<RadiologyViewModel>( | ||||
|             builder: (context, model, child) { | ||||
|               return Column( | ||||
|                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                 children: [ | ||||
|                   Row( | ||||
|                     mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                     children: [ | ||||
|                       LocaleKeys.radiology.tr(context: context).toText24(isBold: true), | ||||
|                       Utils.buildSvgWithAssets(icon: AppAssets.search_icon), | ||||
|                     ], | ||||
|                   ), | ||||
|                   SizedBox(height: 16.h), | ||||
|                   // Build Tab Bar | ||||
|                   SizedBox(height: 16.h), | ||||
|                   // Expandable list | ||||
|                   ListView.builder( | ||||
|                     shrinkWrap: true, | ||||
|                     physics: NeverScrollableScrollPhysics(), | ||||
|                     itemCount: model.isRadiologyOrdersLoading ? 5 : model.patientRadiologyOrders.length, | ||||
|                     itemBuilder: (context, index) { | ||||
|                       final isExpanded = expandedIndex == index; | ||||
|                       return model.isRadiologyOrdersLoading | ||||
|                           ? const MoviesShimmerWidget() | ||||
|                           : AnimationConfiguration.staggeredList( | ||||
|                               position: index, | ||||
|                               duration: const Duration(milliseconds: 500), | ||||
|                               child: SlideAnimation( | ||||
|                                 verticalOffset: 100.0, | ||||
|                                 child: FadeInAnimation( | ||||
|                                   child: AnimatedContainer( | ||||
|                                     duration: Duration(milliseconds: 300), | ||||
|                                     curve: Curves.easeInOut, | ||||
|                                     margin: EdgeInsets.symmetric(vertical: 8.h), | ||||
|                                     decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 20.h, hasShadow: true), | ||||
|                                     child: InkWell( | ||||
|                                       onTap: () { | ||||
|                                         setState(() { | ||||
|                                           expandedIndex = isExpanded ? null : index; | ||||
|                                         }); | ||||
|                                       }, | ||||
|                                       child: Column( | ||||
|                                         crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                         children: [ | ||||
|                                           Padding( | ||||
|                                             padding: EdgeInsets.all(16.h), | ||||
|                                             child: Column( | ||||
|                                               crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                               children: [ | ||||
|                                                 Row( | ||||
|                                                   mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                                                   children: [ | ||||
|                                                     CustomButton( | ||||
|                                                       text: LocaleKeys.resultsAvailable.tr(context: context), | ||||
|                                                       onPressed: () {}, | ||||
|                                                       backgroundColor: AppColors.successColor.withOpacity(0.15), | ||||
|                                                       borderColor: AppColors.successColor.withOpacity(0.01), | ||||
|                                                       textColor: AppColors.successColor, | ||||
|                                                       fontSize: 10, | ||||
|                                                       fontWeight: FontWeight.w500, | ||||
|                                                       borderRadius: 8, | ||||
|                                                       padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                                                       height: 30.h, | ||||
|                                                     ), | ||||
|                                                     Icon(isExpanded ? Icons.expand_less : Icons.expand_more), | ||||
|                                                   ], | ||||
|                                                 ), | ||||
|                                                 SizedBox(height: 8.h), | ||||
|                                                 Row( | ||||
|                                                   children: [ | ||||
|                                                     Image.network( | ||||
|                                                       model.patientRadiologyOrders[index].doctorImageURL!, | ||||
|                                                       width: 24.h, | ||||
|                                                       height: 24.h, | ||||
|                                                       fit: BoxFit.fill, | ||||
|                                                     ).circle(100), | ||||
|                                                     SizedBox(width: 4.h), | ||||
|                                                     model.patientRadiologyOrders[index].doctorName!.toText16(isBold: true) | ||||
|                                                   ], | ||||
|                                                 ), | ||||
|                                                 SizedBox(height: 8.h), | ||||
|                                                 Row( | ||||
|                                                   children: [ | ||||
|                                                     CustomButton( | ||||
|                                                       text: DateUtil.formatDateToDate(DateUtil.convertStringToDate(model.patientRadiologyOrders[index].orderDate), false), | ||||
|                                                       onPressed: () {}, | ||||
|                                                       backgroundColor: AppColors.greyColor, | ||||
|                                                       borderColor: AppColors.greyColor, | ||||
|                                                       textColor: AppColors.blackColor, | ||||
|                                                       fontSize: 12, | ||||
|                                                       fontWeight: FontWeight.w500, | ||||
|                                                       borderRadius: 8, | ||||
|                                                       padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                                                       height: 24.h, | ||||
|                                                     ), | ||||
|                                                     SizedBox(width: 8.h), | ||||
|                                                     CustomButton( | ||||
|                                                       text: model.patientRadiologyOrders[index].clinicDescription!, | ||||
|                                                       onPressed: () {}, | ||||
|                                                       backgroundColor: AppColors.greyColor, | ||||
|                                                       borderColor: AppColors.greyColor, | ||||
|                                                       textColor: AppColors.blackColor, | ||||
|                                                       fontSize: 12, | ||||
|                                                       fontWeight: FontWeight.w500, | ||||
|                                                       borderRadius: 8, | ||||
|                                                       padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                                                       height: 24.h, | ||||
|                                                     ), | ||||
|                                                   ], | ||||
|                                                 ), | ||||
|                                               ], | ||||
|                                             ), | ||||
|                                           ), | ||||
|                                           AnimatedCrossFade( | ||||
|                                             firstChild: SizedBox.shrink(), | ||||
|                                             secondChild: Padding( | ||||
|                                               padding: EdgeInsets.symmetric(horizontal: 16.h, vertical: 8.h), | ||||
|                                               child: Column( | ||||
|                                                 crossAxisAlignment: CrossAxisAlignment.start, | ||||
|                                                 children: [ | ||||
|                                                   Padding( | ||||
|                                                     padding: EdgeInsets.only(bottom: 8.h), | ||||
|                                                     child: '● ${model.patientRadiologyOrders[index].description}'.toText14(weight: FontWeight.w500), | ||||
|                                                   ), | ||||
|                                                   Row( | ||||
|                                                     mainAxisAlignment: MainAxisAlignment.spaceBetween, | ||||
|                                                     children: [ | ||||
|                                                       SizedBox(), | ||||
|                                                       CustomButton( | ||||
|                                                         icon: AppAssets.view_report_icon, | ||||
|                                                         iconColor: AppColors.primaryRedColor, | ||||
|                                                         iconSize: 16.h, | ||||
|                                                         text: LocaleKeys.viewReport.tr(context: context), | ||||
|                                                         onPressed: () {}, | ||||
|                                                         backgroundColor: AppColors.secondaryLightRedColor, | ||||
|                                                         borderColor: AppColors.secondaryLightRedColor, | ||||
|                                                         textColor: AppColors.primaryRedColor, | ||||
|                                                         fontSize: 14, | ||||
|                                                         fontWeight: FontWeight.bold, | ||||
|                                                         borderRadius: 12, | ||||
|                                                         padding: EdgeInsets.fromLTRB(10, 0, 10, 0), | ||||
|                                                         height: 40.h, | ||||
|                                                       ), | ||||
|                                                     ], | ||||
|                                                   ), | ||||
|                                                 ], | ||||
|                                               ), | ||||
|                                             ), | ||||
|                                             crossFadeState: isExpanded ? CrossFadeState.showSecond : CrossFadeState.showFirst, | ||||
|                                             duration: Duration(milliseconds: 300), | ||||
|                                           ), | ||||
|                                         ], | ||||
|                                       ), | ||||
|                                     ), | ||||
|                                   ), | ||||
|                                 ), | ||||
|                               ), | ||||
|                             ); | ||||
|                     }, | ||||
|                   ), | ||||
|                 ], | ||||
|               ); | ||||
|             }, | ||||
|           ), | ||||
|         ), | ||||
|       ), | ||||
|     ); | ||||
|   } | ||||
| 
 | ||||
|   Color getLabOrderStatusColor(num status) { | ||||
|     switch (status) { | ||||
|       case 44: | ||||
|         return AppColors.warningColorYellow; | ||||
|       case 45: | ||||
|         return AppColors.warningColorYellow; | ||||
|       case 16: | ||||
|         return AppColors.successColor; | ||||
|       case 17: | ||||
|         return AppColors.successColor; | ||||
|       default: | ||||
|         return AppColors.greyColor; | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   String getLabOrderStatusText(num status) { | ||||
|     switch (status) { | ||||
|       case 44: | ||||
|         return LocaleKeys.resultsPending.tr(context: context); | ||||
|       case 45: | ||||
|         return LocaleKeys.resultsPending.tr(context: context); | ||||
|       case 16: | ||||
|         return LocaleKeys.resultsAvailable.tr(context: context); | ||||
|       case 17: | ||||
|         return LocaleKeys.resultsAvailable.tr(context: context); | ||||
|       default: | ||||
|         return ""; | ||||
|     } | ||||
|   } | ||||
| } | ||||
					Loading…
					
					
				
		Reference in New Issue