Skip to content

Commit

Permalink
feat(app): show results if lookup not present but lab result
Browse files Browse the repository at this point in the history
  • Loading branch information
tamslo committed Sep 6, 2024
1 parent bba68f0 commit df02e86
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions app/lib/common/models/userdata/genotype_result.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:collection/collection.dart';
import 'package:hive/hive.dart';

import '../../module.dart';
Expand Down Expand Up @@ -25,14 +26,22 @@ class GenotypeResult implements Genotype {
allelesTested: labResult.allelesTested,
);

factory GenotypeResult.missingResult(String gene, BuildContext context) =>
GenotypeResult(
factory GenotypeResult.missingResult(String gene, BuildContext context) {
final potentialLabResultWithoutLookups =
UserData.instance.labData?.firstWhereOrNull(
(labResult) => labResult.gene == gene
);
return GenotypeResult(
gene: gene,
variant: context.l10n.general_not_tested,
phenotype: context.l10n.general_not_tested,
variant: potentialLabResultWithoutLookups?.variant
?? context.l10n.general_not_tested,
phenotype: potentialLabResultWithoutLookups?.phenotype
?? context.l10n.general_not_tested,
lookupkey: context.l10n.general_not_tested,
allelesTested: context.l10n.general_not_tested,
allelesTested: potentialLabResultWithoutLookups?.allelesTested
?? context.l10n.general_not_tested,
);
}

@override
@HiveField(0)
Expand Down

0 comments on commit df02e86

Please sign in to comment.