Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Feature relative study start #2

Merged
merged 24 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d3cd937
MORE2-2 extend API to new RelativeEvents
Oct 27, 2023
84d9df6
MORE2-3 extend API studies and groups to duration
Nov 8, 2023
06ed71b
MORE2-3 add duration to study and study group
Nov 9, 2023
ba02d88
Merge branch 'MORE-Platform:main' into main
tkurz Nov 9, 2023
14121d2
Merge branch 'MORE2-Relative_Study_Start' into MORE2-3-Extend_Study_a…
Nov 9, 2023
2662175
Enable manual deployment
Nov 9, 2023
657f027
Merge pull request #1 from redlink-gmbh/MORE2-3-Extend_Study_and_grou…
tkurz Nov 9, 2023
db13d1f
MORE2-3 fix NPE in duration transformer
Nov 9, 2023
c098553
MORE2-3 fix 2nd NPE in duration transformer
Nov 9, 2023
f20cc3a
Merge branch 'fork-main' into MORE2-Relative_Study_Start
Nov 9, 2023
0eea40c
MORE2 add start property to participants table
Nov 14, 2023
9b16a45
Enable build on push for action testing
tkurz Nov 16, 2023
4bae8ad
Revert changes for testing
tkurz Nov 16, 2023
6a313cb
MORE2 store duration for study groups
Nov 17, 2023
5c4319c
Merge remote-tracking branch 'fork/MORE2-Relative_Study_Start' into M…
Nov 17, 2023
5a43234
TT-11 Add Calendar export option to study manager frontend
Nov 21, 2023
91df528
TT-4 set participant status to locked when duration is done
Nov 21, 2023
65690b1
Fork Mgmt: revert changes in github actions and add docker img parameter
Nov 22, 2023
6a13b45
Merge branch 'forkmain' into FEATURE-Relative_Study_Start
Nov 22, 2023
203b804
Merge branch 'forkmain' into FEATURE-Relative_Study_Start
Nov 24, 2023
6db5c8c
TT-108: Extend StudyManager API with Participant Start (readonly)
iaigner Dec 21, 2023
d465c4a
TT-108: update participant with participant start, fix errors
iaigner Dec 21, 2023
6ed3b4c
#TT-108 set start in participant transformer
Dec 21, 2023
790286f
Merge pull request #1 from redlink-gmbh/TT-108-smb-smf-show-participa…
iaigner Dec 21, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/compile-test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Test and Compile
on:
workflow_dispatch:
inputs:
dockerTag:
description: If set, docker img is built and tagged accordingly
required: false
push:

