示例#1
0
        //Take the highest TRL that can be inferred from the DsosDecodeResult.
        private TransmissionRiskLevel GetTrl(DsosDecodeResult value)
        {
            if (value.SymptomObservation == SymptomObservation.Symptomatic)
            {
                var symptomaticValue = value.AsSymptomatic();

                if (symptomaticValue.SymptomsOnsetDatePrecision == SymptomsOnsetDatePrecision.Exact)
                {
                    return(_TrlCalculation.Calculate(symptomaticValue.DaysSinceOnsetOfSymptoms));
                }

                if (symptomaticValue.SymptomsOnsetDatePrecision == SymptomsOnsetDatePrecision.Range)
                {
                    return(GetTrl(symptomaticValue.DaysSinceLastSymptoms));
                }
            }

            //Default
            return(_TrlCalculation.Calculate(value.DaysSinceSubmission));
        }
 private InfectiousPeriodType GetSymptomObservation(DsosDecodeResult value)
 {
     return(value.SymptomObservation == SymptomObservation.Asymptomatic
         ? InfectiousPeriodType.Asymptomatic
         : InfectiousPeriodType.Symptomatic); // Defaults to Symptomatic
 }