Skip to content

Commit

Permalink
fix patient id resovling
Browse files Browse the repository at this point in the history
  • Loading branch information
nr23730 committed Oct 22, 2024
1 parent 87987fa commit 3b30afa
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ private AddResourceData() {
public static void processPdfFile(CbioPortalStudy study, File pdf) throws IOException {
String sampleId = pdf.getName().replaceAll(
".*_somaticGermline_|.*somatic_|.*tumorOnly_|_tumorOnly|_Report|_Slides|_Patho|_HumGen|.pdf", "");
sampleId = sampleId.replaceAll("somaticGermline_|somatic_|tumorOnly_", "");
String patientId = pdf.getName().replaceAll("_somatic.*|_tumorOnly.*", "");
if (patientId == null || patientId.length() == 0) {
FhirResolver.resolvePatientFromSample(sampleId);
if (patientId == null || patientId.length() == 0 || patientId.equals(pdf.getName())) {
patientId = FhirResolver.resolvePatientFromSample(sampleId);
}
File target = new File(
Settings.getResourceFolder(), study.getStudyId() + "/" + patientId + "/" + pdf.getName());
Expand Down

0 comments on commit 3b30afa

Please sign in to comment.