@@ -262,6 +262,7 @@ async def applet_activity_answers_list(
262262 query_params : QueryParams = Depends (parse_query_params (AppletSubmissionsFilter )),
263263 answer_session = Depends (get_answer_session ),
264264) -> ResponseMulti [AppletActivityAnswerPublic ]:
265+ target_subject_id = query_params .filters .get ("target_subject_id" )
265266 try :
266267 filters = query_params .filters
267268 await AppletService (session , user .id ).exist_by_id (applet_id )
@@ -283,6 +284,7 @@ async def applet_activity_answers_list(
283284 user_id = user .id ,
284285 event_action = EventAction .APPLET_ANSWER_VIEW ,
285286 curious_applet_id = [applet_id ],
287+ curious_subject_id = [target_subject_id ] if target_subject_id else None ,
286288 ** http_audit_fields (request , e ),
287289 )
288290 )
@@ -293,6 +295,7 @@ async def applet_activity_answers_list(
293295 user_id = user .id ,
294296 event_action = EventAction .APPLET_ANSWER_VIEW ,
295297 curious_applet_id = [applet_id ],
298+ curious_subject_id = [target_subject_id ] if target_subject_id else None ,
296299 curious_answer_id = [a .answer_id for a in answers if a .answer_id ] or None ,
297300 ** http_audit_fields (request ),
298301 )
@@ -309,6 +312,7 @@ async def applet_flow_submissions_list(
309312 session = Depends (get_session ),
310313 answer_session = Depends (get_answer_session ),
311314) -> PublicFlowSubmissionsResponse :
315+ target_subject_id = query_params .filters .get ("target_subject_id" )
312316 try :
313317 await AppletService (session , user .id ).exist_by_id (applet_id )
314318 await CheckAccessService (session , user .id ).check_answer_review_access (applet_id )
@@ -328,6 +332,7 @@ async def applet_flow_submissions_list(
328332 user_id = user .id ,
329333 event_action = EventAction .APPLET_ANSWER_VIEW ,
330334 curious_applet_id = [applet_id ],
335+ curious_subject_id = [target_subject_id ] if target_subject_id else None ,
331336 ** http_audit_fields (request , e ),
332337 )
333338 )
@@ -338,6 +343,7 @@ async def applet_flow_submissions_list(
338343 user_id = user .id ,
339344 event_action = EventAction .APPLET_ANSWER_VIEW ,
340345 curious_applet_id = [applet_id ],
346+ curious_subject_id = [target_subject_id ] if target_subject_id else None ,
341347 curious_submit_id = [s .submit_id for s in submissions .submissions ] or None ,
342348 curious_answer_id = [a .id for s in submissions .submissions for a in s .answers ] or None ,
343349 ** http_audit_fields (request ),
@@ -371,7 +377,6 @@ async def summary_activity_latest_report_retrieve(
371377 user_id = user .id ,
372378 event_action = EventAction .APPLET_ANSWER_REPORT_DOWNLOAD ,
373379 curious_applet_id = [applet_id ],
374- curious_activity_id = [activity_id ],
375380 curious_subject_id = [subject_id ],
376381 ** http_audit_fields (request , e ),
377382 )
@@ -383,7 +388,6 @@ async def summary_activity_latest_report_retrieve(
383388 user_id = user .id ,
384389 event_action = EventAction .APPLET_ANSWER_REPORT_DOWNLOAD ,
385390 curious_applet_id = [applet_id ],
386- curious_activity_id = [activity_id ],
387391 curious_subject_id = [subject_id ],
388392 ** http_audit_fields (request ),
389393 )
@@ -424,7 +428,6 @@ async def summary_flow_latest_report_retrieve(
424428 user_id = user .id ,
425429 event_action = EventAction .APPLET_ANSWER_REPORT_DOWNLOAD ,
426430 curious_applet_id = [applet_id ],
427- curious_flow_id = [flow_id ],
428431 curious_subject_id = [subject_id ],
429432 ** http_audit_fields (request , e ),
430433 )
@@ -436,7 +439,6 @@ async def summary_flow_latest_report_retrieve(
436439 user_id = user .id ,
437440 event_action = EventAction .APPLET_ANSWER_REPORT_DOWNLOAD ,
438441 curious_applet_id = [applet_id ],
439- curious_flow_id = [flow_id ],
440442 curious_subject_id = [subject_id ],
441443 ** http_audit_fields (request ),
442444 )
@@ -1341,8 +1343,6 @@ async def applet_ehr_answers_export(
13411343 event_action = EventAction .APPLET_ANSWER_EHR_DOWNLOAD ,
13421344 curious_applet_id = [applet_id ],
13431345 curious_subject_id = query_params .filters .get ("target_subject_ids" ),
1344- curious_activity_id = query_params .filters .get ("activity_ids" ),
1345- curious_flow_id = query_params .filters .get ("flow_ids" ),
13461346 ** http_audit_fields (request , e ),
13471347 )
13481348 )
@@ -1354,7 +1354,6 @@ async def applet_ehr_answers_export(
13541354 event_action = EventAction .APPLET_ANSWER_EHR_DOWNLOAD ,
13551355 curious_applet_id = [applet_id ],
13561356 curious_subject_id = list ({a .target_subject_id for a in ehr_answers }) or None ,
1357- curious_activity_id = list ({a .activity_id for a in ehr_answers }) or None ,
13581357 curious_submit_id = list ({a .submit_id for a in ehr_answers }) or None ,
13591358 ** http_audit_fields (request ),
13601359 )
@@ -1400,7 +1399,6 @@ async def applet_ehr_answers_export(
14001399 event_action = EventAction .APPLET_ANSWER_EHR_DOWNLOAD ,
14011400 curious_applet_id = [applet_id ],
14021401 curious_subject_id = list ({a .target_subject_id for a in ehr_answers }) or None ,
1403- curious_activity_id = list ({a .activity_id for a in ehr_answers }) or None ,
14041402 curious_submit_id = list ({a .submit_id for a in ehr_answers }) or None ,
14051403 event_outcome = EventOutcome .FAILURE ,
14061404 error_type = type (e ).__name__ ,
0 commit comments