mirror of
https://github.com/pcvolkmer/mv64e-onkostar-data.git
synced 2025-07-03 02:52:54 +00:00
feat: add selection by patient id and tumor id
This commit is contained in:
24
README.md
24
README.md
@ -17,7 +17,21 @@ datasource.setPassword("devpass");
|
|||||||
|
|
||||||
var mtbMapper = MtbDataMapper.create(datasource);
|
var mtbMapper = MtbDataMapper.create(datasource);
|
||||||
|
|
||||||
var jsonResult = Converter.toJsonString(mtbMapper.getByCaseId("16000123"));
|
var jsonResult = Converter.toJsonString(
|
||||||
|
mtbMapper.getByCaseId("16000123")
|
||||||
|
);
|
||||||
|
```
|
||||||
|
|
||||||
|
Es ist auch möglich, die Daten anhand der Patienten-ID und dem Tumoridentifikator zu ermitteln.
|
||||||
|
Hierbei wird das letzte Formular `DNPM Klinik/Anamnese` andhand des Anmeldedatums MTB
|
||||||
|
ausgewählt und verwendet.
|
||||||
|
|
||||||
|
```
|
||||||
|
...
|
||||||
|
|
||||||
|
var jsonResult = Converter.toJsonString(
|
||||||
|
mtbMapper.getLatestByPatientIdAndTumorId("2000123456", 1))
|
||||||
|
);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
@ -31,12 +45,12 @@ var jsonResult = Converter.toJsonString(mtbMapper.getByCaseId("16000123"));
|
|||||||
| Systemische Leitlinien-Therapien | ✅ | Siehe auch: https://github.com/dnpm-dip/mtb-model/issues/9 |
|
| Systemische Leitlinien-Therapien | ✅ | Siehe auch: https://github.com/dnpm-dip/mtb-model/issues/9 |
|
||||||
| Leitlinien-Prozeduren | ✅ | Siehe auch: https://github.com/dnpm-dip/mtb-model/issues/9 |
|
| Leitlinien-Prozeduren | ✅ | Siehe auch: https://github.com/dnpm-dip/mtb-model/issues/9 |
|
||||||
| ECOG-Verlauf | ✅ | |
|
| ECOG-Verlauf | ✅ | |
|
||||||
| Tumor-Probem | | |
|
| Tumor-Proben | ⌛ | Aktuell in Arbeit |
|
||||||
| vorherige Molekular-Diagnostik | | |
|
| vorherige Molekular-Diagnostik | ⌛ | Aktuell in Arbeit |
|
||||||
| Histologie-Berichte | | |
|
| Histologie-Berichte | ⌛ | Aktuell in Arbeit |
|
||||||
| IHC-Berichte | | |
|
| IHC-Berichte | | |
|
||||||
| MSI-Befunde | | |
|
| MSI-Befunde | | |
|
||||||
| NGS-Berichte | | |
|
| NGS-Berichte | ⌛ | Aktuell in Arbeit |
|
||||||
| MTB-Beschlüsse | ⌛ | Aktuell in Arbeit |
|
| MTB-Beschlüsse | ⌛ | Aktuell in Arbeit |
|
||||||
| Follow-Up Verlauf | | |
|
| Follow-Up Verlauf | | |
|
||||||
| Antrag Kostenübernahme | | |
|
| Antrag Kostenübernahme | | |
|
||||||
|
@ -45,6 +45,38 @@ public class KpaCatalogue extends AbstractDataCatalogue {
|
|||||||
return result.get(0);
|
return result.get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get latest procedure database id by patient id and tumor id
|
||||||
|
*
|
||||||
|
* @param patientId The patients id (not database id)
|
||||||
|
* @param tumorId The tumor identifier
|
||||||
|
* @return The procedure id
|
||||||
|
*/
|
||||||
|
public int getLatestProcedureIdByPatientIdAndTumor(String patientId, int tumorId) {
|
||||||
|
var sql = "SELECT prozedur.id FROM dk_dnpm_kpa " +
|
||||||
|
" JOIN prozedur ON (prozedur.id = dk_dnpm_kpa.id) " +
|
||||||
|
" JOIN erkrankung_prozedur ON (erkrankung_prozedur.prozedur_id = prozedur.id) " +
|
||||||
|
" JOIN erkrankung ON (erkrankung_prozedur.erkrankung_id = erkrankung.id) " +
|
||||||
|
" JOIN patient ON (patient.id = prozedur.patient_id) " +
|
||||||
|
" WHERE patient.patienten_id = ? AND erkrankung.tumoridentifikator = ? " +
|
||||||
|
" ORDER BY dk_dnpm_kpa.anmeldedatummtb DESC " +
|
||||||
|
" LIMIT 1";
|
||||||
|
|
||||||
|
var result = this.jdbcTemplate.query(
|
||||||
|
sql,
|
||||||
|
(resultSet, i) -> resultSet.getInt(1),
|
||||||
|
patientId, tumorId);
|
||||||
|
|
||||||
|
if (result.isEmpty()) {
|
||||||
|
throw new DataAccessException(String.format("No record found for patient '%s' and tumor '%d'", patientId, tumorId));
|
||||||
|
} else if (result.size() > 1) {
|
||||||
|
// This should not happen due to LIMIT 1
|
||||||
|
throw new DataAccessException(String.format("Multiple records found for patient '%s' and tumor '%d'", patientId, tumorId));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result.get(0);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get patient database id by case id
|
* Get patient database id by case id
|
||||||
*
|
*
|
||||||
|
@ -131,4 +131,18 @@ public class MtbDataMapper implements DataMapper<Mtb> {
|
|||||||
this.catalogueFactory.catalogue(KpaCatalogue.class).getProcedureIdByCaseId(caseId)
|
this.catalogueFactory.catalogue(KpaCatalogue.class).getProcedureIdByCaseId(caseId)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Loads and maps a Mtb file using the patient id and tumor id
|
||||||
|
*
|
||||||
|
* @param patientId The patients id (not database id)
|
||||||
|
* @param tumorId The tumor identification
|
||||||
|
* @return The loaded Mtb file
|
||||||
|
*/
|
||||||
|
public Mtb getLatestByPatientIdAndTumorId(String patientId, int tumorId) {
|
||||||
|
return this.getById(
|
||||||
|
this.catalogueFactory.catalogue(KpaCatalogue.class)
|
||||||
|
.getLatestProcedureIdByPatientIdAndTumor(patientId, tumorId)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user