Merge branch 'medical_report' into 'master'
Medical report See merge request Cloud_Solution/diplomatic-quarter!28merge-update-with-lab-changes
commit
a826fcb0fe
@ -1 +1,2 @@
|
|||||||
enum FilterType { Clinic, Hospital }
|
enum FilterType { Clinic, Hospital }
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1 @@
|
|||||||
|
enum ReportFilterType { Requested, Ready,Completed,Cancelled }
|
||||||
@ -0,0 +1,139 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
|
||||||
|
class Reports {
|
||||||
|
int status;
|
||||||
|
DateTime encounterDate;
|
||||||
|
int projectID;
|
||||||
|
int invoiceNo;
|
||||||
|
int encounterNo;
|
||||||
|
String procedureId;
|
||||||
|
int requestType;
|
||||||
|
String setupId;
|
||||||
|
int patientID;
|
||||||
|
int doctorID;
|
||||||
|
Null clinicID;
|
||||||
|
DateTime requestDate;
|
||||||
|
bool isRead;
|
||||||
|
DateTime isReadOn;
|
||||||
|
int actualDoctorRate;
|
||||||
|
String clinicDescription;
|
||||||
|
Null clinicDescriptionN;
|
||||||
|
String docName;
|
||||||
|
Null docNameN;
|
||||||
|
String doctorImageURL;
|
||||||
|
Null doctorName;
|
||||||
|
Null doctorNameN;
|
||||||
|
int doctorRate;
|
||||||
|
bool isDoctorAllowVedioCall;
|
||||||
|
bool isExecludeDoctor;
|
||||||
|
int noOfPatientsRate;
|
||||||
|
String projectName;
|
||||||
|
Null projectNameN;
|
||||||
|
|
||||||
|
Reports(
|
||||||
|
{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.clinicDescription,
|
||||||
|
this.clinicDescriptionN,
|
||||||
|
this.docName,
|
||||||
|
this.docNameN,
|
||||||
|
this.doctorImageURL,
|
||||||
|
this.doctorName,
|
||||||
|
this.doctorNameN,
|
||||||
|
this.doctorRate,
|
||||||
|
this.isDoctorAllowVedioCall,
|
||||||
|
this.isExecludeDoctor,
|
||||||
|
this.noOfPatientsRate,
|
||||||
|
this.projectName,
|
||||||
|
this.projectNameN});
|
||||||
|
|
||||||
|
Reports.fromJson(Map<String, dynamic> json) {
|
||||||
|
status = json['Status'];
|
||||||
|
encounterDate = DateUtil.convertStringToDate(
|
||||||
|
json['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 = DateUtil.convertStringToDate(
|
||||||
|
json['RequestDate']); //json['RequestDate'];
|
||||||
|
isRead = json['IsRead'];
|
||||||
|
isReadOn =
|
||||||
|
DateUtil.convertStringToDate(json['IsReadOn']); //json['IsReadOn'];
|
||||||
|
actualDoctorRate = json['ActualDoctorRate'];
|
||||||
|
clinicDescription = json['ClinicDescription'];
|
||||||
|
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||||
|
docName = json['DocName'];
|
||||||
|
docNameN = json['DocNameN'];
|
||||||
|
doctorImageURL = json['DoctorImageURL'];
|
||||||
|
doctorName = json['DoctorName'];
|
||||||
|
doctorNameN = json['DoctorNameN'];
|
||||||
|
doctorRate = json['DoctorRate'];
|
||||||
|
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||||
|
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||||
|
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||||
|
projectName = json['ProjectName'];
|
||||||
|
projectNameN = json['ProjectNameN'];
|
||||||
|
}
|
||||||
|
|
||||||
|
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['ClinicDescription'] = this.clinicDescription;
|
||||||
|
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||||
|
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['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||||
|
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||||
|
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||||
|
data['ProjectName'] = this.projectName;
|
||||||
|
data['ProjectNameN'] = this.projectNameN;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ReportsList {
|
||||||
|
String filterName = "";
|
||||||
|
|
||||||
|
List<Reports> reportsList = List();
|
||||||
|
|
||||||
|
ReportsList({this.filterName, Reports reports}) {
|
||||||
|
reportsList.add(reports);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
class RequestReportHistory {
|
||||||
|
int projectID;
|
||||||
|
int clinicID;
|
||||||
|
bool isForMedicalReport;
|
||||||
|
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;
|
||||||
|
|
||||||
|
RequestReportHistory(
|
||||||
|
{this.projectID,
|
||||||
|
this.clinicID,
|
||||||
|
this.isForMedicalReport,
|
||||||
|
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});
|
||||||
|
|
||||||
|
RequestReportHistory.fromJson(Map<String, dynamic> json) {
|
||||||
|
projectID = json['ProjectID'];
|
||||||
|
clinicID = json['ClinicID'];
|
||||||
|
isForMedicalReport = json['IsForMedicalReport'];
|
||||||
|
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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['ProjectID'] = this.projectID;
|
||||||
|
data['ClinicID'] = this.clinicID;
|
||||||
|
data['IsForMedicalReport'] = this.isForMedicalReport;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
class RequestReports {
|
||||||
|
bool isReport;
|
||||||
|
int encounterType;
|
||||||
|
int requestType;
|
||||||
|
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;
|
||||||
|
|
||||||
|
RequestReports(
|
||||||
|
{this.isReport,
|
||||||
|
this.encounterType,
|
||||||
|
this.requestType,
|
||||||
|
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});
|
||||||
|
|
||||||
|
RequestReports.fromJson(Map<String, dynamic> json) {
|
||||||
|
isReport = json['IsReport'];
|
||||||
|
encounterType = json['EncounterType'];
|
||||||
|
requestType = json['RequestType'];
|
||||||
|
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<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['IsReport'] = this.isReport;
|
||||||
|
data['EncounterType'] = this.encounterType;
|
||||||
|
data['RequestType'] = this.requestType;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/reports/request_reports.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
|
||||||
|
|
||||||
|
class ReportsService extends BaseService {
|
||||||
|
List<Reports> reportsList = List();
|
||||||
|
List<AppointmentHistory> appointHistoryList = List();
|
||||||
|
|
||||||
|
RequestReports _requestReports = RequestReports(
|
||||||
|
isReport: true,
|
||||||
|
encounterType: 1,
|
||||||
|
requestType: 1,
|
||||||
|
versionID: 5.5,
|
||||||
|
channel: 3,
|
||||||
|
languageID: 2,
|
||||||
|
iPAdress: "10.20.10.20",
|
||||||
|
generalid: 'Cs2020@2016\$2958',
|
||||||
|
patientOutSA: 0,
|
||||||
|
sessionID: 'KIbLoqkytuKJEWECHQ',
|
||||||
|
isDentalAllowedBackend: false,
|
||||||
|
deviceTypeID: 2,
|
||||||
|
patientID: 1231755,
|
||||||
|
tokenID: '@dm!n',
|
||||||
|
patientTypeID: 1,
|
||||||
|
patientType: 1);
|
||||||
|
|
||||||
|
Future getReports() async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(REPORTS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
reportsList.clear();
|
||||||
|
response['GetPatientMedicalStatus'].forEach((reports) {
|
||||||
|
reportsList.add(Reports.fromJson(reports));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: _requestReports.toJson());
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getPatentAppointmentHistory() async {
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> body = new Map<String, dynamic>();
|
||||||
|
body['IsForMedicalReport'] = true;
|
||||||
|
await baseAppClient.post(GET_PATIENT_AppointmentHistory,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
appointHistoryList = [];
|
||||||
|
response['AppoimentAllHistoryResultList'].forEach((appoint) {
|
||||||
|
appointHistoryList.add(AppointmentHistory.fromJson(appoint));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future insertRequestForMedicalReport(
|
||||||
|
AppointmentHistory appointmentHistory) async {
|
||||||
|
Map<String, dynamic> body = new Map<String, dynamic>();
|
||||||
|
body['ClinicID'] = appointmentHistory.clinicID;
|
||||||
|
body['DoctorID'] = appointmentHistory.doctorID;
|
||||||
|
body['SetupID'] = appointmentHistory.setupID;
|
||||||
|
body['EncounterNo'] = appointmentHistory.appointmentNo;
|
||||||
|
body['EncounterType'] = 1;// appointmentHistory.appointmentType;
|
||||||
|
body['IsActive'] = appointmentHistory.isActiveDoctor;
|
||||||
|
body['ProjectID'] = appointmentHistory.projectID;
|
||||||
|
body['Remarks'] = "";
|
||||||
|
body['ProcedureId'] = "";
|
||||||
|
body['RequestType'] = 1;
|
||||||
|
body['Source'] = 2;
|
||||||
|
body['Status'] = 1;
|
||||||
|
body['CreatedBy'] = 102;
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.post(INSERT_REQUEST_FOR_MEDICAL_REPORT,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: body);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,84 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
|
||||||
|
import '../../../core/enum/reportfilter_type.dart';
|
||||||
|
import '../../../core/enum/viewstate.dart';
|
||||||
|
import '../../../core/model/reports/Reports.dart';
|
||||||
|
import '../../../core/service/medical/reports_service.dart';
|
||||||
|
import '../../../locator.dart';
|
||||||
|
import '../base_view_model.dart';
|
||||||
|
|
||||||
|
class ReportsViewModel extends BaseViewModel {
|
||||||
|
ReportFilterType filterType = ReportFilterType.Requested;
|
||||||
|
|
||||||
|
ReportsService _reportsService = locator<ReportsService>();
|
||||||
|
|
||||||
|
List<Reports> reportsOrderRequestList = List();
|
||||||
|
List<Reports> reportsOrderReadyList = List();
|
||||||
|
List<Reports> reportsOrderCompletedList = List();
|
||||||
|
List<Reports> reportsOrderCanceledList = List();
|
||||||
|
|
||||||
|
List<AppointmentHistory> get appointHistoryList =>
|
||||||
|
_reportsService.appointHistoryList;
|
||||||
|
|
||||||
|
getReports() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
reportsOrderRequestList.clear();
|
||||||
|
reportsOrderReadyList.clear();
|
||||||
|
reportsOrderCompletedList.clear();
|
||||||
|
reportsOrderCanceledList.clear();
|
||||||
|
await _reportsService.getReports();
|
||||||
|
if (_reportsService.hasError) {
|
||||||
|
error = _reportsService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
_filterList();
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getPatentAppointmentHistory() async {
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _reportsService.getPatentAppointmentHistory();
|
||||||
|
if (_reportsService.hasError) {
|
||||||
|
error = _reportsService.error;
|
||||||
|
setState(ViewState.Error);
|
||||||
|
} else {
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void _filterList() {
|
||||||
|
_reportsService.reportsList.forEach((report) {
|
||||||
|
switch (report.status) {
|
||||||
|
case 1:
|
||||||
|
reportsOrderRequestList.add(report);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
reportsOrderReadyList.add(report);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
reportsOrderCompletedList.add(report);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
reportsOrderCanceledList.add(report);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
insertRequestForMedicalReport(AppointmentHistory appointmentHistory)async{
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _reportsService.insertRequestForMedicalReport(appointmentHistory);
|
||||||
|
if (_reportsService.hasError) {
|
||||||
|
error = _reportsService.error;
|
||||||
|
AppToast.showErrorToast(message: error);
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else {
|
||||||
|
AppToast.showSuccessToast(message: 'The order was send ');
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,163 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class HomeReportPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_HomeReportPageState createState() => _HomeReportPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HomeReportPageState extends State<HomeReportPage>
|
||||||
|
with SingleTickerProviderStateMixin {
|
||||||
|
TabController _tabController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController = TabController(length: 4, vsync: this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
super.dispose();
|
||||||
|
_tabController.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<ReportsViewModel>(
|
||||||
|
onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBarTitle: 'Request',
|
||||||
|
baseViewModel: model,
|
||||||
|
//bottomSheet: Container(),
|
||||||
|
|
||||||
|
body: Scaffold(
|
||||||
|
extendBodyBehindAppBar: true,
|
||||||
|
appBar: PreferredSize(
|
||||||
|
preferredSize: Size.fromHeight(65.0),
|
||||||
|
child: Stack(
|
||||||
|
children: <Widget>[
|
||||||
|
Positioned(
|
||||||
|
bottom: 1,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
child: BackdropFilter(
|
||||||
|
filter: ImageFilter.blur(sigmaX: 10, sigmaY: 10),
|
||||||
|
child: Container(
|
||||||
|
color: Theme.of(context)
|
||||||
|
.scaffoldBackgroundColor
|
||||||
|
.withOpacity(0.8),
|
||||||
|
height: 70.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Container(
|
||||||
|
height: 60.0,
|
||||||
|
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.7),
|
||||||
|
),
|
||||||
|
color: Colors.white),
|
||||||
|
child: Center(
|
||||||
|
child: TabBar(
|
||||||
|
isScrollable: true,
|
||||||
|
controller: _tabController,
|
||||||
|
indicatorWeight: 5.0,
|
||||||
|
indicatorSize: TabBarIndicatorSize.label,
|
||||||
|
indicatorColor: Colors.red[800],
|
||||||
|
labelColor: Theme.of(context).primaryColor,
|
||||||
|
unselectedLabelColor: Colors.grey[800],
|
||||||
|
tabs: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.22,
|
||||||
|
child: Center(
|
||||||
|
child: Texts('Requested'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.22,
|
||||||
|
child: Center(
|
||||||
|
child: Texts('Ready'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.22,
|
||||||
|
child: Center(
|
||||||
|
child: Texts('Completed'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.22,
|
||||||
|
child: Center(
|
||||||
|
child: Texts('Cancelled'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
physics: BouncingScrollPhysics(),
|
||||||
|
controller: _tabController,
|
||||||
|
children: <Widget>[
|
||||||
|
ReportListWidget(
|
||||||
|
reportList: model.reportsOrderRequestList,
|
||||||
|
),
|
||||||
|
ReportListWidget(
|
||||||
|
reportList: model.reportsOrderReadyList,
|
||||||
|
),
|
||||||
|
ReportListWidget(
|
||||||
|
reportList: model.reportsOrderCompletedList,
|
||||||
|
),
|
||||||
|
ReportListWidget(
|
||||||
|
reportList: model.reportsOrderCanceledList,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 110,)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
bottomSheet: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 90,
|
||||||
|
margin: EdgeInsets.all(8.0),
|
||||||
|
child: Button(
|
||||||
|
label: 'Resend order & deliver',
|
||||||
|
backgroundColor: Colors.grey[800],
|
||||||
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: MedicalReports(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/model/reports/Reports.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class ReportListWidget extends StatelessWidget {
|
||||||
|
final List<Reports> reportList;
|
||||||
|
|
||||||
|
ReportListWidget({@required this.reportList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemBuilder: (context, index) => Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,margin: EdgeInsets.only(left: 8,right: 8,top: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(color: Colors.white, width: 2),
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8.0),
|
||||||
|
)),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: LargeAvatar(
|
||||||
|
name: reportList[index].doctorName,
|
||||||
|
url: reportList[index].doctorImageURL,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(height: 12,),
|
||||||
|
Texts(reportList[index].projectName),
|
||||||
|
Texts(reportList[index].clinicDescription),
|
||||||
|
Texts('invoice No: ${reportList[index].invoiceNo}'),
|
||||||
|
SizedBox(height: 12,),
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
itemCount: reportList.length,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,208 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class MedicalReports extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
void confirmBox(
|
||||||
|
AppointmentHistory model, ReportsViewModel reportsViewModel) {
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
child: ConfirmDialog(
|
||||||
|
appointmentHistory: model,
|
||||||
|
onOkSelected: (model) => reportsViewModel.insertRequestForMedicalReport(model),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return BaseView<ReportsViewModel>(
|
||||||
|
onModelReady: (model) => model.getPatentAppointmentHistory(),
|
||||||
|
builder: (_, model, widget) => AppScaffold(
|
||||||
|
baseViewModel: model,
|
||||||
|
isShowAppBar: true,
|
||||||
|
appBarTitle: 'Medical Reports',
|
||||||
|
body: ListView.builder(
|
||||||
|
itemCount: model.appointHistoryList.length,
|
||||||
|
itemBuilder: (context, index) => Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
margin: EdgeInsets.only(left: 8, right: 8, top: 3),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
border: Border.all(color: Colors.white, width: 2),
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8.0),
|
||||||
|
)),
|
||||||
|
child: Row(
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(left: 5, right: 5),
|
||||||
|
child: LargeAvatar(
|
||||||
|
width: 50,
|
||||||
|
height: 50,
|
||||||
|
name: model.appointHistoryList[index].doctorNameObj,
|
||||||
|
url: model.appointHistoryList[index].doctorImageURL,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 4,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Texts(model.appointHistoryList[index].projectName),
|
||||||
|
Texts(model.appointHistoryList[index].clinicName),
|
||||||
|
Texts(DateUtil.getMonthDayYearDateFormatted(
|
||||||
|
model.appointHistoryList[index].appointmentDate)),
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.appointHistoryList[index].actualDoctorRate
|
||||||
|
.toDouble(),
|
||||||
|
forceStars: true),
|
||||||
|
SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () =>
|
||||||
|
confirmBox(model.appointHistoryList[index], model),
|
||||||
|
child: Container(
|
||||||
|
width: 80,
|
||||||
|
height: 50,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.black54,
|
||||||
|
border:
|
||||||
|
Border.all(color: Colors.transparent, width: 2),
|
||||||
|
shape: BoxShape.rectangle,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(8.0),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'Request',
|
||||||
|
fontSize: 12,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 12,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConfirmDialog extends StatefulWidget {
|
||||||
|
final Function(AppointmentHistory) onOkSelected;
|
||||||
|
final AppointmentHistory appointmentHistory;
|
||||||
|
|
||||||
|
ConfirmDialog({this.onOkSelected, this.appointmentHistory});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_ConfirmDialogState createState() => _ConfirmDialogState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ConfirmDialogState extends State<ConfirmDialog> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return SimpleDialog(
|
||||||
|
title: Text('Confirm'),
|
||||||
|
children: <Widget>[
|
||||||
|
Container(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
Texts('Request a medical report'),
|
||||||
|
SizedBox(
|
||||||
|
height: 5.0,
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
height: 2.5,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 5,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: <Widget>[
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => Navigator.pop(context),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'cancel',
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 1,
|
||||||
|
height: 30,
|
||||||
|
color: Colors.grey[500],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
widget.onOkSelected(widget.appointmentHistory);
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'ok',
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue