void RecordReligion(PatientDemographic patient) { if (string.IsNullOrEmpty(patient.Religion)) { return; } var religion = patient.Religion.ToLowerInvariant(); if (Religion.ContainsKey(religion)) { Religion[religion]++; return; } Religion.Add(religion, 1); }
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 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 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++; } }
bool IsMale(PatientDemographic patient) { return(maleSynonyms.Any(s => s.Equals(patient.Gender, StringComparison.InvariantCultureIgnoreCase))); }
void RecordNih(PatientDemographic patient) { if (string.IsNullOrEmpty(patient.Race)) { return; } if (!NihRaceEthnicity.EthnicBackgrounds.ContainsKey(patient.Race)) { NihRaceEthnicity.EthnicBackgrounds.Add(patient.Race, new NihRaceEthnicityBucket()); } var race = NihRaceEthnicity.EthnicBackgrounds[patient.Race]; if (patient.IsHispanic.HasValue) { if (patient.IsHispanic.Value) { if (IsFemale(patient)) { race.Hispanic.Females += 1; } else if (IsMale(patient)) { race.Hispanic.Males += 1; } else { race.Hispanic.Others += 1; } } else { if (IsFemale(patient)) { race.NotHispanic.Females += 1; } else if (IsMale(patient)) { race.NotHispanic.Males += 1; } else { race.NotHispanic.Others += 1; } } } else { if (IsFemale(patient)) { race.Unknown.Females += 1; } else if (IsMale(patient)) { race.Unknown.Males += 1; } else { race.Unknown.Others += 1; } } }
void RecordLanguageByHeritage(PatientDemographic patient) { LanguageByHeritage.Increment(patient.Race, patient.Language); }