Skip to content

Commit

Permalink
Merge pull request #72 from OHDSI/optum_ehr_obs_period_end_and_visit_…
Browse files Browse the repository at this point in the history
…concept_id_0_fix

Update OptumOncologyPersonBuilder.cs
  • Loading branch information
bradanton committed May 14, 2024
2 parents faa850d + 4655403 commit 671a030
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,9 @@ public override Attrition Build(ChunkData data, KeyMasterOffsetManager om)
{
visitOccurrence.Id = Offset.GetKeyOffset(visitOccurrence.PersonId).VisitOccurrenceId;

if (visitOccurrence.ConceptId == 0)
visitOccurrence.ConceptId = 9202;

if (!visitOccurrence.EndDate.HasValue)
visitOccurrence.EndDate = visitOccurrence.StartDate;

Expand Down Expand Up @@ -970,6 +973,15 @@ public override Attrition Build(ChunkData data, KeyMasterOffsetManager om)
return Attrition.InvalidObservationTime;
}

// there are a small number of patients who have weird observation_period_end_date between 2025 - 6011.
// These should be truncated to the current year.
if (observationPeriodsFinal[0].EndDate.Value.Year > DateTime.Now.Year)
{
observationPeriodsFinal[0].EndDate = new DateTime(DateTime.Now.Year,
observationPeriodsFinal[0].EndDate.Value.Month,
observationPeriodsFinal[0].EndDate.Value.Day);
}

// set corresponding ProviderIds
SetProviderIds(drugExposures);
SetProviderIds(conditionOccurrences);
Expand Down

0 comments on commit 671a030

Please sign in to comment.