Explorar o código

bug fix: export function & filters

Steve Nyemba %!s(int64=4) %!d(string=hai) anos
pai
achega
9b00473ba4
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      healthcareio/export/export.py

+ 1 - 1
healthcareio/export/export.py

@@ -170,7 +170,7 @@ def init (**_args) :
             project[field_name] = {"$ifNull":[_name,""]} #{"$cond":[{"$eq":[_name,None]},"",_name]}
         project["_id"] = 1
         # pipeline = [{"$match":{"procedures":{"$nin":[None,'']}}},{"$unwind":"$"+table},{"$project":project}]
-        pipeline = [{"$unwind":"$"+table},{"$project":project}]
+        pipeline = [{"$match": {table: {"$nin": [None, ""]}}},{"$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