Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,11 @@
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.38</version>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
2 changes: 1 addition & 1 deletion src/main/java/org/aktin/dwh/PreferenceKey.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.aktin.dwh;

import org.aktin.dwh.optinout.PatientReference;
import org.aktin.dwh.optinout.model.PatientReference;

/**
* Preferences keys for the data warehouse
Expand Down
8 changes: 0 additions & 8 deletions src/main/java/org/aktin/dwh/optinout/Participation.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/org/aktin/dwh/optinout/PatientEntry.java

This file was deleted.

123 changes: 0 additions & 123 deletions src/main/java/org/aktin/dwh/optinout/Study.java

This file was deleted.

20 changes: 0 additions & 20 deletions src/main/java/org/aktin/dwh/optinout/StudyManager.java

This file was deleted.

9 changes: 9 additions & 0 deletions src/main/java/org/aktin/dwh/optinout/model/ErrorType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.aktin.dwh.optinout.model;

// errors that occur during CRUD operations on opt-in data
public enum ErrorType {
STUDY_NOT_FOUND,
PATIENT_NOT_FOUND,
PATIENT_ALREADY_EXISTS,
SIC_ALREADY_EXISTS,
}
28 changes: 28 additions & 0 deletions src/main/java/org/aktin/dwh/optinout/model/Participation.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.aktin.dwh.optinout.model;

import java.util.Arrays;

public enum Participation {
/** Patient specifically wants to participate */
OptIn("I"),
/** Patient wants to be excluded */
OptOut("O");

/**
* helper functions for (de-)serialization
*/
private String code;

Participation(String code) {
this.code = code;
}

public String getCode() {
return code;
}

public static Participation fromCode(String code) {
return Arrays.stream(values()).filter(a -> a.code.equals(code)).findFirst()
.orElseThrow(() -> new IllegalArgumentException("Unknown database value: " + code));
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package org.aktin.dwh.optinout;
package org.aktin.dwh.optinout.model;

import java.time.Instant;

public interface PatientEncounter {
int getEncounterId();
int getPatientId();
String getPseudonym();
Instant getStartDate();
Instant getEndDate();
}
21 changes: 21 additions & 0 deletions src/main/java/org/aktin/dwh/optinout/model/PatientEntry.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.aktin.dwh.optinout.model;

import java.time.Instant;

public interface PatientEntry {
Participation getParticipation();
PatientReference getReference();
String getIdRoot();
String getIdExt();
String getSIC();
String getUser();
Instant getTimestamp();
String getComment();

/**
* Get the i2b2 patient_num field. Only available, if the patient was linked
* to existing data. The link is established automatically and periodically
* @return patient_num from i2b2, or {@code null} if no link is available.
*/
Integer getI2b2PatientNum();
}
22 changes: 22 additions & 0 deletions src/main/java/org/aktin/dwh/optinout/model/PatientEntryData.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.aktin.dwh.optinout.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* This class serves as input POJO for (batch) patient entry write actions (create, update)
*/

@Data
@AllArgsConstructor
@NoArgsConstructor
public class PatientEntryData {
private String root;
private String extension;
private String sic;
private String comment;
private boolean generateSic;
private Participation participation;
private PatientReference reference;
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.aktin.dwh.optinout;
package org.aktin.dwh.optinout.model;

import java.time.Instant;

public interface PatientMasterData {
int getPatientId();
String getPseudonym();
String getSex();
String getZip();
Instant getBirthDate();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,45 @@
package org.aktin.dwh.optinout;
package org.aktin.dwh.optinout.model;

import java.util.Arrays;

public enum PatientReference {
/** patient specific id
* CDA element: /ClinicalDocument/recordTarget/patientRole/id
* hash in i2b2 DB: i2b2crcdata.patient_mapping in column patient_ide [type: character varying(200)
*/
Patient,
Patient("PAT"),
/** visit id, a visit can contain multiple encounters
* Not used in this project.
*/
Visit,
Visit("VIS"),
/** encounter (with a practitioner)
* CDA element: /ClinicalDocument/componentOf/encompassingEncounter/id[1]
* hash in i2b2 DB: i2b2crcdata.encounter_mapping in column encounter_ide [type: character varying(200)
*/
Encounter,
Encounter("ENC"),
/** billing / accounting number of the hospital, used for financial transactions
* CDA element: /ClinicalDocument/componentOf/encompassingEncounter/id[2]
* hash in i2b2 DB: i2b2crcdata.observation_fact in column tval_char where concept_cd=AKTIN:Fallkennzeichen [type: character varying(255)]
*/
Billing
Billing("BIL");


/**
* helper functions for (de-)serialization
*/

private final String code;

PatientReference(String code) {
this.code = code;
}

public String getCode() {
return code;
}

public static PatientReference fromCode(String code) {
return Arrays.stream(values()).filter(a -> a.code.equals(code)).findFirst()
.orElseThrow(() -> new IllegalArgumentException("Unknown value: " + code));
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.aktin.dwh.optinout;
package org.aktin.dwh.optinout.model;

/**
* Method of Sic generation
Expand Down
Loading