From 46a1f212f2877e87800e14915473e1b4e59305f4 Mon Sep 17 00:00:00 2001 From: Steve Nyemba Date: Tue, 16 Feb 2021 11:49:24 -0600 Subject: [PATCH] bug fix with export, not all claims have procedures --- healthcareio/export/export.py | 3 ++- healthcareio/export/workers.py | 2 +- setup.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/healthcareio/export/export.py b/healthcareio/export/export.py index 09e58c1..15d2196 100644 --- a/healthcareio/export/export.py +++ b/healthcareio/export/export.py @@ -169,7 +169,8 @@ def init (**_args) : _name = "$"+".".join([table,field_name]) project[field_name] = {"$ifNull":[_name,""]} #{"$cond":[{"$eq":[_name,None]},"",_name]} project["_id"] = 1 - pipeline = [{"$match":{"procedures":{"$nin":[None,'']}}},{"$unwind":"$"+table},{"$project":project}] + # pipeline = [{"$match":{"procedures":{"$nin":[None,'']}}},{"$unwind":"$"+table},{"$project":project}] + pipeline = [{"$unwind":"$"+table},{"$project":project}] r += [{"table":table,"mongo":{"aggregate":TABLE_NAME,"cursor":{},"pipeline":pipeline,"allowDiskUse":True},"sql":create(table=table,key='claim_id',fields=fields)}] return r diff --git a/healthcareio/export/workers.py b/healthcareio/export/workers.py index 177fa31..177909c 100644 --- a/healthcareio/export/workers.py +++ b/healthcareio/export/workers.py @@ -179,7 +179,7 @@ class Reader(Worker): try: self.reader = transport.factory.instance(**self._info) ; self.rows = self.reader.read(mongo=self.pipeline) - + N = len(self.rows) / self.MAX_ROWS if len(self.rows) > self.MAX_ROWS else 1 N = int(N) # self.rows = rows diff --git a/setup.py b/setup.py index c89f103..32109d2 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ import sys def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() args = { - "name":"healthcareio","version":"1.6.2.14", + "name":"healthcareio","version":"1.6.2.16", "author":"Vanderbilt University Medical Center", "author_email":"steve.l.nyemba@vumc.org", "include_package_data":True,