Ejemplo n.º 1
0
        public DkProcessingItem Execute(DkProcessingItem value)
        {
            if (value.DiagnosisKey.Origin != TekOrigin.Local)
            {
                throw new InvalidOperationException("This is a local processor for local DKs. You wouldn't like it here...");
            }

            value.DiagnosisKey.Efgs.CountriesOfInterest = string.Join(",", _value);
            return(value);
        }
        public DkProcessingItem Execute(DkProcessingItem value)
        {
            if (!value.DiagnosisKey.Local.TransmissionRiskLevel.HasValue || !value.DiagnosisKey.Local.DaysSinceSymptomsOnset.HasValue)
            {
                throw new InvalidOperationException($"{nameof(NlToEfgsDsosDiagnosticKeyProcessorMk1)} requires TRL and DaysSinceSymptomsOnset.");
            }

            var baseValue = new DosViaTrlDayRangeMidPointCalculation().Calculate(value.DiagnosisKey.Local.DaysSinceSymptomsOnset.Value);

            value.DiagnosisKey.Efgs.DaysSinceSymptomsOnset = new DsosEncodingService().EncodeSymptomaticOnsetDateUnknown(baseValue);
            return(value);
        }
Ejemplo n.º 3
0
        public DkProcessingItem Execute(DkProcessingItem value)
        {
            if (value == null)
            {
                return(value);
            }

            if (!new DsosEncodingService().TryDecode(value.DiagnosisKey.Efgs.DaysSinceSymptomsOnset.Value, out var result))
            {
                //TODO log
                return(null);
            }

            value.Metadata[DecodedDsosMetadataKey] = result;
            return(value);
        }
Ejemplo n.º 4
0
        public DkProcessingItem Execute(DkProcessingItem value)
        {
            if (value == null)
            {
                return(value);
            }

            if (value.DiagnosisKey.Local.DaysSinceSymptomsOnset == null)
            {
                return(value);
            }

            value.DiagnosisKey.Local.TransmissionRiskLevel = new TransmissionRiskLevelCalculationMk2().Calculate(value.DiagnosisKey.Local.DaysSinceSymptomsOnset.Value);

            return(value);
        }
Ejemplo n.º 5
0
        public DkProcessingItem Execute(DkProcessingItem value)
        {
            if (value == null)
            {
                return(value);
            }

            if (!value.Metadata.TryGetValue(DosDecodingDiagnosticKeyProcessor.DecodedDsosMetadataKey, out var decodedDos))
            {
                //TODO log not present... and fill up the log files...
                return(null);
            }

            //decodedDos map to TRL...
            value.DiagnosisKey.Local.TransmissionRiskLevel = GetTrl((DsosDecodeResult)decodedDos);

            return(value);
        }
Ejemplo n.º 6
0
 public DkProcessingItem Execute(DkProcessingItem value)
 {
     return(_acceptedCountries.Contains(value.DiagnosisKey.Efgs.CountryOfOrigin) ? value : null);
 }
Ejemplo n.º 7
0
 public DkProcessingItem Execute(DkProcessingItem value)
 => value.DiagnosisKey.Local.TransmissionRiskLevel == TransmissionRiskLevel.None ? null : value;
Ejemplo n.º 8
0
 //Assumes a cleaning processor has already done Trim/ToUpper
 public DkProcessingItem Execute(DkProcessingItem value)
 => value.Metadata.TryGetValue("Source", out var source) && _include.Contains(source) ? value : null;