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); }
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); }
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); }
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++; } }