@@ -1100,6 +1100,11 @@ def create_query_set(solr_query, sources, source, all_ui_attrs, image_source, Da
11001100 query_set .append (solr_query ['queries' ][attr ])
11011101 else :
11021102 attStr = solr_query ['queries' ][attr ].replace ('"' , '\\ "' )
1103+ # certain attributes values include quotes, ie Manufacturer = \"GE Healthcare\" which leads to 'subqueries'
1104+ # in filter strings with nested quotes, ie,
1105+ # _query_:"{!join to=StudyInstanceUID from=StudyInstanceUID}(+Manufacturer:(""GE Healthcare""))"))
1106+ # in this case extra backslashes are needed around the inner quotes
1107+ attStr = attStr .replace ('\\ \\ "' , '\\ \\ \\ "' )
11031108 attStr = '(_query_:"{!join to=' + default_join_field + ' from=' + default_join_field + '}' + attStr + '")'
11041109 query_set .append (attStr )
11051110 # If it's in another source for this program, we need to join on that source
@@ -1274,7 +1279,7 @@ def create_cart_query_string(query_list, partitions, join_with_child):
12741279 "parentid" : "PatientID" ,
12751280 "id" : "StudyInstanceUID" ,
12761281 "fields" : ["collection_id" , "PatientID" , "StudyInstanceUID" , 'StudyDescription' , 'Modality' , 'StudyDate' ,
1277- 'access' , 'crdc_series_uuid' , 'gcs_bucket' , 'aws_bucket' ],
1282+ 'access' , 'crdc_series_uuid' , 'gcs_bucket' , 'aws_bucket' , 'instance_size' , 'source_DOI' ],
12781283 "facetfields" : {
12791284 "SeriesInstanceUID" : "unique_series"
12801285 },
@@ -1308,7 +1313,7 @@ def create_cart_query_string(query_list, partitions, join_with_child):
13081313 "id" : "SeriesInstanceUID" ,
13091314 "fields" : [
13101315 "collection_id" , "PatientID" , "StudyInstanceUID" , 'SeriesInstanceUID' , 'SeriesNumber' , 'SeriesDescription' ,
1311- 'aws_bucket' , 'gcs_bucket' , 'Modality' , 'BodyPartExamined' , 'access' , 'crdc_series_uuid' , 'SOPInstanceUID '
1316+ 'aws_bucket' , 'gcs_bucket' , 'Modality' , 'BodyPartExamined' , 'access' , 'crdc_series_uuid' , 'instance_size' , 'source_DOI '
13121317 ],
13131318 "facets" : {
13141319 "per_id" : {
@@ -1700,8 +1705,12 @@ def get_table_data_with_cart_data(tabletype, sortarg, sortdir, current_filters,
17001705 with_filter = False
17011706 if (cart_query_str_all is not None ) and (len (cart_query_str_all ) > 0 ):
17021707 with_cart = True
1708+
1709+ # ok this condition assumes every collection_id sent is valid. Correct for normal workflow from webapp
17031710 if (tabletype == "collections" ):
17041711 sorted_ids = current_filters ["collection_id" ]
1712+ #also needed
1713+ num_found = len (sorted_ids )
17051714 elif ("facetfields" in table_data ) and (sortarg in table_data ["facetfields" ]):
17061715 # when sorting by a 'facet' field (# of cases, # of studies etc.), we need to find the set of ids selected from
17071716 # this field by the limit, offset params in a preliminary solr call, then add that set as a filter to limit the
@@ -2286,7 +2295,7 @@ def get_cart_data_serieslvl(filtergrp_list, partitions, field_list, limit, offse
22862295 solr_query = build_solr_query (
22872296 copy .deepcopy (filtergrp ),
22882297 with_tags_for_ex = False ,
2289- search_child_records_by = None
2298+ search_child_records_by = None , solr_default_op = 'AND'
22902299 )
22912300 query_set_for_filt = create_query_set (solr_query , aux_sources , image_source , all_ui_attrs , image_source ,
22922301 DataSetType , default_join_field = 'StudyInstanceUID' )
0 commit comments