Пример #1
0
        BinarySplit RecordHispanic(PatientDemographic patient)
        {
            if (!patient.IsHispanic.HasValue)
            {
                return(null);
            }

            BinarySplit side = HispanicSplit.Right;

            if (patient.IsHispanic.Value)
            {
                side = HispanicSplit.Left;
            }

            side.Value++;
            return(side);
        }
Пример #2
0
        BinarySplit RecordMarried(PatientDemographic patient)
        {
            if (!patient.IsMarried.HasValue)
            {
                return(null);
            }

            BinarySplit side = MarriedSplit.Right;

            if (patient.IsMarried.Value)
            {
                side = MarriedSplit.Left;
            }

            side.Value++;
            return(side);
        }
Пример #3
0
        BinarySplit RecordVitalStatus(PatientDemographic patient)
        {
            if (!patient.IsDeceased.HasValue)
            {
                return(null);
            }

            BinarySplit side = VitalSplit.Left;

            if (patient.IsDeceased.Value)
            {
                side = VitalSplit.Right;
            }

            side.Value++;
            return(side);
        }
Пример #4
0
        void RecordGenderAgeAARP(PatientDemographic patient)
        {
            void aarp(int age)
            {
                if (age >= 65)
                {
                    AARPSplit.Left.Value++;
                }
                else
                {
                    AARPSplit.Right.Value++;
                }
            }

            BinarySplit gender = null;
            Action <AgeByGenderBucket> increment = (bucket) => { bucket.Others++; };

            if (IsFemale(patient))
            {
                gender    = GenderSplit.Left;
                increment = (bucket) => { bucket.Females++; };
            }
            else if (IsMale(patient))
            {
                gender    = GenderSplit.Right;
                increment = (bucket) => { bucket.Males++; };
            }

            var boxed = patient.Age;

            if (boxed.HasValue)
            {
                var age = boxed.Value;
                aarp(age);

                var bucket = AgeToBucket(age);
                increment(bucket);
            }

            if (gender != null)
            {
                gender.Value++;
            }
        }