Merge branch 'DAPP_99_soap_model' into 'development'
Dapp 99 soap model See merge request Cloud_Solution/doctor_app_flutter!984merge-requests/985/merge
commit
010310eb48
@ -1,60 +0,0 @@
|
|||||||
class AllergyModel {
|
|
||||||
int allergyDiseaseId;
|
|
||||||
String allergyDiseaseName;
|
|
||||||
int allergyDiseaseType;
|
|
||||||
int appointmentNo;
|
|
||||||
int createdBy;
|
|
||||||
String createdByName;
|
|
||||||
String createdOn;
|
|
||||||
int episodeID;
|
|
||||||
bool isChecked;
|
|
||||||
bool isUpdatedByNurse;
|
|
||||||
int severity;
|
|
||||||
String severityName;
|
|
||||||
|
|
||||||
AllergyModel(
|
|
||||||
{this.allergyDiseaseId,
|
|
||||||
this.allergyDiseaseName,
|
|
||||||
this.allergyDiseaseType,
|
|
||||||
this.appointmentNo,
|
|
||||||
this.createdBy,
|
|
||||||
this.createdByName,
|
|
||||||
this.createdOn,
|
|
||||||
this.episodeID,
|
|
||||||
this.isChecked,
|
|
||||||
this.isUpdatedByNurse,
|
|
||||||
this.severity,
|
|
||||||
this.severityName});
|
|
||||||
|
|
||||||
AllergyModel.fromJson(Map<String, dynamic> json) {
|
|
||||||
allergyDiseaseId = json['allergyDiseaseId'];
|
|
||||||
allergyDiseaseName = json['allergyDiseaseName'];
|
|
||||||
allergyDiseaseType = json['allergyDiseaseType'];
|
|
||||||
appointmentNo = json['appointmentNo'];
|
|
||||||
createdBy = json['createdBy'];
|
|
||||||
createdByName = json['createdByName'];
|
|
||||||
createdOn = json['createdOn'];
|
|
||||||
episodeID = json['episodeID'];
|
|
||||||
isChecked = json['isChecked'];
|
|
||||||
isUpdatedByNurse = json['isUpdatedByNurse'];
|
|
||||||
severity = json['severity'];
|
|
||||||
severityName = json['severityName'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
data['allergyDiseaseId'] = this.allergyDiseaseId;
|
|
||||||
data['allergyDiseaseName'] = this.allergyDiseaseName;
|
|
||||||
data['allergyDiseaseType'] = this.allergyDiseaseType;
|
|
||||||
data['appointmentNo'] = this.appointmentNo;
|
|
||||||
data['createdBy'] = this.createdBy;
|
|
||||||
data['createdByName'] = this.createdByName;
|
|
||||||
data['createdOn'] = this.createdOn;
|
|
||||||
data['episodeID'] = this.episodeID;
|
|
||||||
data['isChecked'] = this.isChecked;
|
|
||||||
data['isUpdatedByNurse'] = this.isUpdatedByNurse;
|
|
||||||
data['severity'] = this.severity;
|
|
||||||
data['severityName'] = this.severityName;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,20 +1,3 @@
|
|||||||
// final List<Countries> countries = [
|
|
||||||
// new Countries(
|
|
||||||
// name: "Saudi Arabia", name_ar: "المملكة العربية السعودية", code: '966'),
|
|
||||||
// new Countries(
|
|
||||||
// name: "United Arab Emirates",
|
|
||||||
// name_ar: "الإمارات العربية المتحدة",
|
|
||||||
// code: '971'),
|
|
||||||
// ];
|
|
||||||
|
|
||||||
// class Countries {
|
|
||||||
// final String name;
|
|
||||||
// final String name_ar;
|
|
||||||
// final String code;
|
|
||||||
|
|
||||||
// Countries({this.name, this.name_ar, this.code});
|
|
||||||
// }
|
|
||||||
|
|
||||||
class Countries {
|
class Countries {
|
||||||
String name;
|
String name;
|
||||||
String nameAr;
|
String nameAr;
|
||||||
@ -1,64 +0,0 @@
|
|||||||
class RequestPatientLabOrders {
|
|
||||||
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;
|
|
||||||
|
|
||||||
RequestPatientLabOrders(
|
|
||||||
{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});
|
|
||||||
|
|
||||||
RequestPatientLabOrders.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'];
|
|
||||||
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['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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,163 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/labs_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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';
|
|
||||||
|
|
||||||
class LabResultHistoryPage extends StatelessWidget {
|
|
||||||
final PatientLabOrders patientLabOrder;
|
|
||||||
final String filterName;
|
|
||||||
final PatiantInformtion patient;
|
|
||||||
|
|
||||||
LabResultHistoryPage({this.patientLabOrder, this.filterName, this.patient});
|
|
||||||
|
|
||||||
// TODO Elham* UI changes and add translation
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BaseView<LabsViewModel>(
|
|
||||||
onModelReady: (model) => model.getPatientLabResultHistoryByDescription(
|
|
||||||
patientLabOrder: patientLabOrder,
|
|
||||||
procedureDescription: filterName,
|
|
||||||
patient: patient),
|
|
||||||
builder: (context, model, w) => AppScaffold(
|
|
||||||
isShowAppBar: true,
|
|
||||||
appBarTitle: filterName,
|
|
||||||
baseViewModel: model,
|
|
||||||
body: model.labOrdersResultHistoryList.length > 0
|
|
||||||
? SingleChildScrollView(
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
...List.generate(model.labOrdersResultHistoryList.length,
|
|
||||||
(index) {
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.symmetric(
|
|
||||||
vertical: 8.0, horizontal: 16.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
TranslationBase.of(context).description,
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3,
|
|
||||||
color: Color(0xFF575757),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
model.labOrdersResultHistoryList[index]
|
|
||||||
.description,
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3.5,
|
|
||||||
color: Color(0xFF2E303A),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
isCopyable: true,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
"Reference Range",
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3,
|
|
||||||
color: Color(0xFF575757),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
model.labOrdersResultHistoryList[index]
|
|
||||||
.referanceRange,
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3.5,
|
|
||||||
color: Color(0xFF2E303A),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
isCopyable: true,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
"Result Value",
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3,
|
|
||||||
color: Color(0xFF575757),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
model.labOrdersResultHistoryList[index]
|
|
||||||
.resultValue,
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3.5,
|
|
||||||
color: Color(0xFF2E303A),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
isCopyable: true,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
AppText(
|
|
||||||
"Verified On",
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3,
|
|
||||||
color: Color(0xFF575757),
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
model.labOrdersResultHistoryList[index]
|
|
||||||
.verifiedOn,
|
|
||||||
fontSize: SizeConfig
|
|
||||||
.getTextMultiplierBasedOnWidth() *
|
|
||||||
3.5,
|
|
||||||
color: Color(0xFF2E303A),
|
|
||||||
fontWeight: FontWeight.w700,
|
|
||||||
isCopyable: true,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Divider(
|
|
||||||
color: Colors.grey,
|
|
||||||
height: 0.75,
|
|
||||||
thickness: 0.75,
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 10,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
)
|
|
||||||
: ErrorMessage(
|
|
||||||
error: "No data",
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,232 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
||||||
import 'package:fl_chart/fl_chart.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import '../../../../core/model/labs/LabOrderResult.dart';
|
|
||||||
|
|
||||||
class LineChartCurved extends StatefulWidget {
|
|
||||||
final String title;
|
|
||||||
final List<LabOrderResult> labResult;
|
|
||||||
|
|
||||||
LineChartCurved({this.title, this.labResult});
|
|
||||||
|
|
||||||
@override
|
|
||||||
State<StatefulWidget> createState() => LineChartCurvedState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class LineChartCurvedState extends State<LineChartCurved> {
|
|
||||||
bool isShowingMainData;
|
|
||||||
List<int> xAxixs = List();
|
|
||||||
int indexes = 0;
|
|
||||||
|
|
||||||
@override
|
|
||||||
void initState() {
|
|
||||||
super.initState();
|
|
||||||
getXaxix();
|
|
||||||
isShowingMainData = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
getXaxix() {
|
|
||||||
indexes = widget.labResult.length ~/ 3.5;
|
|
||||||
for (int index = 0; index < widget.labResult.length; index++) {
|
|
||||||
int mIndex = indexes * index;
|
|
||||||
if (mIndex < widget.labResult.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,
|
|
||||||
),
|
|
||||||
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: (context, value) {
|
|
||||||
return TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
fontSize: 10,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
margin: 28,
|
|
||||||
rotateAngle: -65,
|
|
||||||
getTitles: (value) {
|
|
||||||
print(value);
|
|
||||||
DateTime date = AppDateUtils.convertStringToDate(
|
|
||||||
widget.labResult[value.toInt()].verifiedOnDateTime);
|
|
||||||
if (widget.labResult.length < 8) {
|
|
||||||
if (widget.labResult.length > value.toInt()) {
|
|
||||||
return '${date.day}/ ${date.year}';
|
|
||||||
} else
|
|
||||||
return '';
|
|
||||||
} else {
|
|
||||||
if (value.toInt() == 0) return '${date.day}/ ${date.year}';
|
|
||||||
if (value.toInt() == widget.labResult.length - 1)
|
|
||||||
return '${date.day}/ ${date.year}';
|
|
||||||
if (xAxixs.contains(value.toInt())) {
|
|
||||||
return '${date.day}/ ${date.year}';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
},
|
|
||||||
),
|
|
||||||
leftTitles: SideTitles(
|
|
||||||
showTitles: true,
|
|
||||||
getTextStyles: (context, value) {
|
|
||||||
return TextStyle(
|
|
||||||
color: Colors.black,
|
|
||||||
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.labResult.length - 1).toDouble(),
|
|
||||||
maxY: getMaxY() + 2,
|
|
||||||
minY: getMinY(),
|
|
||||||
lineBarsData: getData(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
double getMaxY() {
|
|
||||||
double max = 0;
|
|
||||||
widget.labResult.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.labResult[0].resultValue);
|
|
||||||
|
|
||||||
widget.labResult.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.labResult.length; index++) {
|
|
||||||
try {
|
|
||||||
var resultValueDouble =
|
|
||||||
double.parse(widget.labResult[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,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +1,11 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
|
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'Lab_Result_history_details_wideget.dart';
|
import 'lab_result_history_details_wideget.dart';
|
||||||
import 'LineChartCurvedLabHistory.dart';
|
import 'line_chart_curved_lab_history.dart';
|
||||||
|
|
||||||
class LabResultHistoryChartAndDetails extends StatelessWidget {
|
class LabResultHistoryChartAndDetails extends StatelessWidget {
|
||||||
LabResultHistoryChartAndDetails({
|
LabResultHistoryChartAndDetails({
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/labs/LabResultHistory.dart';
|
import 'package:doctor_app_flutter/core/model/labs/lab_result_history.dart';
|
||||||
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
||||||
import 'package:fl_chart/fl_chart.dart';
|
import 'package:fl_chart/fl_chart.dart';
|
||||||
@ -1,63 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
import 'Lab_Result_details_wideget.dart';
|
|
||||||
import 'LineChartCurved.dart';
|
|
||||||
|
|
||||||
class LabResultChartAndDetails extends StatelessWidget {
|
|
||||||
LabResultChartAndDetails({
|
|
||||||
Key key,
|
|
||||||
@required this.labResult,
|
|
||||||
@required this.name,
|
|
||||||
}) : super(key: key);
|
|
||||||
|
|
||||||
final List<LabOrderResult> labResult;
|
|
||||||
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: LineChartCurved(
|
|
||||||
title: name,
|
|
||||||
labResult: labResult,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
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,
|
|
||||||
fontFamily: 'Poppins',
|
|
||||||
),
|
|
||||||
SizedBox(
|
|
||||||
height: 8,
|
|
||||||
),
|
|
||||||
LabResultDetailsWidget(
|
|
||||||
labResult: labResult.reversed.toList(),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/core/model/patient/lab_orders/lab_orders_res_model.dart';
|
|
||||||
import 'package:doctor_app_flutter/screens/base/base_view.dart';
|
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.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/card_with_bgNew_widget.dart';
|
|
||||||
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
|
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/material.dart';
|
|
||||||
|
|
||||||
class LabResult extends StatefulWidget {
|
|
||||||
final LabOrdersResModel labOrders;
|
|
||||||
|
|
||||||
LabResult({Key key, this.labOrders});
|
|
||||||
|
|
||||||
@override
|
|
||||||
_LabResultState createState() => _LabResultState();
|
|
||||||
}
|
|
||||||
|
|
||||||
class _LabResultState extends State<LabResult> {
|
|
||||||
@override
|
|
||||||
Widget build(BuildContext context) {
|
|
||||||
return BaseView<PatientViewModel>(
|
|
||||||
onModelReady: (model) => model.getLabResult(widget.labOrders),
|
|
||||||
builder: (_, model, w) => AppScaffold(
|
|
||||||
baseViewModel: model,
|
|
||||||
appBarTitle: TranslationBase.of(context).labOrders,
|
|
||||||
body: model.labResultList.length == 0
|
|
||||||
? DrAppEmbeddedError(
|
|
||||||
error: TranslationBase.of(context).errorNoLabOrders)
|
|
||||||
: Container(
|
|
||||||
margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05,
|
|
||||||
0, SizeConfig.realScreenWidth * 0.05, 0),
|
|
||||||
child: ListView(
|
|
||||||
children: <Widget>[
|
|
||||||
CardWithBgWidgetNew(
|
|
||||||
widget: Column(
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
AppText(
|
|
||||||
TranslationBase.of(context).orderNo,
|
|
||||||
fontSize: 2 * SizeConfig.textMultiplier,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
' ${widget.labOrders.orderNo}',
|
|
||||||
fontSize: 2 * SizeConfig.textMultiplier,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
|
||||||
children: <Widget>[
|
|
||||||
AppText(
|
|
||||||
TranslationBase.of(context).invoiceNo,
|
|
||||||
fontSize: 2 * SizeConfig.textMultiplier,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
),
|
|
||||||
AppText(
|
|
||||||
' ${widget.labOrders.invoiceNo}',
|
|
||||||
fontSize: 2 * SizeConfig.textMultiplier,
|
|
||||||
color: Colors.grey[800],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
CardWithBgWidgetNew(
|
|
||||||
widget: LabResultWidget(
|
|
||||||
labResult: model.labResultList,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,5 +1,5 @@
|
|||||||
import 'package:doctor_app_flutter/config/size_config.dart';
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
import 'package:doctor_app_flutter/core/model/labs/LabOrderResult.dart';
|
import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
|
||||||
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
||||||
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
||||||
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
||||||
Loading…
Reference in New Issue