style: apply rustfmt across all crates and demos
Consistent formatting pass: line wrapping, import sorting, trailing whitespace removal, let-chain indentation, merged derive attributes, and unsafe block reformatting. Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This commit is contained in:
@@ -121,25 +121,27 @@ impl MultiModalFusion {
|
||||
|
||||
// Add CT evidence
|
||||
if let Some(ct_findings) = ct
|
||||
&& let Some(lesion) = ct_findings.lesions.first() {
|
||||
probability = probability.max(lesion.malignancy_probability * 0.8);
|
||||
evidence.push(Evidence {
|
||||
modality: ImagingModality::CT,
|
||||
finding: ct_findings.assessment.clone(),
|
||||
weight: self.ct_weight,
|
||||
});
|
||||
}
|
||||
&& let Some(lesion) = ct_findings.lesions.first()
|
||||
{
|
||||
probability = probability.max(lesion.malignancy_probability * 0.8);
|
||||
evidence.push(Evidence {
|
||||
modality: ImagingModality::CT,
|
||||
finding: ct_findings.assessment.clone(),
|
||||
weight: self.ct_weight,
|
||||
});
|
||||
}
|
||||
|
||||
// Add MRI evidence
|
||||
if let Some(mri_findings) = mri
|
||||
&& let Some(lesion) = mri_findings.lesions.first() {
|
||||
probability = probability.max(lesion.malignancy_probability * 0.8);
|
||||
evidence.push(Evidence {
|
||||
modality: ImagingModality::MRI,
|
||||
finding: mri_findings.assessment.clone(),
|
||||
weight: self.mri_weight,
|
||||
});
|
||||
}
|
||||
&& let Some(lesion) = mri_findings.lesions.first()
|
||||
{
|
||||
probability = probability.max(lesion.malignancy_probability * 0.8);
|
||||
evidence.push(Evidence {
|
||||
modality: ImagingModality::MRI,
|
||||
finding: mri_findings.assessment.clone(),
|
||||
weight: self.mri_weight,
|
||||
});
|
||||
}
|
||||
|
||||
// Determine diagnosis name
|
||||
let name = if pathology.is_some() {
|
||||
@@ -285,39 +287,41 @@ impl MultiModalFusion {
|
||||
if let Some(path) = pathology {
|
||||
// Check PD-L1 status
|
||||
if let Some(pdl1) = path.biomarkers.iter().find(|b| b.name == "PD-L1")
|
||||
&& let Some(expression) = pdl1.expression {
|
||||
let impact = if expression >= 50.0 {
|
||||
PrognosticImpact::Favorable
|
||||
} else if expression >= 1.0 {
|
||||
PrognosticImpact::Neutral
|
||||
} else {
|
||||
PrognosticImpact::Unfavorable
|
||||
};
|
||||
&& let Some(expression) = pdl1.expression
|
||||
{
|
||||
let impact = if expression >= 50.0 {
|
||||
PrognosticImpact::Favorable
|
||||
} else if expression >= 1.0 {
|
||||
PrognosticImpact::Neutral
|
||||
} else {
|
||||
PrognosticImpact::Unfavorable
|
||||
};
|
||||
|
||||
prognostic_factors.push(PrognosticFactor {
|
||||
name: "PD-L1 expression".to_string(),
|
||||
value: format!("{expression:.0}%"),
|
||||
impact,
|
||||
});
|
||||
}
|
||||
prognostic_factors.push(PrognosticFactor {
|
||||
name: "PD-L1 expression".to_string(),
|
||||
value: format!("{expression:.0}%"),
|
||||
impact,
|
||||
});
|
||||
}
|
||||
|
||||
// Check Ki-67
|
||||
if let Some(ki67) = path.biomarkers.iter().find(|b| b.name == "Ki-67")
|
||||
&& let Some(expression) = ki67.expression {
|
||||
let impact = if expression > 30.0 {
|
||||
PrognosticImpact::Unfavorable
|
||||
} else if expression > 15.0 {
|
||||
PrognosticImpact::Neutral
|
||||
} else {
|
||||
PrognosticImpact::Favorable
|
||||
};
|
||||
&& let Some(expression) = ki67.expression
|
||||
{
|
||||
let impact = if expression > 30.0 {
|
||||
PrognosticImpact::Unfavorable
|
||||
} else if expression > 15.0 {
|
||||
PrognosticImpact::Neutral
|
||||
} else {
|
||||
PrognosticImpact::Favorable
|
||||
};
|
||||
|
||||
prognostic_factors.push(PrognosticFactor {
|
||||
name: "Ki-67 proliferation index".to_string(),
|
||||
value: format!("{expression:.0}%"),
|
||||
impact,
|
||||
});
|
||||
}
|
||||
prognostic_factors.push(PrognosticFactor {
|
||||
name: "Ki-67 proliferation index".to_string(),
|
||||
value: format!("{expression:.0}%"),
|
||||
impact,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Some(TumorAssessment {
|
||||
|
||||
Reference in New Issue
Block a user