@ -459,7 +459,6 @@ class LabViewModel extends ChangeNotifier {
highRefrenceValue = double . negativeInfinity ;
highRefrenceValue = double . negativeInfinity ;
}
}
if ( double . parse ( element . referenceLow ? ? " 0.0 " ) = = 0 ) {
if ( double . parse ( element . referenceLow ? ? " 0.0 " ) = = 0 ) {
lowRefenceValue = double . negativeInfinity ;
lowRefenceValue = double . negativeInfinity ;
}
}
@ -473,9 +472,7 @@ class LabViewModel extends ChangeNotifier {
time: DateUtil . convertStringToDate ( element . verifiedOnDateTime ) ,
time: DateUtil . convertStringToDate ( element . verifiedOnDateTime ) ,
referenceValue: element . calculatedResultFlag ? ? " " ,
referenceValue: element . calculatedResultFlag ? ? " " ,
) ) ;
) ) ;
} catch ( e ) { }
} catch ( e ) {
}
} ) ;
} ) ;
if ( flagForLowReferenceRange = = null & & flagForHighReferenceRange = = null ) {
if ( flagForLowReferenceRange = = null & & flagForHighReferenceRange = = null ) {
highRefrenceValue = maxY ;
highRefrenceValue = maxY ;
@ -504,7 +501,6 @@ class LabViewModel extends ChangeNotifier {
maxX = maxY ;
maxX = maxY ;
}
}
/ / if ( maxY < highRefrenceValue ) {
/ / if ( maxY < highRefrenceValue ) {
/ / minY = highRefrenceValue - getInterval ( ) ;
/ / minY = highRefrenceValue - getInterval ( ) ;
/ / }
/ / }
@ -530,6 +526,7 @@ class LabViewModel extends ChangeNotifier {
bool isNumeric ( String s ) {
bool isNumeric ( String s ) {
return num . tryParse ( s ) ! = null ;
return num . tryParse ( s ) ! = null ;
}
}
num getInterval ( ) {
num getInterval ( ) {
/ / return . 1 ;
/ / return . 1 ;
var maxX = maxY ;
var maxX = maxY ;
@ -845,9 +842,7 @@ class LabViewModel extends ChangeNotifier {
notifyListeners ( ) ;
notifyListeners ( ) ;
}
}
Future < void > getAiOverviewLabOrders ( { required PatientLabOrdersResponseModel labOrder , required String loadingText } ) async {
Future < void > getAiOverviewLabOrders ( { required int langId , required PatientLabOrdersResponseModel labOrder , required String loadingText } ) async {
/ / LoadingUtils . showFullScreenLoader ( loadingText: " Loading and analysing your data, \n Please be patient and let the AI do the magic. \n Please be patient, This might take some time. " ) ;
/ / LoadingUtils . showFullScreenLoader ( loadingText: loadingText ) ;
isLabAIAnalysisNeedsToBeShown = true ;
isLabAIAnalysisNeedsToBeShown = true ;
notifyListeners ( ) ;
notifyListeners ( ) ;
@ -875,7 +870,8 @@ class LabViewModel extends ChangeNotifier {
}
}
orderData [ " results " ] = testResults ;
orderData [ " results " ] = testResults ;
results . add ( orderData ) ;
results . add ( orderData ) ;
final result = await labRepo . getPatientAiOverViewLabOrders ( results ) ;
final result = await labRepo . getPatientAiOverViewLabOrders ( payload: results , langId: langId ) ;
result . fold (
result . fold (
( failure ) async {
( failure ) async {
LoaderBottomSheet . hideLoader ( ) ;
LoaderBottomSheet . hideLoader ( ) ;
@ -903,7 +899,7 @@ class LabViewModel extends ChangeNotifier {
/ / LoadingUtils . hideFullScreenLoader ( ) ;
/ / LoadingUtils . hideFullScreenLoader ( ) ;
}
}
Future < void > getAiOverviewSingleLabResult ( { required String langId , required LabResult recentLabResult , required String loadingText } ) async {
Future < void > getAiOverviewSingleLabResult ( { required int langId , required LabResult recentLabResult , required String loadingText } ) async {
LoaderBottomSheet . showLoader (
LoaderBottomSheet . showLoader (
loadingText: loadingText ,
loadingText: loadingText ,
showCloseButton: true ,
showCloseButton: true ,