Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into create_episode_inpatient
Conflicts: lib/config/config.dartmerge-requests/816/head
commit
46698a4382
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,216 @@
|
||||
class AllSpecialLabResultModel {
|
||||
int actualDoctorRate;
|
||||
dynamic admissionDate;
|
||||
dynamic admissionNumber;
|
||||
dynamic appointmentDate;
|
||||
dynamic appointmentNo;
|
||||
dynamic appointmentTime;
|
||||
String clinicDescription;
|
||||
String clinicDescriptionEnglish;
|
||||
dynamic clinicDescriptionN;
|
||||
dynamic clinicID;
|
||||
dynamic createdOn;
|
||||
double decimalDoctorRate;
|
||||
dynamic doctorID;
|
||||
String doctorImageURL;
|
||||
String doctorName;
|
||||
String doctorNameEnglish;
|
||||
dynamic doctorNameN;
|
||||
dynamic doctorRate;
|
||||
dynamic doctorStarsRate;
|
||||
String doctorTitle;
|
||||
dynamic gender;
|
||||
String genderDescription;
|
||||
bool inOutPatient;
|
||||
String invoiceNo;
|
||||
bool isActiveDoctorProfile;
|
||||
bool isDoctorAllowVedioCall;
|
||||
bool isExecludeDoctor;
|
||||
bool isInOutPatient;
|
||||
dynamic isInOutPatientDescription;
|
||||
dynamic isInOutPatientDescriptionN;
|
||||
bool isLiveCareAppointment;
|
||||
bool isRead;
|
||||
bool isSendEmail;
|
||||
String moduleID;
|
||||
String nationalityFlagURL;
|
||||
dynamic noOfPatientsRate;
|
||||
dynamic orderDate;
|
||||
String orderNo;
|
||||
dynamic patientID;
|
||||
String projectID;
|
||||
String projectName;
|
||||
dynamic projectNameN;
|
||||
String qR;
|
||||
String resultData;
|
||||
String resultDataHTML;
|
||||
dynamic resultDataTxt;
|
||||
String setupID;
|
||||
//List<String> speciality;
|
||||
dynamic status;
|
||||
dynamic statusDesc;
|
||||
String strOrderDate;
|
||||
|
||||
AllSpecialLabResultModel(
|
||||
{this.actualDoctorRate,
|
||||
this.admissionDate,
|
||||
this.admissionNumber,
|
||||
this.appointmentDate,
|
||||
this.appointmentNo,
|
||||
this.appointmentTime,
|
||||
this.clinicDescription,
|
||||
this.clinicDescriptionEnglish,
|
||||
this.clinicDescriptionN,
|
||||
this.clinicID,
|
||||
this.createdOn,
|
||||
this.decimalDoctorRate,
|
||||
this.doctorID,
|
||||
this.doctorImageURL,
|
||||
this.doctorName,
|
||||
this.doctorNameEnglish,
|
||||
this.doctorNameN,
|
||||
this.doctorRate,
|
||||
this.doctorStarsRate,
|
||||
this.doctorTitle,
|
||||
this.gender,
|
||||
this.genderDescription,
|
||||
this.inOutPatient,
|
||||
this.invoiceNo,
|
||||
this.isActiveDoctorProfile,
|
||||
this.isDoctorAllowVedioCall,
|
||||
this.isExecludeDoctor,
|
||||
this.isInOutPatient,
|
||||
this.isInOutPatientDescription,
|
||||
this.isInOutPatientDescriptionN,
|
||||
this.isLiveCareAppointment,
|
||||
this.isRead,
|
||||
this.isSendEmail,
|
||||
this.moduleID,
|
||||
this.nationalityFlagURL,
|
||||
this.noOfPatientsRate,
|
||||
this.orderDate,
|
||||
this.orderNo,
|
||||
this.patientID,
|
||||
this.projectID,
|
||||
this.projectName,
|
||||
this.projectNameN,
|
||||
this.qR,
|
||||
this.resultData,
|
||||
this.resultDataHTML,
|
||||
this.resultDataTxt,
|
||||
this.setupID,
|
||||
//this.speciality,
|
||||
this.status,
|
||||
this.statusDesc,
|
||||
this.strOrderDate});
|
||||
|
||||
AllSpecialLabResultModel.fromJson(Map<String, dynamic> json) {
|
||||
actualDoctorRate = json['ActualDoctorRate'];
|
||||
admissionDate = json['AdmissionDate'];
|
||||
admissionNumber = json['AdmissionNumber'];
|
||||
appointmentDate = json['AppointmentDate'];
|
||||
appointmentNo = json['AppointmentNo'];
|
||||
appointmentTime = json['AppointmentTime'];
|
||||
clinicDescription = json['ClinicDescription'];
|
||||
clinicDescriptionEnglish = json['ClinicDescriptionEnglish'];
|
||||
clinicDescriptionN = json['ClinicDescriptionN'];
|
||||
clinicID = json['ClinicID'];
|
||||
createdOn = json['CreatedOn'];
|
||||
decimalDoctorRate = json['DecimalDoctorRate'];
|
||||
doctorID = json['DoctorID'];
|
||||
doctorImageURL = json['DoctorImageURL'];
|
||||
doctorName = json['DoctorName'];
|
||||
doctorNameEnglish = json['DoctorNameEnglish'];
|
||||
doctorNameN = json['DoctorNameN'];
|
||||
doctorRate = json['DoctorRate'];
|
||||
doctorStarsRate = json['DoctorStarsRate'];
|
||||
doctorTitle = json['DoctorTitle'];
|
||||
gender = json['Gender'];
|
||||
genderDescription = json['GenderDescription'];
|
||||
inOutPatient = json['InOutPatient'];
|
||||
invoiceNo = json['InvoiceNo'];
|
||||
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
|
||||
isDoctorAllowVedioCall = json['IsDoctorAllowVedioCall'];
|
||||
isExecludeDoctor = json['IsExecludeDoctor'];
|
||||
isInOutPatient = json['IsInOutPatient'];
|
||||
isInOutPatientDescription = json['IsInOutPatientDescription'];
|
||||
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
|
||||
isLiveCareAppointment = json['IsLiveCareAppointment'];
|
||||
isRead = json['IsRead'];
|
||||
isSendEmail = json['IsSendEmail'];
|
||||
moduleID = json['ModuleID'];
|
||||
nationalityFlagURL = json['NationalityFlagURL'];
|
||||
noOfPatientsRate = json['NoOfPatientsRate'];
|
||||
orderDate = json['OrderDate'];
|
||||
orderNo = json['OrderNo'];
|
||||
patientID = json['PatientID'];
|
||||
projectID = json['ProjectID'];
|
||||
projectName = json['ProjectName'];
|
||||
projectNameN = json['ProjectNameN'];
|
||||
qR = json['QR'];
|
||||
resultData = json['ResultData'];
|
||||
resultDataHTML = json['ResultDataHTML'];
|
||||
resultDataTxt = json['ResultDataTxt'];
|
||||
setupID = json['SetupID'];
|
||||
//speciality = json['Speciality'].cast<String>();
|
||||
status = json['Status'];
|
||||
statusDesc = json['StatusDesc'];
|
||||
strOrderDate = json['StrOrderDate'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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['ClinicDescriptionEnglish'] = this.clinicDescriptionEnglish;
|
||||
data['ClinicDescriptionN'] = this.clinicDescriptionN;
|
||||
data['ClinicID'] = this.clinicID;
|
||||
data['CreatedOn'] = this.createdOn;
|
||||
data['DecimalDoctorRate'] = this.decimalDoctorRate;
|
||||
data['DoctorID'] = this.doctorID;
|
||||
data['DoctorImageURL'] = this.doctorImageURL;
|
||||
data['DoctorName'] = this.doctorName;
|
||||
data['DoctorNameEnglish'] = this.doctorNameEnglish;
|
||||
data['DoctorNameN'] = this.doctorNameN;
|
||||
data['DoctorRate'] = this.doctorRate;
|
||||
data['DoctorStarsRate'] = this.doctorStarsRate;
|
||||
data['DoctorTitle'] = this.doctorTitle;
|
||||
data['Gender'] = this.gender;
|
||||
data['GenderDescription'] = this.genderDescription;
|
||||
data['InOutPatient'] = this.inOutPatient;
|
||||
data['InvoiceNo'] = this.invoiceNo;
|
||||
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
|
||||
data['IsDoctorAllowVedioCall'] = this.isDoctorAllowVedioCall;
|
||||
data['IsExecludeDoctor'] = this.isExecludeDoctor;
|
||||
data['IsInOutPatient'] = this.isInOutPatient;
|
||||
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
|
||||
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
|
||||
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
|
||||
data['IsRead'] = this.isRead;
|
||||
data['IsSendEmail'] = this.isSendEmail;
|
||||
data['ModuleID'] = this.moduleID;
|
||||
data['NationalityFlagURL'] = this.nationalityFlagURL;
|
||||
data['NoOfPatientsRate'] = this.noOfPatientsRate;
|
||||
data['OrderDate'] = this.orderDate;
|
||||
data['OrderNo'] = this.orderNo;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
data['ProjectName'] = this.projectName;
|
||||
data['ProjectNameN'] = this.projectNameN;
|
||||
data['QR'] = this.qR;
|
||||
data['ResultData'] = this.resultData;
|
||||
data['ResultDataHTML'] = this.resultDataHTML;
|
||||
data['ResultDataTxt'] = this.resultDataTxt;
|
||||
data['SetupID'] = this.setupID;
|
||||
//data['Speciality'] = this.speciality;
|
||||
data['Status'] = this.status;
|
||||
data['StatusDesc'] = this.statusDesc;
|
||||
data['StrOrderDate'] = this.strOrderDate;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
class AllSpecialLabResultRequestModel {
|
||||
double versionID;
|
||||
int channel;
|
||||
int languageID;
|
||||
String iPAdress;
|
||||
String generalid;
|
||||
int patientOutSA;
|
||||
String sessionID;
|
||||
bool isDentalAllowedBackend;
|
||||
int deviceTypeID;
|
||||
String tokenID;
|
||||
int patientTypeID;
|
||||
int patientType;
|
||||
int patientID;
|
||||
int projectID;
|
||||
|
||||
AllSpecialLabResultRequestModel(
|
||||
{this.versionID,
|
||||
this.channel,
|
||||
this.languageID,
|
||||
this.iPAdress,
|
||||
this.generalid,
|
||||
this.patientOutSA,
|
||||
this.sessionID,
|
||||
this.isDentalAllowedBackend,
|
||||
this.deviceTypeID,
|
||||
this.tokenID,
|
||||
this.patientTypeID,
|
||||
this.patientType,
|
||||
this.patientID,
|
||||
this.projectID});
|
||||
|
||||
AllSpecialLabResultRequestModel.fromJson(Map<String, dynamic> json) {
|
||||
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'];
|
||||
tokenID = json['TokenID'];
|
||||
patientTypeID = json['PatientTypeID'];
|
||||
patientType = json['PatientType'];
|
||||
patientID = json['PatientID'];
|
||||
projectID = json['ProjectID'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
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['TokenID'] = this.tokenID;
|
||||
data['PatientTypeID'] = this.patientTypeID;
|
||||
data['PatientType'] = this.patientType;
|
||||
data['PatientID'] = this.patientID;
|
||||
data['ProjectID'] = this.projectID;
|
||||
return data;
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class LabResultHistoryDetailsWidget extends StatefulWidget {
|
||||
final List<LabResultHistory> labResultHistory;
|
||||
|
||||
LabResultHistoryDetailsWidget({
|
||||
this.labResultHistory,
|
||||
});
|
||||
|
||||
@override
|
||||
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
|
||||
}
|
||||
|
||||
class _VitalSignDetailsWidgetState extends State<LabResultHistoryDetailsWidget> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return Container(
|
||||
/* decoration: BoxDecoration(
|
||||
color: Colors.transparent,
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
|
||||
border: Border.all(color: Colors.grey, width: 1),
|
||||
),*/
|
||||
margin: EdgeInsets.all(0),
|
||||
child: Container(
|
||||
color: Colors.transparent,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: AppText(
|
||||
TranslationBase.of(context).date,
|
||||
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
child: Container(
|
||||
child: AppText(
|
||||
TranslationBase.of(context).labResult,
|
||||
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
// height: 60
|
||||
),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
const Divider(
|
||||
height: 1,
|
||||
thickness: 1,
|
||||
color: Colors.black,
|
||||
),
|
||||
Table(
|
||||
border: TableBorder.symmetric(
|
||||
inside: BorderSide(width: 1.0, color: Colors.grey[300]),
|
||||
),
|
||||
children: fullData(projectViewModel),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
List<TableRow> fullData(ProjectViewModel projectViewModel) {
|
||||
List<TableRow> tableRow = [];
|
||||
widget.labResultHistory.forEach((vital) {
|
||||
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime);
|
||||
tableRow.add(TableRow(children: [
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
color: Colors.white,
|
||||
child: AppText(
|
||||
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
|
||||
fontSize: SizeConfig.textMultiplier * 1.8,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
color: Colors.white,
|
||||
child: AppText(
|
||||
'${vital.resultValue}',
|
||||
fontSize: SizeConfig.textMultiplier * 1.8,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
),
|
||||
),
|
||||
]));
|
||||
});
|
||||
return tableRow;
|
||||
}
|
||||
}
|
@ -0,0 +1,231 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/util/date-utils.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:fl_chart/fl_chart.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class LineChartCurvedLabHistory extends StatefulWidget {
|
||||
final String title;
|
||||
final List<LabResultHistory> labResultHistory;
|
||||
|
||||
LineChartCurvedLabHistory({this.title, this.labResultHistory});
|
||||
|
||||
@override
|
||||
State<StatefulWidget> createState() => LineChartCurvedLabHistoryState();
|
||||
}
|
||||
|
||||
class LineChartCurvedLabHistoryState extends State<LineChartCurvedLabHistory> {
|
||||
bool isShowingMainData;
|
||||
List<int> xAxixs = List();
|
||||
int indexes = 0;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
getXaxix();
|
||||
isShowingMainData = true;
|
||||
}
|
||||
|
||||
getXaxix() {
|
||||
indexes = widget.labResultHistory.length ~/ 3.5;
|
||||
for (int index = 0; index < widget.labResultHistory.length; index++) {
|
||||
int mIndex = indexes * index;
|
||||
if (mIndex < widget.labResultHistory.length) {
|
||||
xAxixs.add(mIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AspectRatio(
|
||||
aspectRatio: 1.23,
|
||||
child: Container(
|
||||
decoration: const BoxDecoration(
|
||||
borderRadius: BorderRadius.all(Radius.circular(18)),
|
||||
// color: Colors.white,
|
||||
),
|
||||
child: Stack(
|
||||
children: <Widget>[
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: <Widget>[
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
AppText(
|
||||
widget.title,
|
||||
fontSize: SizeConfig.textMultiplier * 2.1,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontFamily: 'Poppins',
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(right: 16.0, left: 8.0),
|
||||
child: LineChart(
|
||||
sampleData1(),
|
||||
swapAnimationDuration: const Duration(milliseconds: 250),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
LineChartData sampleData1() {
|
||||
return LineChartData(
|
||||
lineTouchData: LineTouchData(
|
||||
touchTooltipData: LineTouchTooltipData(
|
||||
tooltipBgColor: Colors.white,
|
||||
),
|
||||
touchCallback: (LineTouchResponse touchResponse) {},
|
||||
handleBuiltInTouches: true,
|
||||
),
|
||||
gridData: FlGridData(
|
||||
show: true, drawVerticalLine: true, drawHorizontalLine: true),
|
||||
titlesData: FlTitlesData(
|
||||
bottomTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTextStyles: (value) => const TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 11,
|
||||
),
|
||||
margin: 28,
|
||||
rotateAngle: -65,
|
||||
getTitles: (value) {
|
||||
print(value);
|
||||
DateTime date = AppDateUtils.convertStringToDate(
|
||||
widget.labResultHistory[value.toInt()].verifiedOnDateTime);
|
||||
if (widget.labResultHistory.length < 8) {
|
||||
if (widget.labResultHistory.length > value.toInt()) {
|
||||
return '${date.day}/ ${date.year}';
|
||||
} else
|
||||
return '';
|
||||
} else {
|
||||
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
|
||||
if (value.toInt() == widget.labResultHistory.length - 1)
|
||||
return '${date.day}/ ${date.year}';
|
||||
if (xAxixs.contains(value.toInt())) {
|
||||
return '${date.day}/ ${date.year}';
|
||||
}
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
),
|
||||
leftTitles: SideTitles(
|
||||
showTitles: true,
|
||||
getTextStyles: (value) => const TextStyle(
|
||||
color: Colors.black,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
),
|
||||
getTitles: (value) {
|
||||
return '${value.toInt()}';
|
||||
},
|
||||
margin: 8,
|
||||
//reservedSize: 30,
|
||||
),
|
||||
),
|
||||
borderData: FlBorderData(
|
||||
show: true,
|
||||
border: const Border(
|
||||
bottom: BorderSide(
|
||||
color: Colors.black,
|
||||
width: 0.5,
|
||||
),
|
||||
left: BorderSide(
|
||||
color: Colors.black,
|
||||
),
|
||||
right: BorderSide(
|
||||
color: Colors.black,
|
||||
),
|
||||
top: BorderSide(
|
||||
color: Colors.transparent,
|
||||
),
|
||||
),
|
||||
),
|
||||
minX: 0,
|
||||
maxX: (widget.labResultHistory.length - 1).toDouble(),
|
||||
maxY: getMaxY() + 2,
|
||||
minY: getMinY(),
|
||||
lineBarsData: getData(),
|
||||
);
|
||||
}
|
||||
|
||||
double getMaxY() {
|
||||
double max = 0;
|
||||
widget.labResultHistory.forEach((element) {
|
||||
try {
|
||||
double resultValueDouble = double.parse(element.resultValue);
|
||||
if (resultValueDouble > max) max = resultValueDouble;
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
});
|
||||
|
||||
return max.roundToDouble();
|
||||
}
|
||||
|
||||
double getMinY() {
|
||||
double min = 0;
|
||||
try {
|
||||
min = double.parse(widget.labResultHistory[0].resultValue);
|
||||
|
||||
widget.labResultHistory.forEach((element) {
|
||||
double resultValueDouble = double.parse(element.resultValue);
|
||||
if (resultValueDouble < min) min = resultValueDouble;
|
||||
});
|
||||
} catch (e) {
|
||||
print(e);
|
||||
}
|
||||
int value = min.toInt();
|
||||
|
||||
return value.toDouble();
|
||||
}
|
||||
|
||||
List<LineChartBarData> getData() {
|
||||
List<FlSpot> spots = List();
|
||||
for (int index = 0; index < widget.labResultHistory.length; index++) {
|
||||
try {
|
||||
var resultValueDouble =
|
||||
double.parse(widget.labResultHistory[index].resultValue);
|
||||
spots.add(FlSpot(index.toDouble(), resultValueDouble));
|
||||
} catch (e) {
|
||||
print(e);
|
||||
spots.add(FlSpot(index.toDouble(), 0.0));
|
||||
}
|
||||
}
|
||||
|
||||
final LineChartBarData lineChartBarData1 = LineChartBarData(
|
||||
spots: spots,
|
||||
isCurved: true,
|
||||
colors: [Colors.red],
|
||||
barWidth: 3,
|
||||
isStrokeCapRound: true,
|
||||
curveSmoothness: 0.12,
|
||||
dotData: FlDotData(
|
||||
show: false,
|
||||
),
|
||||
belowBarData: BarAreaData(
|
||||
show: false,
|
||||
),
|
||||
);
|
||||
|
||||
return [
|
||||
lineChartBarData1,
|
||||
];
|
||||
}
|
||||
}
|
@ -0,0 +1,177 @@
|
||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/screens/patients/profile/lab_result/special_lab_result_details_page.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart';
|
||||
import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class AllLabSpecialResult extends StatefulWidget {
|
||||
const AllLabSpecialResult({Key key}) : super(key: key);
|
||||
|
||||
@override
|
||||
_AllLabSpecialResultState createState() => _AllLabSpecialResultState();
|
||||
}
|
||||
|
||||
class _AllLabSpecialResultState extends State<AllLabSpecialResult> {
|
||||
String patientType;
|
||||
|
||||
String arrivalType;
|
||||
PatiantInformtion patient;
|
||||
bool isInpatient;
|
||||
bool isFromLiveCare;
|
||||
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
|
||||
patient = routeArgs['patient'];
|
||||
patientType = routeArgs['patientType'];
|
||||
arrivalType = routeArgs['arrivalType'];
|
||||
isInpatient = routeArgs['isInpatient'];
|
||||
isFromLiveCare = routeArgs['isFromLiveCare'];
|
||||
|
||||
print(arrivalType);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
ProjectViewModel projectViewModel = Provider.of(context);
|
||||
return BaseView<LabsViewModel>(
|
||||
onModelReady: (model) => model.getAllSpecialLabResult(patientId: patient.patientMRN),
|
||||
builder: (context, LabsViewModel model, widget) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
backgroundColor: Colors.grey[100],
|
||||
isShowAppBar: true,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
isInpatient: isInpatient,
|
||||
),
|
||||
body: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: FractionallySizedBox(
|
||||
widthFactor: 1.0,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).special + " " + TranslationBase.of(context).lab,
|
||||
style: "caption2",
|
||||
color: Colors.black,
|
||||
fontSize: 13,
|
||||
),
|
||||
AppText(
|
||||
TranslationBase.of(context).result,
|
||||
bold: true,
|
||||
fontSize: 22,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
...List.generate(
|
||||
model.allSpecialLabList.length,
|
||||
(index) => Container(
|
||||
margin: EdgeInsets.all(10),
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 0.5,
|
||||
color: Colors.white,
|
||||
),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(8.0),
|
||||
),
|
||||
color: Colors.white),
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
width: 20,
|
||||
height: 160,
|
||||
decoration: BoxDecoration(
|
||||
color: model.allSpecialLabList[index].isLiveCareAppointment
|
||||
? Colors.red[900]
|
||||
: !model.allSpecialLabList[index].isInOutPatient
|
||||
? Colors.black
|
||||
: Color(0xffa9a089),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
||||
bottomLeft: projectViewModel.isArabic ? Radius.circular(0) : Radius.circular(8),
|
||||
topRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0),
|
||||
bottomRight: projectViewModel.isArabic ? Radius.circular(8) : Radius.circular(0)),
|
||||
),
|
||||
child: RotatedBox(
|
||||
quarterTurns: 3,
|
||||
child: Center(
|
||||
child: Text(
|
||||
model.allSpecialLabList[index].isLiveCareAppointment
|
||||
? TranslationBase.of(context).liveCare.toUpperCase()
|
||||
: !model.allSpecialLabList[index].isInOutPatient
|
||||
? TranslationBase.of(context).inPatientLabel.toUpperCase()
|
||||
: TranslationBase.of(context).outpatient.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
)),
|
||||
),
|
||||
Expanded(
|
||||
child: DoctorCard(
|
||||
isNoMargin: true,
|
||||
onTap: () => Navigator.push(
|
||||
context,
|
||||
FadePage(
|
||||
page: SpecialLabResultDetailsPage(
|
||||
resultData: model.allSpecialLabList[index].resultDataHTML,
|
||||
patient: patient,
|
||||
),
|
||||
),
|
||||
),
|
||||
doctorName: model.allSpecialLabList[index].doctorName,
|
||||
invoiceNO: ' ${model.allSpecialLabList[index].invoiceNo}',
|
||||
profileUrl: model.allSpecialLabList[index].doctorImageURL,
|
||||
branch: model.allSpecialLabList[index].projectName,
|
||||
clinic: model.allSpecialLabList[index].clinicDescription,
|
||||
appointmentDate: model.allSpecialLabList[index].orderDate,
|
||||
orderNo: model.allSpecialLabList[index].orderNo,
|
||||
isShowTime: false,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43)
|
||||
Center(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
Image.asset('assets/images/no-data.png'),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: AppText('No Lab Result Found'),
|
||||
)
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
|
||||
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'Lab_Result_history_details_wideget.dart';
|
||||
import 'LineChartCurvedLabHistory.dart';
|
||||
|
||||
class LabResultHistoryChartAndDetails extends StatelessWidget {
|
||||
LabResultHistoryChartAndDetails({
|
||||
Key key,
|
||||
@required this.labResultHistory,
|
||||
@required this.name,
|
||||
}) : super(key: key);
|
||||
|
||||
final List<LabResultHistory> labResultHistory;
|
||||
final String name;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(10.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(12)),
|
||||
child: LineChartCurvedLabHistory(
|
||||
title: name,
|
||||
labResultHistory: labResultHistory,
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 16),
|
||||
padding: EdgeInsets.only(top: 16, right: 18.0, left: 16.0),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white, borderRadius: BorderRadius.circular(12)),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
TranslationBase.of(context).graphDetails,
|
||||
fontSize: SizeConfig.textMultiplier * 2.1,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
SizedBox(
|
||||
height: 8,
|
||||
),
|
||||
LabResultHistoryDetailsWidget(
|
||||
labResultHistory: labResultHistory.reversed.toList(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,83 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:doctor_app_flutter/core/viewModel/PatientMedicalReportViewModel.dart';
|
||||
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
|
||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
||||
import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-app-bar.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||
import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_html/flutter_html.dart';
|
||||
|
||||
class SpecialLabResultDetailsPage extends StatelessWidget {
|
||||
final String resultData;
|
||||
final PatiantInformtion patient;
|
||||
|
||||
const SpecialLabResultDetailsPage({Key key, this.resultData, this.patient}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<PatientMedicalReportViewModel>(
|
||||
builder: (_, model, w) => AppScaffold(
|
||||
baseViewModel: model,
|
||||
isShowAppBar: true,
|
||||
backgroundColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
appBar: PatientProfileAppBar(
|
||||
patient,
|
||||
),
|
||||
body: Container(
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
"Special Lab ",
|
||||
fontSize: SizeConfig.textMultiplier * 1.6,
|
||||
fontWeight: FontWeight.w700,
|
||||
color: Color(0xFF2E303A),
|
||||
),
|
||||
AppText(
|
||||
"Result",
|
||||
fontSize: SizeConfig.textMultiplier * 3,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF2E303A),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
resultData != null
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
margin: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
padding: EdgeInsets.symmetric(horizontal: 16, vertical: 16),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
shape: BoxShape.rectangle,
|
||||
borderRadius: BorderRadius.all(Radius.circular(8)),
|
||||
border: Border.fromBorderSide(
|
||||
BorderSide(
|
||||
color: Colors.white,
|
||||
width: 1.0,
|
||||
),
|
||||
),
|
||||
),
|
||||
child: Html(data: resultData ?? ""),
|
||||
)
|
||||
: Container(
|
||||
child: ErrorMessage(
|
||||
error: "No Data",
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,43 @@
|
||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../app_texts_widget.dart';
|
||||
|
||||
class CustomRow extends StatelessWidget {
|
||||
const CustomRow({
|
||||
Key key,
|
||||
this.label,
|
||||
this.value, this.labelSize, this.valueSize, this.width,
|
||||
}) : super(key: key);
|
||||
|
||||
final String label;
|
||||
final String value;
|
||||
final double labelSize;
|
||||
final double valueSize;
|
||||
final double width;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
AppText(
|
||||
label,
|
||||
fontSize: labelSize??SizeConfig.getTextMultiplierBasedOnWidth() * 2.8,
|
||||
color: Color(0xFF575757),
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
SizedBox(
|
||||
width: 1,
|
||||
),
|
||||
AppText(
|
||||
value,
|
||||
fontSize: valueSize??SizeConfig.getTextMultiplierBasedOnWidth() * 3,
|
||||
color: Color(0xFF2E303A),
|
||||
fontWeight: FontWeight.w700,
|
||||
isCopyable: true,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue