File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
apps/backend/src/system/export Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -49,16 +49,14 @@ export class ExportService {
49
49
"questionnaire.remark as questionnaire_remark" ,
50
50
"participant.id as participant_id" ,
51
51
"participant.birthday" ,
52
- "study.id as study_id" ,
53
- "study.title as study_title" ,
54
52
] )
53
+ . distinct ( )
55
54
. join ( "carer" , "carer" )
56
55
. join ( "entryLanguages" , "entryLanguages" )
57
56
. join ( "entryLanguages.language" , "language" )
58
57
. join ( "entry.questionnaire" , "questionnaire" )
59
- . join ( "questionnaire.study" , "study" )
60
58
. join ( "questionnaire.participant" , "participant" )
61
- . where ( { questionnaire : { study : studyId } } )
59
+ . where ( { questionnaire : { participant : { studies : { $some : { id : studyId } } } } } )
62
60
. getFormattedQuery ( ) ;
63
61
64
62
const copyCommand = `COPY (${ query } ) TO STDOUT WITH CSV HEADER DELIMITER ',';` ;
You can’t perform that action at this time.
0 commit comments