/// <summary>Builds field dictionary.</summary>
        /// <exception cref="ArgumentNullException">Thrown when one or more required arguments are null.</exception>
        /// <param name="deviceData"> Information describing the device.</param>
        /// <param name="patientData">Information describing the patient.</param>
        /// <param name="testData">   Information describing the test.</param>
        /// <param name="workerData"> Information describing the worker.</param>
        /// <returns>A Dictionary&lt;string,FieldValue&gt;</returns>
        public static Dictionary <string, FieldValue> BuildFieldDict(
            OrgDeviceData deviceData,
            OrgPatientData patientData,
            OrgTestData testData,
            OrgWorkerData workerData)
        {
            if (deviceData == null)
            {
                throw new ArgumentNullException(nameof(deviceData));
            }

            if (patientData == null)
            {
                throw new ArgumentNullException(nameof(patientData));
            }

            if (testData == null)
            {
                throw new ArgumentNullException(nameof(testData));
            }

            if (workerData == null)
            {
                throw new ArgumentNullException(nameof(workerData));
            }

            Dictionary <string, FieldValue> fieldDict = new Dictionary <string, FieldValue>();

            ComputeCdcPatientImpactScores(
                fieldDict,
                deviceData,
                patientData);

            ComputeCdcWorkerScores(
                fieldDict,
                workerData);

            ComputeFemaDailyReportingScores(
                fieldDict,
                testData);

            return(fieldDict);
        }
        /// <summary>Builds score dictionaries.</summary>
        /// <param name="values">     The values.</param>
        /// <param name="deviceData"> Information describing the device.</param>
        /// <param name="patientData">Information describing the patient.</param>
        private static void ComputeCdcPatientImpactScores(
            Dictionary <string, FieldValue> values,
            OrgDeviceData deviceData,
            OrgPatientData patientData)
        {
            int val;

            values.Add(AcutePatientImpact.TotalBeds, new FieldValue(deviceData.TotalBeds));

            values.Add(AcutePatientImpact.InpatientBeds, new FieldValue(deviceData.Inpatient));

            val = Math.Min(deviceData.Inpatient, patientData.Total);
            values.Add(AcutePatientImpact.InpatientBedOccupancy, new FieldValue(val));

            values.Add(AcutePatientImpact.IcuBeds, new FieldValue(deviceData.ICU));

            val = Math.Min(deviceData.ICU, patientData.NegativeNeedIcu + patientData.PositiveNeedIcu);
            values.Add(AcutePatientImpact.IcuBedOccupancy, new FieldValue(val));

            values.Add(AcutePatientImpact.Ventilators, new FieldValue(deviceData.Ventilators));

            val = Math.Min(deviceData.Ventilators, patientData.NegativeNeedVent + patientData.PositiveNeedVent);
            values.Add(AcutePatientImpact.VentilatorsInUse, new FieldValue(val));

            val = Math.Min(deviceData.TotalBeds - patientData.Negative, patientData.Positive);
            values.Add(AcutePatientImpact.HospitalizedPatients, new FieldValue(val));

            val = Math.Min(deviceData.Ventilators - patientData.NegativeNeedVent, patientData.PositiveNeedVent);
            values.Add(AcutePatientImpact.VentilatedPatients, new FieldValue(val));

            values.Add(AcutePatientImpact.HospitalOnset, new FieldValue(patientData.OnsetInCare));

            val = Math.Max(0, patientData.Positive - (deviceData.TotalBeds - patientData.Negative));
            values.Add(AcutePatientImpact.AwaitingBeds, new FieldValue(val));

            val = Math.Max(0, patientData.PositiveNeedVent - (deviceData.Ventilators - patientData.NegativeNeedVent));
            values.Add(AcutePatientImpact.AwaitingVentilators, new FieldValue(val));

            values.Add(AcutePatientImpact.Died, new FieldValue(patientData.Died));
        }