From 0c1b427275b4e1b5e659212a62b371aa1b20ea9e Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Mon, 18 Nov 2024 13:35:14 +0300 Subject: [PATCH 1/3] Update Batch.sql --- .../Transformation/OptumExtended/Batch.sql | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql index 27b28c77..09834d79 100644 --- a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql +++ b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql @@ -1,3 +1,4 @@ SELECT DISTINCT {0} patid, patid FROM {sc}.MEMBER_CONTINUOUS_ENROLLMENT -order by 1 \ No newline at end of file +order by 1 +limit 1000000 \ No newline at end of file From 971292073eb4af6bf3ec848d57d058b19123c1d4 Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Mon, 18 Nov 2024 14:58:47 +0300 Subject: [PATCH 2/3] Update OptumExtendedPersonBuilder.cs --- .../OptumExtended/OptumExtendedPersonBuilder.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/OptumExtendedPersonBuilder.cs b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/OptumExtendedPersonBuilder.cs index 79505edc..60d8fd3f 100644 --- a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/OptumExtendedPersonBuilder.cs +++ b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/OptumExtendedPersonBuilder.cs @@ -451,6 +451,7 @@ public override IEnumerable 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"])) @@ -474,7 +475,7 @@ public override IEnumerable 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; @@ -1105,6 +1106,8 @@ public override void AddToChunk(string domain, IEnumerable entities) private long? GetValueAsConceptId(string value) { + if (string.IsNullOrEmpty(value)) return null; + var result = Vocabulary.Lookup(value, "Lab", DateTime.MinValue); return result[0].ConceptId; } From 5da9af8cf00976198e2fb89553c29e27c838d6be Mon Sep 17 00:00:00 2001 From: Anton Ivanov Date: Tue, 19 Nov 2024 12:28:49 +0300 Subject: [PATCH 3/3] Update Batch.sql --- .../Transformation/OptumExtended/Batch.sql | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql index 09834d79..27b28c77 100644 --- a/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql +++ b/sources/Framework/org.ohdsi.cdm.framework.etl/Transformation/OptumExtended/Batch.sql @@ -1,4 +1,3 @@ SELECT DISTINCT {0} patid, patid FROM {sc}.MEMBER_CONTINUOUS_ENROLLMENT -order by 1 -limit 1000000 \ No newline at end of file +order by 1 \ No newline at end of file