From 6a9672074ce53c2da19395dd9c504ef3458ea466 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Brandes Date: Thu, 30 Apr 2020 14:22:34 +0200 Subject: [PATCH 01/17] Implement basic exposure contact person backend functionality --- .../imis/api/ExposureContactController.java | 68 +++++++++++++++++++ .../imis/api/dto/ExposureContactDTO.java | 41 +++++++++++ .../imis/config/SpringSecurityConfig.java | 1 + .../imis/domain/ExposureContact.java | 31 +++++++++ .../de/coronavirus/imis/domain/Patient.java | 26 +++++++ .../imis/mapper/ExposureContactMapper.java | 21 ++++++ .../imis/mapper/PatientMapper.java | 11 +++ .../ExposureContactRepository.java | 15 ++++ 8 files changed, 214 insertions(+) create mode 100644 server/src/main/java/de/coronavirus/imis/api/ExposureContactController.java create mode 100644 server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java create mode 100644 server/src/main/java/de/coronavirus/imis/domain/ExposureContact.java create mode 100644 server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java create mode 100644 server/src/main/java/de/coronavirus/imis/repositories/ExposureContactRepository.java diff --git a/server/src/main/java/de/coronavirus/imis/api/ExposureContactController.java b/server/src/main/java/de/coronavirus/imis/api/ExposureContactController.java new file mode 100644 index 00000000..47a0466d --- /dev/null +++ b/server/src/main/java/de/coronavirus/imis/api/ExposureContactController.java @@ -0,0 +1,68 @@ +package de.coronavirus.imis.api; + +import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; + +import lombok.RequiredArgsConstructor; + +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import de.coronavirus.imis.api.dto.ExposureContactDTO; +import de.coronavirus.imis.domain.ExposureContact; +import de.coronavirus.imis.mapper.ExposureContactMapper; +import de.coronavirus.imis.repositories.ExposureContactRepository; + +@RestController +@RequestMapping("/api/exposure-contacts") +@RequiredArgsConstructor +public class ExposureContactController { + private final ExposureContactRepository exposureContactRepository; + private final ExposureContactMapper exposureContactMapper; + + @PostMapping + public ExposureContactDTO.FromServer createExposureContact(@RequestBody ExposureContactDTO.ToServer dto) { + return exposureContactMapper.toExposureContactDTO( + exposureContactRepository.saveAndFlush( + exposureContactMapper.toExposureContact(dto) + ) + ); + } + + @PutMapping + public ExposureContactDTO.FromServer updateExposureContact(@RequestBody ExposureContactDTO.ToServer contact) { + return exposureContactMapper.toExposureContactDTO( + exposureContactRepository.saveAndFlush( + exposureContactMapper.toExposureContact(contact) + ) + ); + } + + @GetMapping("/{id}") + public ExposureContactDTO.FromServer getExposureContact(@PathVariable("id") long id) { + return exposureContactMapper.toExposureContactDTO(exposureContactRepository.findById(id).orElse(null)); + } + + @GetMapping("/by-source/{id}") + public List getExposureContactsForPatient(@PathVariable("id") String patientId) { + return exposureContactRepository.findBySourceId(patientId) + .stream().map(contact -> exposureContactMapper.toExposureContactDTO(contact)) + .collect(Collectors.toList()); + } + @GetMapping("/by-contact/{id}") + public ExposureContactDTO.FromServer getExposureSourceContactForPatient(@PathVariable("id") String patientId) { + return exposureContactMapper.toExposureContactDTO(exposureContactRepository.findByContactId(patientId)); + } + + @DeleteMapping("/{id}") + public void removeExposureContact(@PathVariable("id") long id) { + this.exposureContactRepository.deleteById(id); + } +} diff --git a/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java new file mode 100644 index 00000000..1930bd7f --- /dev/null +++ b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java @@ -0,0 +1,41 @@ +package de.coronavirus.imis.api.dto; + +import java.time.LocalDate; + +import com.fasterxml.jackson.annotation.JsonUnwrapped; +import io.swagger.annotations.ApiModel; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +import de.coronavirus.imis.domain.Patient; + +public abstract class ExposureContactDTO { + @Data + public static class Common { + private long id; + private String context; + private String dateOfContact; + private String comment; + } + + @ApiModel("ExposureContactToServer") + @Data + public static class ToServer { + private String source; + private String contact; + + @JsonUnwrapped + private ExposureContactDTO.Common common; + } + + @ApiModel("ExposureContactFromServer") + @Data + public static class FromServer { + private Patient.IdentityView source; + private Patient.IdentityView contact; + + @JsonUnwrapped + private ExposureContactDTO.Common common; + } +} diff --git a/server/src/main/java/de/coronavirus/imis/config/SpringSecurityConfig.java b/server/src/main/java/de/coronavirus/imis/config/SpringSecurityConfig.java index 738c1658..24c14db0 100644 --- a/server/src/main/java/de/coronavirus/imis/config/SpringSecurityConfig.java +++ b/server/src/main/java/de/coronavirus/imis/config/SpringSecurityConfig.java @@ -62,6 +62,7 @@ protected void configure(HttpSecurity http) throws Exception { .antMatchers(OPTIONS, "/**").permitAll() .antMatchers("/api/auth").permitAll() .antMatchers(API_PREFIX + "/patients").hasAnyRole(DEPARTMENT_OF_HEALTH, CLINIC, DOCTORS_OFFICE, TEST_SITE) + .antMatchers(API_PREFIX + "/exposure-contacts/**").permitAll() .antMatchers(API_PREFIX + "/doctor/*").hasAnyRole(DEPARTMENT_OF_HEALTH, DOCTORS_OFFICE, CLINIC) .mvcMatchers(POST, API_PREFIX + "/labtest").hasAnyRole(DEPARTMENT_OF_HEALTH, DOCTORS_OFFICE, CLINIC, TEST_SITE) .antMatchers(API_PREFIX + "/labtest/patient/*").hasAnyRole(DEPARTMENT_OF_HEALTH, DOCTORS_OFFICE, CLINIC, TEST_SITE) diff --git a/server/src/main/java/de/coronavirus/imis/domain/ExposureContact.java b/server/src/main/java/de/coronavirus/imis/domain/ExposureContact.java new file mode 100644 index 00000000..5d175721 --- /dev/null +++ b/server/src/main/java/de/coronavirus/imis/domain/ExposureContact.java @@ -0,0 +1,31 @@ +package de.coronavirus.imis.domain; + +import javax.persistence.*; +import java.time.LocalDate; + +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import de.coronavirus.imis.mapper.PatientMapper; +import de.coronavirus.imis.repositories.PatientRepository; + +@Entity +@Component +@Data +@Accessors(chain = true) +public class ExposureContact { + + @Id + @GeneratedValue + private long id; + + @ManyToOne + private Patient source; + @OneToOne + private Patient contact; + private String context; // e.g. contact in a medical facility + private LocalDate dateOfContact; + private String comment; +} diff --git a/server/src/main/java/de/coronavirus/imis/domain/Patient.java b/server/src/main/java/de/coronavirus/imis/domain/Patient.java index a8c2e69d..17d31a63 100644 --- a/server/src/main/java/de/coronavirus/imis/domain/Patient.java +++ b/server/src/main/java/de/coronavirus/imis/domain/Patient.java @@ -1,10 +1,15 @@ package de.coronavirus.imis.domain; +import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIdentityInfo; import com.fasterxml.jackson.annotation.ObjectIdGenerators; +import io.swagger.annotations.ApiModel; +import lombok.Builder; import lombok.Getter; +import lombok.AllArgsConstructor; import lombok.NoArgsConstructor; +import lombok.RequiredArgsConstructor; import lombok.Setter; import lombok.experimental.Accessors; @@ -12,8 +17,12 @@ import javax.validation.constraints.NotNull; import java.time.LocalDate; import java.time.OffsetDateTime; +import java.util.Collections; import java.util.List; +import de.coronavirus.imis.domain.ExposureContact; +import de.coronavirus.imis.repositories.ExposureContactRepository; + @Entity @Getter @@ -61,6 +70,14 @@ public class Patient { @Convert(converter = StringListConverter.class) private List symptoms; private Boolean coronaContacts; + + @JsonIgnore + @OneToOne(mappedBy = "contact") + private ExposureContact exposureSourceContact; + @JsonIgnore + @OneToMany(mappedBy = "source") + private List exposureContacts; + @Convert(converter = StringListConverter.class) private List riskAreas; private Boolean weakenedImmuneSystem; @@ -77,4 +94,13 @@ public class Patient { private Boolean onIntensiveCareUnit; private LocalDate quarantineUntil; + + @ApiModel("PatientIdentity") + @Getter + @Setter + public static class IdentityView { + private String id; + private String firstName; + private String lastName; + } } diff --git a/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java b/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java new file mode 100644 index 00000000..83fcb1a5 --- /dev/null +++ b/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java @@ -0,0 +1,21 @@ +package de.coronavirus.imis.mapper; + +import de.coronavirus.imis.api.dto.ExposureContactDTO; +import de.coronavirus.imis.domain.ExposureContact; +import de.coronavirus.imis.mapper.PatientMapper; +import org.mapstruct.Mapper; +import org.mapstruct.Mapping; +import org.mapstruct.MappingTarget; + +@Mapper(uses = PatientMapper.class) +public abstract class ExposureContactMapper { + + @Mapping(target = "id", source = "common.id") + @Mapping(target = "context", source = "common.context") + @Mapping(target = "dateOfContact", source = "common.dateOfContact") + @Mapping(target = "comment", source = "common.comment") + public abstract ExposureContact toExposureContact(ExposureContactDTO.ToServer dto); + + @Mapping(target = "common", source = ".") + public abstract ExposureContactDTO.FromServer toExposureContactDTO(ExposureContact contact); +} diff --git a/server/src/main/java/de/coronavirus/imis/mapper/PatientMapper.java b/server/src/main/java/de/coronavirus/imis/mapper/PatientMapper.java index 67a1b926..593287ee 100644 --- a/server/src/main/java/de/coronavirus/imis/mapper/PatientMapper.java +++ b/server/src/main/java/de/coronavirus/imis/mapper/PatientMapper.java @@ -2,8 +2,10 @@ import de.coronavirus.imis.api.dto.CreatePatientDTO; import de.coronavirus.imis.domain.Patient; +import de.coronavirus.imis.repositories.PatientRepository; import org.mapstruct.Mapper; import org.mapstruct.Mapping; +import org.springframework.beans.factory.annotation.Autowired; import java.time.LocalDate; import java.time.OffsetDateTime; @@ -15,6 +17,9 @@ public abstract class PatientMapper { public static final String DATE_FORMAT = "yyyy-MM-dd"; public static final DateTimeFormatter DATE_FORMATTER = DateTimeFormatter.ofPattern(DATE_FORMAT); + @Autowired + private PatientRepository patientRepository; + @Mapping(target = "patientStatus", defaultValue = "REGISTERED") @Mapping(target = "creationTimestamp", expression = "java( OffsetDateTime.now() )") @Mapping(target = "dateOfBirth", dateFormat = DATE_FORMAT) @@ -26,6 +31,12 @@ public abstract class PatientMapper { @Mapping(target = "events", ignore = true) public abstract Patient toPatient(CreatePatientDTO createPatient); + public Patient toPatient(String id) { + return id != null ? patientRepository.findById(id).orElse(null) : null; + } + + public abstract Patient.IdentityView toIdentityView(Patient patient); + public LocalDate parseDate(String localDateString) { LocalDate localDate = null; if (localDateString != null && !localDateString.isBlank()) { diff --git a/server/src/main/java/de/coronavirus/imis/repositories/ExposureContactRepository.java b/server/src/main/java/de/coronavirus/imis/repositories/ExposureContactRepository.java new file mode 100644 index 00000000..736aee49 --- /dev/null +++ b/server/src/main/java/de/coronavirus/imis/repositories/ExposureContactRepository.java @@ -0,0 +1,15 @@ +package de.coronavirus.imis.repositories; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; + +import de.coronavirus.imis.domain.ExposureContact; + +public interface ExposureContactRepository extends JpaRepository { + + List findBySourceId(String patientId); + ExposureContact findByContactId(String patientId); +} From 40010884abd4c0d5f52b9b4be1bea2ccb62f6b89 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Brandes Date: Thu, 30 Apr 2020 17:11:26 +0200 Subject: [PATCH 02/17] Add infection and quarantine status to exposure contact's contact object --- .gitignore | 3 +++ .../imis/api/dto/ExposureContactDTO.java | 14 +++++++++++-- .../imis/mapper/ExposureContactMapper.java | 20 ++++++++++++++++++- 3 files changed, 34 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 6d75aeb7..e4de8bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ .idea .gradle .DS_Store +**/.project +**/.settings +/.classpath # CMake cmake-build-*/ diff --git a/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java index 1930bd7f..645d7d06 100644 --- a/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java +++ b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java @@ -32,10 +32,20 @@ public static class ToServer { @ApiModel("ExposureContactFromServer") @Data public static class FromServer { - private Patient.IdentityView source; - private Patient.IdentityView contact; + private ExposureContactDTO.ContactView source; + private ExposureContactDTO.ContactView contact; @JsonUnwrapped private ExposureContactDTO.Common common; } + + @ApiModel("ExposureContactContactView") + @Data + public static class ContactView { + private String id; + private String firstName; + private String lastName; + private boolean infected; + private boolean inQuarantine; + } } diff --git a/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java b/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java index 83fcb1a5..a50a8e70 100644 --- a/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java +++ b/server/src/main/java/de/coronavirus/imis/mapper/ExposureContactMapper.java @@ -1,16 +1,30 @@ package de.coronavirus.imis.mapper; +import java.time.LocalDate; + import de.coronavirus.imis.api.dto.ExposureContactDTO; +import de.coronavirus.imis.domain.EventType; import de.coronavirus.imis.domain.ExposureContact; +import de.coronavirus.imis.domain.Patient; import de.coronavirus.imis.mapper.PatientMapper; +import de.coronavirus.imis.repositories.PatientRepository; import org.mapstruct.Mapper; import org.mapstruct.Mapping; import org.mapstruct.MappingTarget; +import org.springframework.beans.factory.annotation.Autowired; -@Mapper(uses = PatientMapper.class) +@Mapper(imports = { + EventType.class, + LocalDate.class +}) public abstract class ExposureContactMapper { + @Autowired + protected PatientRepository patientRepo; + @Mapping(target = "id", source = "common.id") + @Mapping(target = "source", expression = "java( patientRepo.findById(dto.getSource()).orElse(null) )") + @Mapping(target = "contact", expression = "java( patientRepo.findById(dto.getContact()).orElse(null) )") @Mapping(target = "context", source = "common.context") @Mapping(target = "dateOfContact", source = "common.dateOfContact") @Mapping(target = "comment", source = "common.comment") @@ -18,4 +32,8 @@ public abstract class ExposureContactMapper { @Mapping(target = "common", source = ".") public abstract ExposureContactDTO.FromServer toExposureContactDTO(ExposureContact contact); + + @Mapping(target = "infected", expression = "java( patient.getPatientStatus() == EventType.TEST_FINISHED_POSITIVE )") + @Mapping(target = "inQuarantine", expression = "java( patient.getQuarantineUntil() != null && patient.getQuarantineUntil().isAfter(LocalDate.now()) )") + public abstract ExposureContactDTO.ContactView toContactView(Patient patient); } From afa50afd080cec378018cac05322d18a4333dc88 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Brandes Date: Thu, 30 Apr 2020 22:28:15 +0200 Subject: [PATCH 03/17] Support creation of new Patient records alongside exposure contact creation --- .../imis/api/dto/ExposureContactDTO.java | 57 ++++++++++++++++--- .../imis/domain/StringListConverter.java | 6 +- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java index 645d7d06..2f48c080 100644 --- a/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java +++ b/server/src/main/java/de/coronavirus/imis/api/dto/ExposureContactDTO.java @@ -3,13 +3,23 @@ import java.time.LocalDate; import com.fasterxml.jackson.annotation.JsonUnwrapped; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.util.StdConverter; +import com.fasterxml.jackson.core.JsonProcessingException; import io.swagger.annotations.ApiModel; import lombok.Data; import lombok.Getter; import lombok.Setter; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import de.coronavirus.imis.api.dto.CreatePatientDTO; import de.coronavirus.imis.domain.Patient; +import de.coronavirus.imis.services.PatientService; +@Component public abstract class ExposureContactDTO { @Data public static class Common { @@ -23,6 +33,7 @@ public static class Common { @Data public static class ToServer { private String source; + @JsonDeserialize(converter = ExOrNewContactConverter.class) private String contact; @JsonUnwrapped @@ -39,13 +50,43 @@ public static class FromServer { private ExposureContactDTO.Common common; } - @ApiModel("ExposureContactContactView") - @Data + @ApiModel("ExposureContactContactView") + @Data public static class ContactView { - private String id; - private String firstName; - private String lastName; - private boolean infected; - private boolean inQuarantine; - } + private String id; + private String firstName; + private String lastName; + private boolean infected; + private boolean inQuarantine; + } + + + /** + * Allow exposure contacts to be specified either by ID to + * an existing patient, or data for a new Patient instance + */ + @Component + public static class ExOrNewContactConverter + extends StdConverter { + + @Autowired + private PatientService patientService; + + private ObjectMapper jsonMapper = new ObjectMapper(); + + public String convert(JsonNode in) { + if (in == null) { + return null; + } else if (in.isTextual()) { + return in.textValue(); + } else { + try { + CreatePatientDTO newPatientDto = this.jsonMapper.treeToValue(in, CreatePatientDTO.class); + return this.patientService.addPatient(newPatientDto, true).getId(); + } catch (JsonProcessingException e) { + throw new RuntimeException(e); + } + } + } + } } diff --git a/server/src/main/java/de/coronavirus/imis/domain/StringListConverter.java b/server/src/main/java/de/coronavirus/imis/domain/StringListConverter.java index 28d82fef..aa7da6e6 100644 --- a/server/src/main/java/de/coronavirus/imis/domain/StringListConverter.java +++ b/server/src/main/java/de/coronavirus/imis/domain/StringListConverter.java @@ -11,11 +11,11 @@ public class StringListConverter implements AttributeConverter, Str @Override public String convertToDatabaseColumn(List stringList) { - return String.join(SPLIT_CHAR, stringList); + return stringList != null ? String.join(SPLIT_CHAR, stringList) : null; } @Override public List convertToEntityAttribute(String string) { - return Arrays.asList(string.split(SPLIT_CHAR)); + return string != null ? Arrays.asList(string.split(SPLIT_CHAR)) : null; } -} \ No newline at end of file +} From 4078524a8d767af478def6f7c4900f5b8afc90f9 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Brandes Date: Fri, 1 May 2020 13:46:11 +0200 Subject: [PATCH 04/17] Update SwaggerApi.ts --- client/src/api/SwaggerApi.ts | 98 ++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/client/src/api/SwaggerApi.ts b/client/src/api/SwaggerApi.ts index a93e10bc..fff30ccd 100644 --- a/client/src/api/SwaggerApi.ts +++ b/client/src/api/SwaggerApi.ts @@ -116,6 +116,32 @@ export interface Doctor { zip?: string; } +export interface ExposureContactContactView { + firstName?: string; + id?: string; + inQuarantine?: boolean; + infected?: boolean; + lastName?: string; +} + +export interface ExposureContactFromServer { + comment?: string; + contact?: ExposureContactContactView; + context?: string; + dateOfContact?: string; + id?: number; + source?: ExposureContactContactView; +} + +export interface ExposureContactToServer { + comment?: string; + contact?: string; + context?: string; + dateOfContact?: string; + id?: number; + source?: string; +} + export interface GrantedAuthority { authority?: string; } @@ -686,6 +712,78 @@ export class Api extends HttpClient { addScheduledEventUsingPost: (dto: RequestLabTestDTO, params?: RequestParams) => this.request(`/api/doctor/create_appointment`, "POST", params, dto, true), + /** + * @tags exposure-contact-controller + * @name createExposureContactUsingPOST + * @summary createExposureContact + * @request POST:/api/exposure-contacts + * @secure + */ + createExposureContactUsingPost: (dto: ExposureContactToServer, params?: RequestParams) => + this.request(`/api/exposure-contacts`, "POST", params, dto, true), + + /** + * @tags exposure-contact-controller + * @name updateExposureContactUsingPUT + * @summary updateExposureContact + * @request PUT:/api/exposure-contacts + * @secure + */ + updateExposureContactUsingPut: (contact: ExposureContactToServer, params?: RequestParams) => + this.request(`/api/exposure-contacts`, "PUT", params, contact, true), + + /** + * @tags exposure-contact-controller + * @name getExposureSourceContactForPatientUsingGET + * @summary getExposureSourceContactForPatient + * @request GET:/api/exposure-contacts/by-contact/{id} + * @secure + */ + getExposureSourceContactForPatientUsingGet: (id: string, params?: RequestParams) => + this.request( + `/api/exposure-contacts/by-contact/${id}`, + "GET", + params, + null, + true, + ), + + /** + * @tags exposure-contact-controller + * @name getExposureContactsForPatientUsingGET + * @summary getExposureContactsForPatient + * @request GET:/api/exposure-contacts/by-source/{id} + * @secure + */ + getExposureContactsForPatientUsingGet: (id: string, params?: RequestParams) => + this.request( + `/api/exposure-contacts/by-source/${id}`, + "GET", + params, + null, + true, + ), + + /** + * @tags exposure-contact-controller + * @name getExposureContactUsingGET + * @summary getExposureContact + * @request GET:/api/exposure-contacts/{id} + * @secure + */ + getExposureContactUsingGet: (id: number, params?: RequestParams) => + this.request(`/api/exposure-contacts/${id}`, "GET", params, null, true), + + /** + * @tags exposure-contact-controller + * @name removeExposureContactUsingDELETE + * @summary removeExposureContact + * @request DELETE:/api/exposure-contacts/{id} + * @secure + */ + removeExposureContactUsingDelete: (id: number, params?: RequestParams) => + this.request(`/api/exposure-contacts/${id}`, "DELETE", params, null, true), + /** * @tags institution-controller * @name createInstitutionUsingPOST From 7d46d6976752c14d0f8f2bd68360bed19ff3ed48 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Brandes Date: Fri, 1 May 2020 13:48:38 +0200 Subject: [PATCH 05/17] Starting refactoring of form control wrappers (DateInput and PatientInput) --- client/src/components/DateInput.vue | 12 ++-- client/src/components/PatientInput.vue | 83 +++++++++++++++++++------- 2 files changed, 70 insertions(+), 25 deletions(-) diff --git a/client/src/components/DateInput.vue b/client/src/components/DateInput.vue index 8fcc85f3..85b1b875 100644 --- a/client/src/components/DateInput.vue +++ b/client/src/components/DateInput.vue @@ -1,13 +1,13 @@