change lab result design

merge-requests/846/head
mosazaid 4 years ago
parent 2274affd9a
commit 495c8fb3b0

@ -10,6 +10,8 @@ class LabResult {
String projectID;
String referanceRange;
String resultValue;
String maxValue;
String minValue;
String sampleCollectedOn;
String sampleReceivedOn;
String setupID;
@ -21,24 +23,26 @@ class LabResult {
LabResult(
{this.description,
this.femaleInterpretativeData,
this.gender,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
this.femaleInterpretativeData,
this.gender,
this.lineItemNo,
this.maleInterpretativeData,
this.notes,
this.packageID,
this.patientID,
this.projectID,
this.referanceRange,
this.resultValue,
this.maxValue,
this.minValue,
this.sampleCollectedOn,
this.sampleReceivedOn,
this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabResult.fromJson(Map<String, dynamic> json) {
description = json['Description'];
@ -52,6 +56,8 @@ class LabResult {
projectID = json['ProjectID'].toString();
referanceRange = json['ReferenceRange'] ?? json['ReferanceRange'];
resultValue = json['ResultValue'];
maxValue = json['MaxValue'];
minValue = json['MinValue'];
sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID'];
@ -75,6 +81,8 @@ class LabResult {
data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue;
data['MaxValue'] = this.maxValue;
data['MinValue'] = this.minValue;
data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID;
@ -85,8 +93,29 @@ class LabResult {
data['VerifiedOnDateTime'] = this.verifiedOnDateTime;
return data;
}
}
int checkResultStatus() {
try {
var max = double.tryParse(maxValue) ?? null;
var min = double.tryParse(minValue) ?? null;
var result = double.tryParse(resultValue) ?? null;
if (max != null && min != null && result != null) {
if (result > max) {
return 1;
} else if (result < min) {
return -1;
} else {
return 0;
}
} else {
return 0;
}
}catch (e){
return 0;
}
}
}
class LabResultList {
String filterName = "";

@ -163,6 +163,7 @@ class LabResultWidget extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if(patientLabResultList[index].checkResultStatus() != 0)
Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
@ -172,7 +173,7 @@ class LabResultWidget extends StatelessWidget {
// ),
),
child: Icon(
Icons.arrow_upward,
patientLabResultList[index].checkResultStatus() == 1 ? Icons.arrow_upward : Icons.arrow_downward,
color: Colors.white,
size: 16,
),

Loading…
Cancel
Save