Skip to content

Commit

Permalink
Merge pull request #136 from OHDSI/optum-clinformatics-1kk
Browse files Browse the repository at this point in the history
null value fixes
  • Loading branch information
bradanton authored Nov 19, 2024
2 parents 4d4c6ae + 5da9af8 commit 49ce1e2
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ public override IEnumerable<VisitDetail> BuildVisitDetails(VisitDetail[] visitDe
yield return visitDetail;
}


foreach (var patplanidGroup in mcVisits.Values.GroupBy(v => v.AdditionalFields["pat_planid"]))
{
foreach (var clmidGroup in patplanidGroup.GroupBy(v => v.AdditionalFields["clmid"]))
Expand All @@ -474,7 +475,7 @@ public override IEnumerable<VisitDetail> BuildVisitDetails(VisitDetail[] visitDe
foreach (var visitDetail in mcVisits.Values)
{
var confId = visitDetail.AdditionalFields["conf_id"];
if (inConfVisits.ContainsKey(confId))
if (confId != null && inConfVisits.ContainsKey(confId))
visitDetail.VisitDetailParentId = inConfVisits[confId];

yield return visitDetail;
Expand Down Expand Up @@ -1105,6 +1106,8 @@ public override void AddToChunk(string domain, IEnumerable<IEntity> entities)

private long? GetValueAsConceptId(string value)
{
if (string.IsNullOrEmpty(value)) return null;

var result = Vocabulary.Lookup(value, "Lab", DateTime.MinValue);
return result[0].ConceptId;
}
Expand Down

0 comments on commit 49ce1e2

Please sign in to comment.