jobs:
Expand Down Expand Up @@ -37,7 +41,7 @@ jobs:
Build-and-Deploy:
name: "Build and Push Docker Image"
runs-on: ubuntu-latest
if: github.ref_name == 'main'
if: github.ref_name == 'main' || github.event.inputs.dockerTag != ''
needs:
- Compile-and-Test
steps:
Expand All @@ -48,15 +52,17 @@ jobs:
distribution: 'temurin'
java-version: 17
- name: Build JIB container and publish to GitHub Packages
run: ./mvnw -B -U
run:
TAG=${{github.event.inputs.dockerTag}} &&
./mvnw -B -U
--no-transfer-progress
clean deploy
-Drevision=${{github.run_number}}
-Dchangelist=
-Dsha1=.${GITHUB_SHA:0:7}
-Dquick
-Ddocker.namespace=${DOCKER_NAMESPACE,,}
-Djib.to.tags=latest
-Djib.to.tags=${TAG:=latest}
-Djib.to.auth.username=${{ github.actor }}
-Djib.to.auth.password=${{ secrets.GITHUB_TOKEN }}
env:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ protected SecurityFilterChain filterChain(HttpSecurity http,
//TODO specific handling of temporary sidecar
.requestMatchers("/api/v1/components/observation/lime-survey-observation/end.html").permitAll()
.requestMatchers("/api/v1/studies/*/export/studydata/*").permitAll()
.requestMatchers("/api/v1/studies/*/calendar.ics").permitAll()
.requestMatchers("/api/v1/**").authenticated()
.requestMatchers("/kibana/**").authenticated()
.requestMatchers("/login/init").authenticated()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package io.redlink.more.studymanager.controller.studymanager;

import io.redlink.more.studymanager.api.v1.webservices.CalendarApi;
import io.redlink.more.studymanager.properties.GatewayProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/api/v1", produces = MediaType.APPLICATION_JSON_VALUE)
@EnableConfigurationProperties(GatewayProperties.class)
public class CalendarApiV1Controller implements CalendarApi {

private final GatewayProperties properties;

public CalendarApiV1Controller(GatewayProperties properties) {
this.properties = properties;
}

@Override
public ResponseEntity<String> getStudyCalendar(Long studyId) {
return ResponseEntity
.status(301)
.header("Location", properties.getBaseUrl() + "/api/v1/calendar/studies/" + studyId + "/calendar.ics")
.build();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
*/
package io.redlink.more.studymanager.model;

import io.redlink.more.studymanager.model.scheduler.Event;
import io.redlink.more.studymanager.model.scheduler.ScheduleEvent;

import java.time.Instant;

public class Intervention {
Expand All @@ -16,7 +19,7 @@ public class Intervention {
private String title;
private String purpose;
private Integer studyGroupId;
private Event schedule;
private ScheduleEvent schedule;
private Instant created;
private Instant modified;

Expand Down Expand Up @@ -65,11 +68,11 @@ public Intervention setStudyGroupId(Integer studyGroupId) {
return this;
}

public Event getSchedule() {
public ScheduleEvent getSchedule() {
return schedule;
}

public Intervention setSchedule(Event schedule) {
public Intervention setSchedule(ScheduleEvent schedule) {
this.schedule = schedule;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
package io.redlink.more.studymanager.model;

import io.redlink.more.studymanager.core.properties.ObservationProperties;
import io.redlink.more.studymanager.model.scheduler.ScheduleEvent;

import java.time.Instant;

Expand All @@ -21,7 +22,7 @@ public class Observation {
private String type;
private Integer studyGroupId;
private ObservationProperties properties;
private Event schedule;
private ScheduleEvent schedule;
private Instant created;
private Instant modified;
private Boolean hidden;
Expand Down Expand Up @@ -99,11 +100,11 @@ public Observation setProperties(ObservationProperties properties) {
return this;
}

public Event getSchedule() {
public ScheduleEvent getSchedule() {
return schedule;
}

public Observation setSchedule(Event schedule) {
public Observation setSchedule(ScheduleEvent schedule) {
this.schedule = schedule;
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class Participant {
private Status status;
private Instant created;
private Instant modified;
private Instant start;

private String registrationToken;

Expand Down Expand Up @@ -51,6 +52,15 @@ public Participant setStatus(Status status) {
return this;
}

public Participant setStart( Instant start ) {
this.start = start;
return this;
}

public Instant getStart() {
return start;
}

public Participant setStudyId(Long studyId) {
this.studyId = studyId;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
*/
package io.redlink.more.studymanager.model;

import io.redlink.more.studymanager.model.scheduler.Duration;

import java.time.Instant;
import java.time.LocalDate;
import java.util.Set;
Expand All @@ -19,6 +21,7 @@ public class Study {
private String participantInfo;
private String consentInfo;
private String finishText;
private Duration duration;
private Status studyState;
private LocalDate startDate;
private LocalDate endDate;
Expand Down Expand Up @@ -100,6 +103,15 @@ public Study setFinishText(String finishText) {
return this;
}

public Duration getDuration() {
return duration;
}

public Study setDuration(Duration duration) {
this.duration = duration;
return this;
}

public Status getStudyState() {
return studyState;
}
Expand Down Expand Up @@ -192,6 +204,7 @@ public String toString() {
", endDate=" + endDate +
", plannedStartDate=" + plannedStartDate +
", plannedEndDate=" + plannedEndDate +
", duration=" + duration +
", created=" + created +
", modified=" + modified +
", institute=" + contact.getInstitute() +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,16 @@
*/
package io.redlink.more.studymanager.model;

import io.redlink.more.studymanager.model.scheduler.Duration;

import java.time.Instant;

public class StudyGroup {
private Long studyId;
private Integer studyGroupId;
private String title;
private String purpose;
private Duration duration;
private Instant created;
private Instant modified;

Expand Down Expand Up @@ -54,6 +57,15 @@ public StudyGroup setPurpose(String purpose) {
return this;
}

public Duration getDuration() {
return duration;
}

public StudyGroup setDuration(Duration duration) {
this.duration = duration;
return this;
}

public Instant getCreated() {
return created;
}
Expand Down
Loading
Loading