diff --git a/README.md b/README.md index 61e7407..29f2203 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Enable HTTP(S) proxy by adding the environment to `**ENVIRONMENTS**`: ``` #### Export Chunking -The ODM export from REDCap is by default divided into exports for data of single patients to avoid connection issues and timeouts but can be changed by adding the argument: +By default, the ODM export from REDCap is divided into exports for data of single patients to avoid connection issues and timeouts. This can be changed by adding the argument: ```sh --odm.redcap.api.patientspercall=**PATIENTS_PER_CALL** ``` @@ -80,6 +80,11 @@ By default, all subjects within an ODM are processed. To process only subjects w ``` (Note: To reset the filtering, empty the folder `**CACHE_FOLDER**`.) +To filter subjects using REDCap's filter logic add the argument with `**FILTER_LOGIC**` holding a valid filter logic string: +```sh +--odm.redcap.api.filterlogic=**FILTER_LOGIC** +``` + ### DIS ```sh --odm.dis.rest.url=**ODM_DIS_REST_URL** diff --git a/docs/index.md b/docs/index.md index 5afc461..b23f835 100644 --- a/docs/index.md +++ b/docs/index.md @@ -68,7 +68,7 @@ Enable HTTP(S) proxy by adding the environment to `**ENVIRONMENTS**`: ``` #### Export Chunking -The ODM export from REDCap is by default divided into exports for data of single patients to avoid connection issues and timeouts but can be changed by adding the argument: +By default, the ODM export from REDCap is divided into exports for data of single patients to avoid connection issues and timeouts. This can be changed by adding the argument: ```sh --odm.redcap.api.patientspercall=**PATIENTS_PER_CALL** ``` @@ -80,6 +80,11 @@ By default, all subjects within an ODM are processed. To process only subjects w ``` (Note: To reset the filtering, empty the folder `**CACHE_FOLDER**`.) +To filter subjects using REDCap's filter logic add the argument with `**FILTER_LOGIC**` holding a valid filter logic string: +```sh +--odm.redcap.api.filterlogic=**FILTER_LOGIC** +``` + ### DIS ```sh --odm.dis.rest.url=**ODM_DIS_REST_URL** diff --git a/src/main/java/de/difuture/uds/odm2fhir/odm/processor/REDCapODMProcessor.java b/src/main/java/de/difuture/uds/odm2fhir/odm/processor/REDCapODMProcessor.java index ee03847..a0802d2 100644 --- a/src/main/java/de/difuture/uds/odm2fhir/odm/processor/REDCapODMProcessor.java +++ b/src/main/java/de/difuture/uds/odm2fhir/odm/processor/REDCapODMProcessor.java @@ -60,6 +60,9 @@ public class REDCapODMProcessor extends ODMProcessor { @Value("${odm.redcap.api.patientspercall:1}") private int patientspercall; + @Value("${odm.redcap.api.filterlogic:}") + private String filterlogic; + public Stream read() throws Exception { log.info("Reading ODM via REDCap API at '{}'", url); @@ -98,6 +101,7 @@ private Stream readPatientIDs() throws Exception { .addParameter("format", "csv") .addParameter("fields", "record_id") .addParameter("events", "basisdaten_arm_1,1_fall_arm_1,2_fall_arm_1,3_fall_arm_1") + .addParameter("filterLogic", filterlogic) .build(); return readLines(HTTP_CLIENT_BUILDER.build().execute(httpPost).getEntity().getContent(), UTF_8) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 89669c8..f44d0e7 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -9,6 +9,7 @@ odm: # url: http://redcap/api/ # token: 12345ABCDE67890ABCDE12345ABCDEF0 # patientspercall: 1 +# filterlogic: "[record_id] <> 0" # key: # file.path: /some/path/client_certificate.p12 # password: change-password