medical report implementation contd.
parent
de717edfe8
commit
14725616c6
@ -0,0 +1,192 @@
|
|||||||
|
class PatientMedicalReportResponseModel {
|
||||||
|
int? status;
|
||||||
|
String? encounterDate;
|
||||||
|
int? projectID;
|
||||||
|
int? invoiceNo;
|
||||||
|
int? encounterNo;
|
||||||
|
String? procedureId;
|
||||||
|
int? requestType;
|
||||||
|
String? setupId;
|
||||||
|
int? patientID;
|
||||||
|
int? doctorID;
|
||||||
|
int? clinicID;
|
||||||
|
String? requestDate;
|
||||||
|
bool? isRead;
|
||||||
|
dynamic isReadOn;
|
||||||
|
num? actualDoctorRate;
|
||||||
|
String? admissionDate;
|
||||||
|
int? admissionNumber;
|
||||||
|
String? appointmentDate;
|
||||||
|
int? appointmentNO;
|
||||||
|
String? appointmentTime;
|
||||||
|
String? clinicDescription;
|
||||||
|
dynamic clinicDescriptionN;
|
||||||
|
num? decimalDoctorRate;
|
||||||
|
String? docName;
|
||||||
|
dynamic docNameN;
|
||||||
|
String? doctorImageURL;
|
||||||
|
String? doctorName;
|
||||||
|
dynamic doctorNameN;
|
||||||
|
num? doctorRate;
|
||||||
|
num? doctorStarsRate;
|
||||||
|
int? invoiceNoVP;
|
||||||
|
dynamic invoiceType;
|
||||||
|
bool? isDoctorAllowVedioCall;
|
||||||
|
bool? isExecludeDoctor;
|
||||||
|
bool? isInOutPatient;
|
||||||
|
String? isInOutPatientDescription;
|
||||||
|
String? isInOutPatientDescriptionN;
|
||||||
|
int? noOfPatientsRate;
|
||||||
|
String? projectName;
|
||||||
|
dynamic projectNameN;
|
||||||
|
int? sourceID;
|
||||||
|
dynamic sourceName;
|
||||||
|
dynamic sourceNameN;
|
||||||
|
String? statusDesc;
|
||||||
|
dynamic strAppointmentDate;
|
||||||
|
|
||||||
|
PatientMedicalReportResponseModel(
|
||||||
|
{this.status,
|
||||||
|
this.encounterDate,
|
||||||
|
this.projectID,
|
||||||
|
this.invoiceNo,
|
||||||
|
this.encounterNo,
|
||||||
|
this.procedureId,
|
||||||
|
this.requestType,
|
||||||
|
this.setupId,
|
||||||
|
this.patientID,
|
||||||
|
this.doctorID,
|
||||||
|
this.clinicID,
|
||||||
|
this.requestDate,
|
||||||
|
this.isRead,
|
||||||
|
this.isReadOn,
|
||||||
|
this.actualDoctorRate,
|
||||||
|
this.admissionDate,
|
||||||
|
this.admissionNumber,
|
||||||
|
this.appointmentDate,
|
||||||
|
this.appointmentNO,
|
||||||
|
this.appointmentTime,
|
||||||
|
this.clinicDescription,
|
||||||
|
this.clinicDescriptionN,
|
||||||
|
this.decimalDoctorRate,
|
||||||
|
this.docName,
|
||||||
|
this.docNameN,
|
||||||
|
this.doctorImageURL,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.doctorRate,
|
||||||
|
this.doctorStarsRate,
|
||||||
|
this.invoiceNoVP,
|
||||||
|
this.invoiceType,
|
||||||
|
this.isDoctorAllowVedioCall,
|
||||||
|
this.isExecludeDoctor,
|
||||||
|
this.isInOutPatient,
|
||||||
|
this.isInOutPatientDescription,
|
||||||
|
this.isInOutPatientDescriptionN,
|
||||||
|
this.noOfPatientsRate,
|
||||||
|
this.projectName,
|
||||||
|
this.projectNameN,
|
||||||
|
this.sourceID,
|
||||||
|
this.sourceName,
|
||||||
|
this.sourceNameN,
|
||||||
|
this.statusDesc,
|
||||||
|
this.strAppointmentDate});
|
||||||
|
|
||||||
|
PatientMedicalReportResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
status = json['Status'];
|
||||||
|
encounterDate = json['EncounterDate'];
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
invoiceNo = json['InvoiceNo'];
|
||||||
|
encounterNo = json['EncounterNo'];
|
||||||
|
procedureId = json['ProcedureId'];
|
||||||
|
requestType = json['RequestType'];
|
||||||
|
setupId = json['SetupId'];
|
||||||
|
patientID = json['PatientID'];
|
||||||
|
doctorID = json['DoctorID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
requestDate = json['RequestDate'];
|
||||||
|
isRead = json['IsRead'];
|
||||||
|
isReadOn = json['IsReadOn'];
|
||||||
|
actualDoctorRate = json['ActualDoctorRate'];
|
||||||
|
admissionDate = json['AdmissionDate'];
|
||||||
|
admissionNumber = json['AdmissionNumber'];
|
||||||
|
appointmentDate = json['AppointmentDate'];
|
||||||
|
appointmentNO = json['AppointmentNO'];
|
||||||
|
appointmentTime = json['AppointmentTime'];
|
||||||
|
clinicDescription = json['ClinicDescription'];
|
||||||
|
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||||
|
decimalDoctorRate = json['DecimalDoctorRate'];
|
||||||
|
docName = json['DocName'];
|
||||||
|
docNameN = json['DocNameN'];
|
||||||
|
doctorImageURL = json['DoctorImageURL'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
doctorRate = json['DoctorRate'];
|
||||||
|
doctorStarsRate = json['DoctorStarsRate'];
|
||||||
|
invoiceNoVP = json['InvoiceNo_VP'];
|
||||||
|
invoiceType = json['InvoiceType'];
|
||||||
|
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||||
|
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||||
|
isInOutPatient = json['IsInOutPatient'];
|
||||||
|
isInOutPatientDescription = json['IsInOutPatientDescription'];
|
||||||
|
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
|
||||||
|
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
projectNameN = json['ProjectNameN'];
|
||||||
|
sourceID = json['SourceID'];
|
||||||
|
sourceName = json['SourceName'];
|
||||||
|
sourceNameN = json['SourceNameN'];
|
||||||
|
statusDesc = json['StatusDesc'];
|
||||||
|
strAppointmentDate = json['StrAppointmentDate'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['Status'] = this.status;
|
||||||
|
data['EncounterDate'] = this.encounterDate;
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['InvoiceNo'] = this.invoiceNo;
|
||||||
|
data['EncounterNo'] = this.encounterNo;
|
||||||
|
data['ProcedureId'] = this.procedureId;
|
||||||
|
data['RequestType'] = this.requestType;
|
||||||
|
data['SetupId'] = this.setupId;
|
||||||
|
data['PatientID'] = this.patientID;
|
||||||
|
data['DoctorID'] = this.doctorID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['RequestDate'] = this.requestDate;
|
||||||
|
data['IsRead'] = this.isRead;
|
||||||
|
data['IsReadOn'] = this.isReadOn;
|
||||||
|
data['ActualDoctorRate'] = this.actualDoctorRate;
|
||||||
|
data['AdmissionDate'] = this.admissionDate;
|
||||||
|
data['AdmissionNumber'] = this.admissionNumber;
|
||||||
|
data['AppointmentDate'] = this.appointmentDate;
|
||||||
|
data['AppointmentNO'] = this.appointmentNO;
|
||||||
|
data['AppointmentTime'] = this.appointmentTime;
|
||||||
|
data['ClinicDescription'] = this.clinicDescription;
|
||||||
|
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||||
|
data['DecimalDoctorRate'] = this.decimalDoctorRate;
|
||||||
|
data['DocName'] = this.docName;
|
||||||
|
data['DocNameN'] = this.docNameN;
|
||||||
|
data['DoctorImageURL'] = this.doctorImageURL;
|
||||||
|
data['DoctorName'] = this.doctorName;
|
||||||
|
data['DoctorNameN'] = this.doctorNameN;
|
||||||
|
data['DoctorRate'] = this.doctorRate;
|
||||||
|
data['DoctorStarsRate'] = this.doctorStarsRate;
|
||||||
|
data['InvoiceNo_VP'] = this.invoiceNoVP;
|
||||||
|
data['InvoiceType'] = this.invoiceType;
|
||||||
|
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||||
|
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||||
|
data['IsInOutPatient'] = this.isInOutPatient;
|
||||||
|
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
|
||||||
|
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
|
||||||
|
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['ProjectNameN'] = this.projectNameN;
|
||||||
|
data['SourceID'] = this.sourceID;
|
||||||
|
data['SourceName'] = this.sourceName;
|
||||||
|
data['SourceNameN'] = this.sourceNameN;
|
||||||
|
data['StatusDesc'] = this.statusDesc;
|
||||||
|
data['StrAppointmentDate'] = this.strAppointmentDate;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,91 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_staggered_animations/flutter_staggered_animations.dart';
|
||||||
|
import 'package:hmg_patient_app_new/core/utils/size_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/features/medical_file/medical_file_view_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/lab/collapsing_list_view.dart';
|
||||||
|
import 'package:hmg_patient_app_new/presentation/medical_file/widgets/patient_medical_report_card.dart';
|
||||||
|
import 'package:hmg_patient_app_new/theme/colors.dart';
|
||||||
|
import 'package:hmg_patient_app_new/widgets/custom_tab_bar.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class MedicalReportsPage extends StatefulWidget {
|
||||||
|
const MedicalReportsPage({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MedicalReportsPage> createState() => _MedicalReportsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MedicalReportsPageState extends State<MedicalReportsPage> {
|
||||||
|
late MedicalFileViewModel medicalFileViewModel;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
medicalFileViewModel = Provider.of<MedicalFileViewModel>(context, listen: false);
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.bgScaffoldColor,
|
||||||
|
body: CollapsingListView(
|
||||||
|
title: "Medical Reports".needTranslation,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
CustomTabBar(
|
||||||
|
activeTextColor: Color(0xffED1C2B),
|
||||||
|
activeBackgroundColor: Color(0xffED1C2B).withValues(alpha: .1),
|
||||||
|
tabs: [
|
||||||
|
CustomTabBarModel(null, "Requested".needTranslation),
|
||||||
|
CustomTabBarModel(null, "Ready".needTranslation),
|
||||||
|
CustomTabBarModel(null, "Cancelled".needTranslation),
|
||||||
|
],
|
||||||
|
onTabChange: (index) {
|
||||||
|
medicalFileViewModel.onMedicalReportTabChange(index);
|
||||||
|
},
|
||||||
|
).paddingSymmetrical(24.h, 0.h),
|
||||||
|
Consumer<MedicalFileViewModel>(builder: (context, medicalFileVM, child) {
|
||||||
|
return ListView.separated(
|
||||||
|
padding: EdgeInsets.only(top: 24.h),
|
||||||
|
shrinkWrap: true,
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
itemCount: medicalFileViewModel.isPatientMedicalReportsListLoading ? 3 : medicalFileViewModel.patientMedicalReportList.length,
|
||||||
|
// medicalFileViewModel.patientMedicalReportList.isNotEmpty
|
||||||
|
// ? medicalFileViewModel.patientMedicalReportList.length
|
||||||
|
// : 1,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return medicalFileViewModel.isPatientMedicalReportsListLoading
|
||||||
|
? PatientMedicalReportCard(
|
||||||
|
patientMedicalReportResponseModel: PatientMedicalReportResponseModel(),
|
||||||
|
isLoading: true,
|
||||||
|
).paddingSymmetrical(24.h, 0.h)
|
||||||
|
: 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,
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(color: AppColors.whiteColor, borderRadius: 24.h, hasShadow: true),
|
||||||
|
child: PatientMedicalReportCard(
|
||||||
|
patientMedicalReportResponseModel: medicalFileVM.patientMedicalReportList[index],
|
||||||
|
isLoading: false,
|
||||||
|
),
|
||||||
|
).paddingSymmetrical(24.h, 0.h),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
separatorBuilder: (BuildContext cxt, int index) => SizedBox(height: 16.h),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
SizedBox(height: 24.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,120 @@
|
|||||||
|
import 'package:easy_localization/easy_localization.dart';
|
||||||
|
import 'package:flutter/cupertino.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/extensions/string_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/extensions/widget_extensions.dart';
|
||||||
|
import 'package:hmg_patient_app_new/features/medical_file/models/patient_medical_response_model.dart';
|
||||||
|
import 'package:hmg_patient_app_new/generated/locale_keys.g.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/chip/app_custom_chip_widget.dart';
|
||||||
|
|
||||||
|
class PatientMedicalReportCard extends StatelessWidget {
|
||||||
|
PatientMedicalReportCard({super.key, required this.patientMedicalReportResponseModel, this.isLoading = false});
|
||||||
|
|
||||||
|
PatientMedicalReportResponseModel patientMedicalReportResponseModel;
|
||||||
|
|
||||||
|
bool isLoading = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
decoration: RoundedRectangleBorder().toSmoothCornerDecoration(
|
||||||
|
color: AppColors.whiteColor,
|
||||||
|
borderRadius: 20.h,
|
||||||
|
hasShadow: true,
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(16.h),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Image.network(
|
||||||
|
isLoading ? "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png" : patientMedicalReportResponseModel.doctorImageURL!,
|
||||||
|
width: 63.h,
|
||||||
|
height: 63.h,
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
).circle(100).toShimmer2(isShow: isLoading),
|
||||||
|
SizedBox(width: 16.h),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
(isLoading ? "" : patientMedicalReportResponseModel.doctorName!).toText16(isBold: true).toShimmer2(isShow: isLoading),
|
||||||
|
SizedBox(height: 4.h),
|
||||||
|
Wrap(
|
||||||
|
direction: Axis.horizontal,
|
||||||
|
spacing: 3.h,
|
||||||
|
runSpacing: 4.h,
|
||||||
|
children: [
|
||||||
|
AppCustomChipWidget(labelText: isLoading ? "" : patientMedicalReportResponseModel.clinicDescription!).toShimmer2(isShow: isLoading),
|
||||||
|
AppCustomChipWidget(labelText: isLoading ? "" : patientMedicalReportResponseModel.projectName!).toShimmer2(isShow: isLoading),
|
||||||
|
AppCustomChipWidget(
|
||||||
|
icon: AppAssets.doctor_calendar_icon,
|
||||||
|
labelText: isLoading
|
||||||
|
? ""
|
||||||
|
: "${DateUtil.formatDateToDate(DateUtil.convertStringToDate(patientMedicalReportResponseModel.requestDate), false)}, ${DateUtil.formatDateToTimeLang(DateUtil.convertStringToDate(patientMedicalReportResponseModel.requestDate), false)}")
|
||||||
|
.toShimmer2(isShow: isLoading),
|
||||||
|
AppCustomChipWidget(
|
||||||
|
icon: AppAssets.rating_icon, iconColor: AppColors.ratingColorYellow, labelText: isLoading ? "" : "Rating: ${patientMedicalReportResponseModel.decimalDoctorRate}")
|
||||||
|
.toShimmer2(isShow: isLoading),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
patientMedicalReportResponseModel.status == 2
|
||||||
|
? Padding(
|
||||||
|
padding: EdgeInsets.only(top: 16.h),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: "Share",
|
||||||
|
onPressed: () {},
|
||||||
|
backgroundColor: AppColors.secondaryLightRedColor,
|
||||||
|
borderColor: AppColors.secondaryLightRedColor,
|
||||||
|
textColor: AppColors.primaryRedColor,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 12.h,
|
||||||
|
height: 40.h,
|
||||||
|
icon: AppAssets.download_1,
|
||||||
|
iconColor: AppColors.primaryRedColor,
|
||||||
|
iconSize: 16.h,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
),
|
||||||
|
SizedBox(width: 16.h),
|
||||||
|
Expanded(
|
||||||
|
child: CustomButton(
|
||||||
|
text: "Download",
|
||||||
|
onPressed: () {},
|
||||||
|
backgroundColor: AppColors.secondaryLightRedColor,
|
||||||
|
borderColor: AppColors.secondaryLightRedColor,
|
||||||
|
textColor: AppColors.primaryRedColor,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
borderRadius: 12.h,
|
||||||
|
height: 40.h,
|
||||||
|
icon: AppAssets.download_1,
|
||||||
|
iconColor: AppColors.primaryRedColor,
|
||||||
|
iconSize: 16.h,
|
||||||
|
).toShimmer2(isShow: isLoading),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: SizedBox.shrink()
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue