diff --git a/.gitignore b/.gitignore index ecf552d9..572cbef8 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ local-dev/ !gradle/wrapper/gradle-wrapper.jar !**/src/main/** !**/src/test/** +*.csv ### STS ### .apt_generated diff --git a/build.gradle b/build.gradle index 45bdb908..ed840168 100644 --- a/build.gradle +++ b/build.gradle @@ -51,6 +51,8 @@ dependencies { implementation group: 'org.webjars', name: 'swagger-ui', version: '3.24.0' implementation group: 'org.aspectj', name: 'aspectjweaver', version: '1.8.8' implementation group: 'com.google.cloud', name: 'google-cloud-bigquery', version: '1.124.7' + implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5' + implementation group: 'com.jayway.jsonpath', name: 'json-path', version: '2.4.0' // These dependencies are required to load the logback config file. implementation group: 'org.codehaus.groovy', name: 'groovy', version: '3.0.7' diff --git a/jsonOutput-8.csv b/jsonOutput-8.csv new file mode 100644 index 00000000..3c1cef3a --- /dev/null +++ b/jsonOutput-8.csv @@ -0,0 +1,29 @@ +id|species|sex|race|ethnicity|days_to_birth|vital_status|age_at_death|cause_of_death|id_1|member_of_research_project|primary_diagnosis_condition|primary_diagnosis_site|id_2|primary_diagnosis|age_at_diagnosis|morphology|stage|grade|method_of_diagnosis|identifier.system|identifier.value|subject_associated_project.0|ResearchSubject.id|ResearchSubject.member_of_research_project|ResearchSubject.primary_diagnosis_condition|ResearchSubject.primary_diagnosis_site|ResearchSubject.identifier.system|ResearchSubject.identifier.value|ResearchSubject.Diagnosis.id|ResearchSubject.Diagnosis.primary_diagnosis|ResearchSubject.Diagnosis.age_at_diagnosis|ResearchSubject.Diagnosis.morphology|ResearchSubject.Diagnosis.stage|ResearchSubject.Diagnosis.grade|ResearchSubject.Diagnosis.method_of_diagnosis|ResearchSubject.Diagnosis.identifier.system|ResearchSubject.Diagnosis.identifier.value|ResearchSubject.Diagnosis.Treatment.id|ResearchSubject.Diagnosis.Treatment.treatment_type|ResearchSubject.Diagnosis.Treatment.treatment_outcome|ResearchSubject.Diagnosis.Treatment.days_to_treatment_start|ResearchSubject.Diagnosis.Treatment.days_to_treatment_end|ResearchSubject.Diagnosis.Treatment.therapeutic_agent|ResearchSubject.Diagnosis.Treatment.treatment_anatomic_site|ResearchSubject.Diagnosis.Treatment.treatment_effect|ResearchSubject.Diagnosis.Treatment.treatment_end_reason|ResearchSubject.Diagnosis.Treatment.number_of_cycles|ResearchSubject.Diagnosis.Treatment.identifier.system|ResearchSubject.Diagnosis.Treatment.identifier.value|ResearchSubject.Specimen.id|ResearchSubject.Specimen.associated_project|ResearchSubject.Specimen.age_at_collection|ResearchSubject.Specimen.primary_disease_type|ResearchSubject.Specimen.anatomical_site|ResearchSubject.Specimen.source_material_type|ResearchSubject.Specimen.specimen_type|ResearchSubject.Specimen.derived_from_specimen|ResearchSubject.Specimen.derived_from_subject|ResearchSubject.Specimen.identifier.system|ResearchSubject.Specimen.identifier.value|identifier_1.system|identifier_1.value|Diagnosis.id|Diagnosis.primary_diagnosis|Diagnosis.age_at_diagnosis|Diagnosis.morphology|Diagnosis.stage|Diagnosis.grade|Diagnosis.method_of_diagnosis|Diagnosis.identifier.system|Diagnosis.identifier.value|Diagnosis.Treatment.id|Diagnosis.Treatment.treatment_type|Diagnosis.Treatment.treatment_outcome|Diagnosis.Treatment.days_to_treatment_start|Diagnosis.Treatment.days_to_treatment_end|Diagnosis.Treatment.therapeutic_agent|Diagnosis.Treatment.treatment_anatomic_site|Diagnosis.Treatment.treatment_effect|Diagnosis.Treatment.treatment_end_reason|Diagnosis.Treatment.number_of_cycles|Diagnosis.Treatment.identifier.system|Diagnosis.Treatment.identifier.value|Specimen.id|Specimen.associated_project|Specimen.age_at_collection|Specimen.primary_disease_type|Specimen.anatomical_site|Specimen.source_material_type|Specimen.specimen_type|Specimen.derived_from_specimen|Specimen.derived_from_subject|Specimen.identifier.system|Specimen.identifier.value|identifier_2.system|identifier_2.value|Treatment.id|Treatment.treatment_type|Treatment.treatment_outcome|Treatment.days_to_treatment_start|Treatment.days_to_treatment_end|Treatment.therapeutic_agent|Treatment.treatment_anatomic_site|Treatment.treatment_effect|Treatment.treatment_end_reason|Treatment.number_of_cycles|Treatment.identifier.system|Treatment.identifier.value +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||"GDC"|"TCGA-29-2435"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"GDC"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||"GDC"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c"|"Pharmaceutical Therapy, NOS"|||||||||"GDC"|"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"68aece6e-2de6-506a-8190-7433a1f5b8eb"|"Radiation Therapy, NOS"|||||||||"GDC"|"68aece6e-2de6-506a-8190-7433a1f5b8eb"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"a76ac995-782d-4ba3-a029-40f8d7d9642b"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Blood Derived Normal"|"sample"|"initial specimen"|"TCGA-29-2435"|"GDC"|"a76ac995-782d-4ba3-a029-40f8d7d9642b"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"c34bf82c-7b38-482a-bfe3-f2750f1a24bc"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Blood Derived Normal"|"portion"|"a76ac995-782d-4ba3-a029-40f8d7d9642b"|"TCGA-29-2435"|"GDC"|"c34bf82c-7b38-482a-bfe3-f2750f1a24bc"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"sample"|"initial specimen"|"TCGA-29-2435"|"GDC"|"69a797dd-1083-4a83-a184-ec19f704d770"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"84e1540d-c756-414e-92c9-3e0d5f45cd48"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"84e1540d-c756-414e-92c9-3e0d5f45cd48"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"49cf0c2e-45b3-4a61-97ad-8cae610313d0"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"49cf0c2e-45b3-4a61-97ad-8cae610313d0"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"169f0540-bdac-416d-b239-74b4804b140b"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"3302664d-2406-4641-b54f-daf7400522b8"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"slide"|"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-29-2435"|"GDC"|"3302664d-2406-4641-b54f-daf7400522b8"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"||||||||||||||||||||||||"b317672c-b196-428f-9c3f-077fdd24e96e"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"slide"|"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-29-2435"|"GDC"|"b317672c-b196-428f-9c3f-077fdd24e96e"|||||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||"GDC"|"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|||||||||||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||"GDC"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"||||||||||||||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c"|"Pharmaceutical Therapy, NOS"|||||||||"GDC"|"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c"||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"68aece6e-2de6-506a-8190-7433a1f5b8eb"|"Radiation Therapy, NOS"|||||||||"GDC"|"68aece6e-2de6-506a-8190-7433a1f5b8eb"||||||||||||||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"a76ac995-782d-4ba3-a029-40f8d7d9642b"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Blood Derived Normal"|"sample"|"initial specimen"|"TCGA-29-2435"|"GDC"|"a76ac995-782d-4ba3-a029-40f8d7d9642b"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"c34bf82c-7b38-482a-bfe3-f2750f1a24bc"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Blood Derived Normal"|"portion"|"a76ac995-782d-4ba3-a029-40f8d7d9642b"|"TCGA-29-2435"|"GDC"|"c34bf82c-7b38-482a-bfe3-f2750f1a24bc"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"sample"|"initial specimen"|"TCGA-29-2435"|"GDC"|"69a797dd-1083-4a83-a184-ec19f704d770"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"84e1540d-c756-414e-92c9-3e0d5f45cd48"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"84e1540d-c756-414e-92c9-3e0d5f45cd48"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"49cf0c2e-45b3-4a61-97ad-8cae610313d0"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"49cf0c2e-45b3-4a61-97ad-8cae610313d0"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"portion"|"69a797dd-1083-4a83-a184-ec19f704d770"|"TCGA-29-2435"|"GDC"|"169f0540-bdac-416d-b239-74b4804b140b"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"3302664d-2406-4641-b54f-daf7400522b8"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"slide"|"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-29-2435"|"GDC"|"3302664d-2406-4641-b54f-daf7400522b8"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"b317672c-b196-428f-9c3f-077fdd24e96e"|"TCGA-OV"|"-28779"|"Cystic, Mucinous and Serous Neoplasms"||"Primary Tumor"|"slide"|"169f0540-bdac-416d-b239-74b4804b140b"|"TCGA-29-2435"|"GDC"|"b317672c-b196-428f-9c3f-077fdd24e96e"|||||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"GDC"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|||||||||||| +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c"|"Pharmaceutical Therapy, NOS"|||||||||"GDC"|"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c" +"TCGA-29-2435"|"Homo sapiens"|"female"|"white"|"not reported"|"-28779"|"Alive"|||"8fa35df3-f544-4c47-bdd1-e4d6fc6662be"|"TCGA-OV"|"Cystic, Mucinous and Serous Neoplasms"|"Ovary"|"dc8af98b-03cb-5817-84fa-d86a7f2df8c6"|"Serous cystadenocarcinoma, NOS"|"28779"|"8441/3"||"not reported"||||"TCGA-OV"|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||"68aece6e-2de6-506a-8190-7433a1f5b8eb"|"Radiation Therapy, NOS"|||||||||"GDC"|"68aece6e-2de6-506a-8190-7433a1f5b8eb" diff --git a/src/main/java/bio/terra/cda/app/aop/TimerAspect.java b/src/main/java/bio/terra/cda/app/aop/TimerAspect.java index c1a338e1..34115e2c 100644 --- a/src/main/java/bio/terra/cda/app/aop/TimerAspect.java +++ b/src/main/java/bio/terra/cda/app/aop/TimerAspect.java @@ -1,6 +1,7 @@ package bio.terra.cda.app.aop; import org.aspectj.lang.ProceedingJoinPoint; + import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; @@ -19,8 +20,10 @@ public Object executionTimer(ProceedingJoinPoint joinPoint) throws Throwable { long start = System.currentTimeMillis(); Object proceed = joinPoint.proceed(); long executionTime = System.currentTimeMillis() - start; + Signature signature = joinPoint.getSignature(); logger.info("--Execution Timer: {} executed in {}ms", signature, executionTime); + return proceed; } } diff --git a/src/main/java/bio/terra/cda/app/controller/QueryApiController.java b/src/main/java/bio/terra/cda/app/controller/QueryApiController.java index 449ca723..1d6ea411 100644 --- a/src/main/java/bio/terra/cda/app/controller/QueryApiController.java +++ b/src/main/java/bio/terra/cda/app/controller/QueryApiController.java @@ -15,6 +15,15 @@ import bio.terra.cda.generated.model.QueryCreatedData; import bio.terra.cda.generated.model.QueryResponseData; import com.google.cloud.bigquery.BigQueryException; + +import java.io.IOException; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Collections; +import java.util.Set; +import javax.servlet.http.HttpServletRequest; +import javax.validation.Valid; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -63,9 +72,11 @@ private String createNextUrl(String jobId, int offset, int limit) { @TrackExecutionTime @Override - public ResponseEntity query(String id, Integer offset, Integer limit) { - var result = queryService.getQueryResults(id, offset, limit); - var response = + public ResponseEntity query( + String id, Integer offset, Integer limit, String format, String includeHeaders) { + QueryService.QueryResult result = + queryService.getQueryResults(id, offset, limit, format, includeHeaders); + QueryResponseData response = new QueryResponseData() .result(Collections.unmodifiableList(result.items)) .totalRowCount(result.totalRowCount) diff --git a/src/main/java/bio/terra/cda/app/flatten/JsonFlattener.java b/src/main/java/bio/terra/cda/app/flatten/JsonFlattener.java new file mode 100644 index 00000000..f3d28c3f --- /dev/null +++ b/src/main/java/bio/terra/cda/app/flatten/JsonFlattener.java @@ -0,0 +1,440 @@ +package bio.terra.cda.app.flatten; + +import bio.terra.cda.app.flatten.model.Row; +import com.google.gson.JsonElement; +import com.google.gson.JsonParser; +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; +import com.jayway.jsonpath.spi.json.JacksonJsonProvider; +import com.jayway.jsonpath.spi.json.JsonProvider; +import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; +import com.jayway.jsonpath.spi.mapper.MappingProvider; +import java.io.*; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * This utility converts a Json document in a 2D spreadsheet like CSV. This class is strongly + * borrowed from https://github.com/opendevl/Json2Flat but modified to handle the ResultObject of + * type List which reflects multiple rows that are coming out of BigQuery. + * + *

The field separators can be modified from ("/t" "," "|") etc by utilizing + */ +public class JsonFlattener { + + private List sheetMatrix = null; + + private List unique = null; + + private String tmpPath = null; + + private String regex = "(\\[[0-9]*\\]$)"; + private Pattern pattern = Pattern.compile(regex, Pattern.MULTILINE); + + private OrderJson makeOrder = new OrderJson(); + + /** + * This method does some pre processing and then calls make2D() to get the spreadsheet + * representation of Json document. + * + * @return returns a JsonFlattener object + */ + public JsonFlattener json2Sheet(String jsonString, String includeHeaders) { + + Configuration.setDefaults( + new Configuration.Defaults() { + private final JsonProvider jsonProvider = new JacksonJsonProvider(); + private final MappingProvider mappingProvider = new JacksonMappingProvider(); + + // @Override + public JsonProvider jsonProvider() { + return jsonProvider; + } + + // @Override + public MappingProvider mappingProvider() { + return mappingProvider; + } + + // @Override + public Set options() { + return EnumSet.noneOf(Option.class); + } + }); + + Configuration conf = + Configuration.defaultConfiguration() + .addOptions(Option.DEFAULT_PATH_LEAF_TO_NULL) + .addOptions(Option.SUPPRESS_EXCEPTIONS); + + Configuration pathConf = + Configuration.defaultConfiguration() + .addOptions(Option.AS_PATH_LIST) + .addOptions(Option.ALWAYS_RETURN_LIST); + + DocumentContext parse = null; + + sheetMatrix = new ArrayList<>(); + + JsonElement element = new JsonParser().parse(jsonString); + + List pathList = JsonPath.using(pathConf).parse(jsonString).read("$..*"); + + parse = JsonPath.using(conf).parse(jsonString); + + HashSet primitivePath = new LinkedHashSet<>(); + HashSet primitiveUniquePath = new LinkedHashSet<>(); + + for (String o : pathList) { + Object tmp = parse.read(o); + + if (tmp == null) { + primitivePath.add(o); + + } else { + String dataType = tmp.getClass().getSimpleName(); + if (dataType.equals("Boolean") + || dataType.equals("Integer") + || dataType.equals("String") + || dataType.equals("Double") + || dataType.equals("Long")) { + primitivePath.add(o); + } else { + // it's not a primitive data type + } + } + } + + for (String o : primitivePath) { + + Matcher m = pattern.matcher(o); + + if (m.find()) { + String[] tmp = o.replace("$", "").split("(\\[[0-9]*\\]$)"); + tmp[0] = tmp[0].replaceAll("(\\[[0-9]*\\])", ""); + primitiveUniquePath.add( + (tmp[0] + m.group()) + .replace("'][", ".") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } else { + primitiveUniquePath.add( + o.replace("$", "") + .replaceAll("(\\[[0-9]*\\])", "") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } + } + + unique = new ArrayList<>(primitiveUniquePath); + + // choose to suppress the header row if we are aggregating multiple input results downstream. + if (includeHeaders.equals("true")) { + Object[] header = new Object[unique.size()]; + int i = 0; + for (String o : unique) { + header[i] = o; + i++; + } + + // header of the csv + sheetMatrix.add(header); + } + + // adding all the content of csv + sheetMatrix.add(make2D(new Object[unique.size()], element, "$")); + + Object[] last = sheetMatrix.get(sheetMatrix.size() - 1); + Object[] secondLast = sheetMatrix.get(sheetMatrix.size() - 2); + + boolean delete = true; + + for (Object o : last) { + if (o != null) { + delete = false; + break; + } + } + + if (!delete) { + delete = true; + for (int DEL = 0; DEL < last.length; DEL++) { + if (last[DEL] != null && !last[DEL].equals(secondLast[DEL])) { + delete = false; + break; + } + } + } + + if (delete) sheetMatrix.remove(sheetMatrix.size() - 1); + + return this; + } + + /** + * This function transforms the JSON document to its equivalent 2D representation. + * + * @param old it keeps the old row which is always assigned to the current row. + * @param element this keeps the part of json being parsed to 2D. + * @param path this mantains the path of the Json element being processed. + * @return + */ + private Object[] make2D(Object[] old, JsonElement element, String path) { + + Object[] current = old.clone(); + + boolean gotArray = false; + + if (element.isJsonObject()) { + + /* + * applying order to JSON. Order - + * 1) JSON primitive + * 2) JSON Array + * 3) JSON Object + */ + element = makeOrder.orderJson(element); + + for (Map.Entry entry : element.getAsJsonObject().entrySet()) { + + if (entry.getValue().isJsonPrimitive()) { + tmpPath = path + "['" + entry.getKey() + "']"; + Matcher m = pattern.matcher(tmpPath); + + if (m.find()) { + String[] tmp = tmpPath.replace("$", "").split("(\\[[0-9]*\\]$)"); + tmp[0] = tmp[0].replaceAll("(\\[[0-9]*\\])", ""); + tmpPath = + ((tmp[0] + m.group()) + .replace("'][", ".") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } else { + tmpPath = + (tmpPath + .replace("$", "") + .replaceAll("(\\[[0-9]*\\])", "") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } + + if (unique.contains(tmpPath)) { + int index = unique.indexOf(tmpPath); + current[index] = entry.getValue().getAsJsonPrimitive(); + } + tmpPath = null; + } else if (entry.getValue().isJsonObject()) { + current = + make2D( + current, entry.getValue().getAsJsonObject(), path + "['" + entry.getKey() + "']"); + } else if (entry.getValue().isJsonArray()) { + current = + make2D( + current, entry.getValue().getAsJsonArray(), path + "['" + entry.getKey() + "']"); + } + } + + } else if (element.isJsonArray()) { + int arrIndex = 0; + + for (JsonElement tmp : element.getAsJsonArray()) { + + if (tmp.isJsonPrimitive()) { + tmpPath = path + "['" + arrIndex + "']"; + Matcher m = pattern.matcher(tmpPath); + + if (m.find()) { + String[] tmp1 = tmpPath.replace("$", "").split("(\\[[0-9]*\\]$)"); + tmp1[0] = tmp1[0].replaceAll("(\\[[0-9]*\\])", ""); + tmpPath = + ((tmp1[0] + m.group()) + .replace("'][", ".") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } else { + tmpPath = + (tmpPath + .replace("$", "") + .replaceAll("(\\[[0-9]*\\])", "") + .replace("[", "") + .replace("]", "") + .replace("''", ".") + .replace("'", "")); + } + + if (unique.contains(tmpPath)) { + int index = unique.indexOf(tmpPath); + current[index] = tmp.getAsJsonPrimitive(); + } + tmpPath = null; + } else { + if (tmp.isJsonObject()) { + gotArray = isInnerArray(tmp); + + sheetMatrix.add(make2D(current, tmp.getAsJsonObject(), path + "[" + arrIndex + "]")); + if (gotArray) { + sheetMatrix.remove(sheetMatrix.size() - 1); + } + } else if (tmp.isJsonArray()) { + make2D(current, tmp.getAsJsonArray(), path + "[" + arrIndex + "]"); + } + } + arrIndex++; + } + } + return current; + } + + /** + * This method checks whether object inside an array contains an array or not. + * + * @param element it a Json object inside an array + * @return it returns true if Json object inside an array contains an array or else false + */ + private boolean isInnerArray(JsonElement element) { + + for (Map.Entry entry : element.getAsJsonObject().entrySet()) { + if (entry.getValue().isJsonArray() && entry.getValue().getAsJsonArray().size() > 0) { + for (JsonElement checkPrimitive : entry.getValue().getAsJsonArray()) { + if (checkPrimitive.isJsonObject()) { + return true; + } + } + } + } + return false; + } + + /** + * This method replaces the default header separator i.e. "." with a custom separator provided by + * user. + * + * @param separator + * @return JFlat + * @throws Exception + */ + public JsonFlattener headerSeparator(String separator) throws IllegalArgumentException { + try { + + int sheetMatrixLen = this.sheetMatrix.get(0).length; + + for (int I = 0; I < sheetMatrixLen; I++) { + + this.sheetMatrix.get(0)[I] = + this.sheetMatrix + .get(0)[I] + .toString() + .replaceFirst("^\\/", "") + .replace("\\.", separator) + .trim(); + } + + } catch (NullPointerException nullex) { + throw new IllegalArgumentException( + "The JSON document hasn't been transformed yet. Try using json2Sheet() before using headerSeparator"); + } + return this; + } + + /** + * This method returns the sheet matrix. + * + * @return List + */ + public List getJsonAsSheet() { + return this.sheetMatrix; + } + + /** + * This method returns the spreadsheet as List + * + * @return List + */ + public List getJsonAsSpreadsheet() { + List spreadsheet = new ArrayList<>(); + for (Object[] sheetRow : this.sheetMatrix) { + spreadsheet.add(Row.toSpreadsheetRow(sheetRow)); + } + return spreadsheet; + } + + /** + * This method returns unique fields of the json + * + * @return List + */ + public List getUniqueFields() { + return this.unique; + } + + /** + * This method writes the spreadsheet representation in csv format with ',' as default delimiter. + * + * @param destination it takes the destination path for the csv file. + * @throws FileNotFoundException + * @throws UnsupportedEncodingException + */ + public void write2csv(String destination) + throws FileNotFoundException, UnsupportedEncodingException { + this.write2csv(destination, '|'); + } + + /** + * This method writes the spreadsheet representation in csv format with custom delimiter set by + * user. + * + * @param destination it takes the destination path for the csv file. + * @param delimiter it represents the delimiter set by user. + * @throws FileNotFoundException + * @throws UnsupportedEncodingException + */ + public void write2csv(String destination, char delimiter) + throws FileNotFoundException, UnsupportedEncodingException { + PrintWriter writer = new PrintWriter(new File(destination), "UTF-8"); + writer.write(write2csv(delimiter)); + writer.close(); + } + + /** + * This method returns the spreadsheet representation in csv format as string with custom + * delimiter set by user. + * + * @param delimiter it represents the delimiter set by user. + */ + public String write2csv(char delimiter) { + boolean comma = false; + StringBuilder buffer = new StringBuilder(); + for (Object[] o : this.sheetMatrix) { + comma = false; + for (Object t : o) { + if (t == null) { + buffer.append(comma ? String.valueOf(delimiter) : ""); + } else { + buffer.append(comma ? delimiter + t.toString() : t.toString()); + } + if (!comma) comma = true; + } + buffer.append("\n"); + } + return buffer.toString(); + } +} diff --git a/src/main/java/bio/terra/cda/app/flatten/OrderJson.java b/src/main/java/bio/terra/cda/app/flatten/OrderJson.java new file mode 100644 index 00000000..f869884e --- /dev/null +++ b/src/main/java/bio/terra/cda/app/flatten/OrderJson.java @@ -0,0 +1,70 @@ +package bio.terra.cda.app.flatten; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.reflect.TypeToken; +import java.lang.reflect.Type; +import java.util.LinkedHashMap; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class OrderJson { + private static final Logger logger = LoggerFactory.getLogger(OrderJson.class); + Type type = new TypeToken>() {}.getType(); + + // LinkedHashMap to maintain insertion order + Map origMap = null; + + Map jsonPrimitive = null; + Map jsonArray = null; + Map jsonObject = null; + + Gson gson = null; + + public OrderJson() { + gson = new Gson(); + } + + public JsonElement orderJson(JsonElement element) { + + jsonPrimitive = new LinkedHashMap<>(); + jsonArray = new LinkedHashMap<>(); + jsonObject = new LinkedHashMap<>(); + + // converting JsonElement to Map + origMap = gson.fromJson(element, type); + + // Iterating the Map object to get type of Object + for (Map.Entry entry : origMap.entrySet()) { + + try { + // adding check if value of key in json is null + if (entry.getValue() == null || entry.getValue().getClass().isInstance("ArrayList")) { + + // if Object is of type ArrayList push it to jsonArray Map + jsonArray.put(entry.getKey(), entry.getValue()); + + } else { + + // if Object is of type Primitive push to the jsonPrimitive Map + jsonPrimitive.put(entry.getKey(), entry.getValue()); + } + } catch (Exception ex) { + logger.error(ex.getMessage()); + } + } + + /* Keeping Order - + * 1) JSON primitive + * 2) JSON Array + * 3) JSON Object ( order of JSON Object is yet to be decided) + * */ + + // appending jsonArray map to jsonPrimitive map in order to mantain order. + jsonPrimitive.putAll(jsonArray); + + // reconstructing the JSON from Map Objects and returning + return gson.toJsonTree(jsonPrimitive, LinkedHashMap.class); + } +} diff --git a/src/main/java/bio/terra/cda/app/flatten/model/Row.java b/src/main/java/bio/terra/cda/app/flatten/model/Row.java new file mode 100644 index 00000000..a8a2ecc9 --- /dev/null +++ b/src/main/java/bio/terra/cda/app/flatten/model/Row.java @@ -0,0 +1,25 @@ +package bio.terra.cda.app.flatten.model; + +public class Row { + + private Row() {} + + public static String toSpreadsheetRow(Object[] cellData) { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < cellData.length - 1; i++) { + if (cellData[i] != null) { + if (cellData[i].toString().contains(",")) { + cellData[i] = cellData[i].toString().replace(",", "\\,"); + } + builder.append(cellData[i].toString() + "\t"); + } else { + builder.append("\t"); + } + } + if (cellData[cellData.length - 1] != null) { + builder.append(cellData[cellData.length - 1]); + } + + return builder.toString(); + } +} diff --git a/src/main/java/bio/terra/cda/app/service/QueryService.java b/src/main/java/bio/terra/cda/app/service/QueryService.java index 82826bfe..7ec13599 100644 --- a/src/main/java/bio/terra/cda/app/service/QueryService.java +++ b/src/main/java/bio/terra/cda/app/service/QueryService.java @@ -3,6 +3,7 @@ import static java.lang.Thread.currentThread; import bio.terra.cda.app.configuration.ApplicationConfiguration; +import bio.terra.cda.app.flatten.JsonFlattener; import bio.terra.cda.app.service.exception.BadQueryException; import bio.terra.cda.generated.model.JobStatusData; import bio.terra.cda.generated.model.SystemStatus; @@ -130,7 +131,8 @@ protected JsonNode valueToJson(FieldValue value, Field field) { } } - public QueryResult getQueryResults(String queryId, int offset, int pageSize) { + public QueryResult getQueryResults( + String queryId, int offset, int pageSize, String format, String includeHeaders) { final Job job = bigQuery.getJob(queryId); if (job == null || !job.exists()) { throw new RuntimeException("Unknown query " + queryId); @@ -139,26 +141,30 @@ public QueryResult getQueryResults(String queryId, int offset, int pageSize) { // If the Query is still running, return an empty result. return new QueryResult(Collections.emptyList(), null, getSqlFromJob(job)); } - return getJobResults(job, offset, pageSize); + return getJobResults(job, offset, pageSize, format, includeHeaders); } public void setBigQuery(BigQuery bigQuery) { this.bigQuery = bigQuery; } - public static class QueryResult { - public final List items; + public static class QueryResult { + public final List items; public final Long totalRowCount; public final String querySql; - QueryResult(List items, Long totalRowCount, String querySql) { + QueryResult(List items, Long totalRowCount, String querySql) { this.items = new ArrayList<>(items); this.totalRowCount = totalRowCount; this.querySql = querySql; } } - private QueryResult getJobResults(Job queryJob, int offset, int pageSize) { + private QueryResult getJobResults( + Job queryJob, int offset, int pageSize, String format, String includeHeaders) { + if (!format.equals("JSON")) { + pageSize = 10; + } var options = new ArrayList(); if (offset < 0) { throw new IllegalArgumentException("Invalid offset: " + offset); @@ -192,10 +198,33 @@ private QueryResult getJobResults(Job queryJob, int offset, int pageSize) { break; } } + // If we are returning CSV as a spreadsheet, pageSize is constrained to 10 json rows for + // now. + if (!format.equals("JSON")) { + List spreadsheet = new ArrayList<>(); + JsonFlattener jflat = new JsonFlattener(); + int bqResults = 0; + for (var jsonRow : jsonData) { + if (bqResults > 0) { + includeHeaders = "false"; + } + List csvRows = + jflat.json2Sheet(jsonRow.toString(), includeHeaders).getJsonAsSpreadsheet(); + spreadsheet.addAll(csvRows); + bqResults++; + } + + logQuery(queryJob, jsonData); + + return new QueryResult(spreadsheet, result.getTotalRows(), getSqlFromJob(queryJob)); + } logQuery(queryJob, jsonData); - return new QueryResult(jsonData, result.getTotalRows(), getSqlFromJob(queryJob)); +// List jsonRowData = new ArrayList<>(); +// jsonRowData.add(jsonData); + return new QueryResult(jsonData, result.getTotalRows(), getSqlFromJob(queryJob)); + } catch (InterruptedException e) { currentThread().interrupt(); throw new BadQueryException("Error while getting query results", e); diff --git a/src/main/resources/api/service_openapi.yaml b/src/main/resources/api/service_openapi.yaml index c3e164fa..992ee755 100644 --- a/src/main/resources/api/service_openapi.yaml +++ b/src/main/resources/api/service_openapi.yaml @@ -144,9 +144,11 @@ paths: - query parameters: - - $ref: "#/components/parameters/QueryId" - - $ref: "#/components/parameters/ResultOffset" - - $ref: "#/components/parameters/ResultLimit" + - $ref: '#/components/parameters/QueryId' + - $ref: '#/components/parameters/ResultOffset' + - $ref: '#/components/parameters/ResultLimit' + - $ref: '#/components/parameters/Format' + - $ref: '#/components/parameters/Headers' responses: 200: @@ -228,7 +230,6 @@ paths: type: boolean default: false - $ref: "#/components/parameters/Table" - requestBody: description: counts required: true @@ -247,7 +248,6 @@ paths: operationId: files tags: - query - parameters: - $ref: "#/components/parameters/DatasetVersion" - in: query @@ -321,6 +321,21 @@ components: type: string default: broad-dsde-dev.cda_dev description: tablename + Format: + in: query + name: format + schema: + type: string + enum: ["JSON", "TSV"] + default: JSON + description: Output format + Headers: + in: query + name: includeHeaders + schema: + type: string + default: true + description: Include the column headers in TSV returns schemas: ErrorReport: @@ -383,6 +398,15 @@ components: nullable: true description: a URL to use to fetch the next page of data in the query. can be null if the query is not complete + Row: + type: object + properties: + cells: + type: array + items: + type: string + description: spreadsheet cell data + DatasetDescription: type: object properties: diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 6edc84e7..4bcbd8c6 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -7,4 +7,3 @@ bqTable=cda_dev datasetVersion=all_v3_0_subjects_meta server.connection-timeout=300s - diff --git a/src/test/java/bio/terra/cda/app/flatten/FlattenTest.java b/src/test/java/bio/terra/cda/app/flatten/FlattenTest.java new file mode 100644 index 00000000..80d589c5 --- /dev/null +++ b/src/test/java/bio/terra/cda/app/flatten/FlattenTest.java @@ -0,0 +1,102 @@ +package bio.terra.cda.app.flatten; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; +import com.jayway.jsonpath.spi.json.JacksonJsonProvider; +import com.jayway.jsonpath.spi.json.JsonProvider; +import com.jayway.jsonpath.spi.mapper.JacksonMappingProvider; +import com.jayway.jsonpath.spi.mapper.MappingProvider; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.EnumSet; +import java.util.List; +import java.util.Set; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +class FlattenTest { + + static final Path TEST_FILES = Paths.get("src/test/resources/json_files"); + + @Test + void testFlatteningUsingJsonFlattener() throws Exception { + String jsonString = Files.readString(TEST_FILES.resolve("gdc_no_files1.json")); + JsonFlattener jflat = new JsonFlattener(); + + List json2csv = jflat.json2Sheet(jsonString, "true").getJsonAsSpreadsheet(); + + assertEquals(30, json2csv.size()); + assertTrue( + jflat + .json2Sheet(jsonString, "true") + .getUniqueFields() + .contains("member_of_research_project")); + } + + @Disabled + void testPathList() throws Exception { + Configuration.setDefaults( + new Configuration.Defaults() { + private final JsonProvider jsonProvider = new JacksonJsonProvider(); + private final MappingProvider mappingProvider = new JacksonMappingProvider(); + + // @Override + public JsonProvider jsonProvider() { + return jsonProvider; + } + + // @Override + public MappingProvider mappingProvider() { + return mappingProvider; + } + + // @Override + public Set options() { + return EnumSet.noneOf(Option.class); + } + }); + + Configuration conf = + Configuration.defaultConfiguration() + .addOptions(Option.DEFAULT_PATH_LEAF_TO_NULL) + .addOptions(Option.SUPPRESS_EXCEPTIONS); + + Configuration pathConf = + Configuration.defaultConfiguration() + .addOptions(Option.AS_PATH_LIST) + .addOptions(Option.ALWAYS_RETURN_LIST); + + String jsonString = Files.readString(TEST_FILES.resolve("gdc_no_files1.json")); + List pathList = JsonPath.using(pathConf).parse(jsonString).read("$..*"); + + for (String path : pathList) { + System.out.println(pathList); + } + } + + @Test + void testJson2SheetWriter() throws Exception { + String jsonString = Files.readString(TEST_FILES.resolve("gdc_no_files1.json")); + JsonFlattener jflat = new JsonFlattener().json2Sheet(jsonString, "true"); + List objects = jflat.getJsonAsSheet(); + assertEquals(30, objects.size()); + + List rows = jflat.getJsonAsSpreadsheet(); + assertEquals(30, rows.size()); + } + + // Move to integration tests + @Disabled + void testCsvWriter() throws Exception { + String jsonString = Files.readString(TEST_FILES.resolve("gdc_no_files1.json")); + JsonFlattener jflat = new JsonFlattener(); + + List json2csv = jflat.json2Sheet(jsonString, "true").getJsonAsSpreadsheet(); + jflat.json2Sheet(jsonString, "true").write2csv("./jsonOutput"); + } +} diff --git a/src/test/java/bio/terra/cda/app/flatten/model/RowTest.java b/src/test/java/bio/terra/cda/app/flatten/model/RowTest.java new file mode 100644 index 00000000..2f2cc779 --- /dev/null +++ b/src/test/java/bio/terra/cda/app/flatten/model/RowTest.java @@ -0,0 +1,19 @@ +package bio.terra.cda.app.flatten.model; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +class RowTest { + + static final String row_content = + "TCGA-29-2435,Homo sapiens,female,white,not reported,-28779,Alive,,,8fa35df3-f544-4c47-bdd1-e4d6fc6662be,TCGA-OV"; + + @Test + void testRowCreation() throws Exception { + Object[] cells = row_content.split(","); + String row = Row.toSpreadsheetRow(cells); + + assertTrue(row.contains("Homo sapiens")); + } +} diff --git a/src/test/resources/csv_files/jsonOutput-7.csv b/src/test/resources/csv_files/jsonOutput-7.csv new file mode 100644 index 00000000..2eca3e01 --- /dev/null +++ b/src/test/resources/csv_files/jsonOutput-7.csv @@ -0,0 +1,29 @@ +id,species,sex,race,ethnicity,days_to_birth,vital_status,age_at_death,cause_of_death,id_1,member_of_research_project,primary_diagnosis_condition,primary_diagnosis_site,id_2,primary_diagnosis,age_at_diagnosis,morphology,stage,grade,method_of_diagnosis,identifier.system,identifier.value,subject_associated_project.0,ResearchSubject.id,ResearchSubject.member_of_research_project,ResearchSubject.primary_diagnosis_condition,ResearchSubject.primary_diagnosis_site,ResearchSubject.identifier.system,ResearchSubject.identifier.value,ResearchSubject.Diagnosis.id,ResearchSubject.Diagnosis.primary_diagnosis,ResearchSubject.Diagnosis.age_at_diagnosis,ResearchSubject.Diagnosis.morphology,ResearchSubject.Diagnosis.stage,ResearchSubject.Diagnosis.grade,ResearchSubject.Diagnosis.method_of_diagnosis,ResearchSubject.Diagnosis.identifier.system,ResearchSubject.Diagnosis.identifier.value,ResearchSubject.Diagnosis.Treatment.id,ResearchSubject.Diagnosis.Treatment.treatment_type,ResearchSubject.Diagnosis.Treatment.treatment_outcome,ResearchSubject.Diagnosis.Treatment.days_to_treatment_start,ResearchSubject.Diagnosis.Treatment.days_to_treatment_end,ResearchSubject.Diagnosis.Treatment.therapeutic_agent,ResearchSubject.Diagnosis.Treatment.treatment_anatomic_site,ResearchSubject.Diagnosis.Treatment.treatment_effect,ResearchSubject.Diagnosis.Treatment.treatment_end_reason,ResearchSubject.Diagnosis.Treatment.number_of_cycles,ResearchSubject.Diagnosis.Treatment.identifier.system,ResearchSubject.Diagnosis.Treatment.identifier.value,ResearchSubject.Specimen.id,ResearchSubject.Specimen.associated_project,ResearchSubject.Specimen.age_at_collection,ResearchSubject.Specimen.primary_disease_type,ResearchSubject.Specimen.anatomical_site,ResearchSubject.Specimen.source_material_type,ResearchSubject.Specimen.specimen_type,ResearchSubject.Specimen.derived_from_specimen,ResearchSubject.Specimen.derived_from_subject,ResearchSubject.Specimen.identifier.system,ResearchSubject.Specimen.identifier.value,identifier_1.system,identifier_1.value,Diagnosis.id,Diagnosis.primary_diagnosis,Diagnosis.age_at_diagnosis,Diagnosis.morphology,Diagnosis.stage,Diagnosis.grade,Diagnosis.method_of_diagnosis,Diagnosis.identifier.system,Diagnosis.identifier.value,Diagnosis.Treatment.id,Diagnosis.Treatment.treatment_type,Diagnosis.Treatment.treatment_outcome,Diagnosis.Treatment.days_to_treatment_start,Diagnosis.Treatment.days_to_treatment_end,Diagnosis.Treatment.therapeutic_agent,Diagnosis.Treatment.treatment_anatomic_site,Diagnosis.Treatment.treatment_effect,Diagnosis.Treatment.treatment_end_reason,Diagnosis.Treatment.number_of_cycles,Diagnosis.Treatment.identifier.system,Diagnosis.Treatment.identifier.value,Specimen.id,Specimen.associated_project,Specimen.age_at_collection,Specimen.primary_disease_type,Specimen.anatomical_site,Specimen.source_material_type,Specimen.specimen_type,Specimen.derived_from_specimen,Specimen.derived_from_subject,Specimen.identifier.system,Specimen.identifier.value,identifier_2.system,identifier_2.value,Treatment.id,Treatment.treatment_type,Treatment.treatment_outcome,Treatment.days_to_treatment_start,Treatment.days_to_treatment_end,Treatment.therapeutic_agent,Treatment.treatment_anatomic_site,Treatment.treatment_effect,Treatment.treatment_end_reason,Treatment.number_of_cycles,Treatment.identifier.system,Treatment.identifier.value +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,"GDC","TCGA-29-2435",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","GDC","8fa35df3-f544-4c47-bdd1-e4d6fc6662be",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,"GDC","dc8af98b-03cb-5817-84fa-d86a7f2df8c6",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c","Pharmaceutical Therapy, NOS",,,,,,,,,"GDC","ecd1e57a-8a3c-5591-9cc4-fd490f66f24c",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"68aece6e-2de6-506a-8190-7433a1f5b8eb","Radiation Therapy, NOS",,,,,,,,,"GDC","68aece6e-2de6-506a-8190-7433a1f5b8eb",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"a76ac995-782d-4ba3-a029-40f8d7d9642b","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Blood Derived Normal","sample","initial specimen","TCGA-29-2435","GDC","a76ac995-782d-4ba3-a029-40f8d7d9642b",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"c34bf82c-7b38-482a-bfe3-f2750f1a24bc","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Blood Derived Normal","portion","a76ac995-782d-4ba3-a029-40f8d7d9642b","TCGA-29-2435","GDC","c34bf82c-7b38-482a-bfe3-f2750f1a24bc",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"69a797dd-1083-4a83-a184-ec19f704d770","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","sample","initial specimen","TCGA-29-2435","GDC","69a797dd-1083-4a83-a184-ec19f704d770",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"84e1540d-c756-414e-92c9-3e0d5f45cd48","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","84e1540d-c756-414e-92c9-3e0d5f45cd48",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"49cf0c2e-45b3-4a61-97ad-8cae610313d0","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","49cf0c2e-45b3-4a61-97ad-8cae610313d0",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"169f0540-bdac-416d-b239-74b4804b140b","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","169f0540-bdac-416d-b239-74b4804b140b",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"3302664d-2406-4641-b54f-daf7400522b8","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","slide","169f0540-bdac-416d-b239-74b4804b140b","TCGA-29-2435","GDC","3302664d-2406-4641-b54f-daf7400522b8",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV","8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary",,,,,,,,,,,,,,,,,,,,,,,,"b317672c-b196-428f-9c3f-077fdd24e96e","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","slide","169f0540-bdac-416d-b239-74b4804b140b","TCGA-29-2435","GDC","b317672c-b196-428f-9c3f-077fdd24e96e",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"GDC","8fa35df3-f544-4c47-bdd1-e4d6fc6662be",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,"GDC","dc8af98b-03cb-5817-84fa-d86a7f2df8c6",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c","Pharmaceutical Therapy, NOS",,,,,,,,,"GDC","ecd1e57a-8a3c-5591-9cc4-fd490f66f24c",,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"68aece6e-2de6-506a-8190-7433a1f5b8eb","Radiation Therapy, NOS",,,,,,,,,"GDC","68aece6e-2de6-506a-8190-7433a1f5b8eb",,,,,,,,,,,,,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"a76ac995-782d-4ba3-a029-40f8d7d9642b","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Blood Derived Normal","sample","initial specimen","TCGA-29-2435","GDC","a76ac995-782d-4ba3-a029-40f8d7d9642b",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"c34bf82c-7b38-482a-bfe3-f2750f1a24bc","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Blood Derived Normal","portion","a76ac995-782d-4ba3-a029-40f8d7d9642b","TCGA-29-2435","GDC","c34bf82c-7b38-482a-bfe3-f2750f1a24bc",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"69a797dd-1083-4a83-a184-ec19f704d770","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","sample","initial specimen","TCGA-29-2435","GDC","69a797dd-1083-4a83-a184-ec19f704d770",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"84e1540d-c756-414e-92c9-3e0d5f45cd48","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","84e1540d-c756-414e-92c9-3e0d5f45cd48",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"49cf0c2e-45b3-4a61-97ad-8cae610313d0","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","49cf0c2e-45b3-4a61-97ad-8cae610313d0",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"169f0540-bdac-416d-b239-74b4804b140b","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","portion","69a797dd-1083-4a83-a184-ec19f704d770","TCGA-29-2435","GDC","169f0540-bdac-416d-b239-74b4804b140b",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"3302664d-2406-4641-b54f-daf7400522b8","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","slide","169f0540-bdac-416d-b239-74b4804b140b","TCGA-29-2435","GDC","3302664d-2406-4641-b54f-daf7400522b8",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"b317672c-b196-428f-9c3f-077fdd24e96e","TCGA-OV","-28779","Cystic, Mucinous and Serous Neoplasms",,"Primary Tumor","slide","169f0540-bdac-416d-b239-74b4804b140b","TCGA-29-2435","GDC","b317672c-b196-428f-9c3f-077fdd24e96e",,,,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"GDC","dc8af98b-03cb-5817-84fa-d86a7f2df8c6",,,,,,,,,,,, +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"ecd1e57a-8a3c-5591-9cc4-fd490f66f24c","Pharmaceutical Therapy, NOS",,,,,,,,,"GDC","ecd1e57a-8a3c-5591-9cc4-fd490f66f24c" +"TCGA-29-2435","Homo sapiens","female","white","not reported","-28779","Alive",,,"8fa35df3-f544-4c47-bdd1-e4d6fc6662be","TCGA-OV","Cystic, Mucinous and Serous Neoplasms","Ovary","dc8af98b-03cb-5817-84fa-d86a7f2df8c6","Serous cystadenocarcinoma, NOS","28779","8441/3",,"not reported",,,,"TCGA-OV",,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,"68aece6e-2de6-506a-8190-7433a1f5b8eb","Radiation Therapy, NOS",,,,,,,,,"GDC","68aece6e-2de6-506a-8190-7433a1f5b8eb" diff --git a/src/test/resources/json_files/gdc_no_files1.json b/src/test/resources/json_files/gdc_no_files1.json new file mode 100644 index 00000000..d097b2d5 --- /dev/null +++ b/src/test/resources/json_files/gdc_no_files1.json @@ -0,0 +1 @@ +{ "id": "TCGA-29-2435", "identifier": [{ "system": "GDC", "value": "TCGA-29-2435" }], "species": "Homo sapiens", "sex": "female", "race": "white", "ethnicity": "not reported", "days_to_birth": "-28779", "subject_associated_project": ["TCGA-OV"], "vital_status": "Alive", "age_at_death": null, "cause_of_death": null, "ResearchSubject": [{ "id": "8fa35df3-f544-4c47-bdd1-e4d6fc6662be", "identifier": [{ "system": "GDC", "value": "8fa35df3-f544-4c47-bdd1-e4d6fc6662be" }], "member_of_research_project": "TCGA-OV", "primary_diagnosis_condition": "Cystic, Mucinous and Serous Neoplasms", "primary_diagnosis_site": "Ovary", "Diagnosis": [{ "id": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6", "identifier": [{ "system": "GDC", "value": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6" }], "primary_diagnosis": "Serous cystadenocarcinoma, NOS", "age_at_diagnosis": "28779", "morphology": "8441/3", "stage": null, "grade": "not reported", "method_of_diagnosis": null, "Treatment": [{ "id": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c", "identifier": [{ "system": "GDC", "value": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c" }], "treatment_type": "Pharmaceutical Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }, { "id": "68aece6e-2de6-506a-8190-7433a1f5b8eb", "identifier": [{ "system": "GDC", "value": "68aece6e-2de6-506a-8190-7433a1f5b8eb" }], "treatment_type": "Radiation Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }] }], "Specimen": [{ "id": "a76ac995-782d-4ba3-a029-40f8d7d9642b", "identifier": [{ "system": "GDC", "value": "a76ac995-782d-4ba3-a029-40f8d7d9642b" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Blood Derived Normal", "specimen_type": "sample", "derived_from_specimen": "initial specimen", "derived_from_subject": "TCGA-29-2435" }, { "id": "c34bf82c-7b38-482a-bfe3-f2750f1a24bc", "identifier": [{ "system": "GDC", "value": "c34bf82c-7b38-482a-bfe3-f2750f1a24bc" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Blood Derived Normal", "specimen_type": "portion", "derived_from_specimen": "a76ac995-782d-4ba3-a029-40f8d7d9642b", "derived_from_subject": "TCGA-29-2435" }, { "id": "69a797dd-1083-4a83-a184-ec19f704d770", "identifier": [{ "system": "GDC", "value": "69a797dd-1083-4a83-a184-ec19f704d770" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "sample", "derived_from_specimen": "initial specimen", "derived_from_subject": "TCGA-29-2435" }, { "id": "84e1540d-c756-414e-92c9-3e0d5f45cd48", "identifier": [{ "system": "GDC", "value": "84e1540d-c756-414e-92c9-3e0d5f45cd48" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "49cf0c2e-45b3-4a61-97ad-8cae610313d0", "identifier": [{ "system": "GDC", "value": "49cf0c2e-45b3-4a61-97ad-8cae610313d0" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "169f0540-bdac-416d-b239-74b4804b140b", "identifier": [{ "system": "GDC", "value": "169f0540-bdac-416d-b239-74b4804b140b" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "3302664d-2406-4641-b54f-daf7400522b8", "identifier": [{ "system": "GDC", "value": "3302664d-2406-4641-b54f-daf7400522b8" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "slide", "derived_from_specimen": "169f0540-bdac-416d-b239-74b4804b140b", "derived_from_subject": "TCGA-29-2435" }, { "id": "b317672c-b196-428f-9c3f-077fdd24e96e", "identifier": [{ "system": "GDC", "value": "b317672c-b196-428f-9c3f-077fdd24e96e" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "slide", "derived_from_specimen": "169f0540-bdac-416d-b239-74b4804b140b", "derived_from_subject": "TCGA-29-2435" }] }], "id_1": "8fa35df3-f544-4c47-bdd1-e4d6fc6662be", "identifier_1": [{ "system": "GDC", "value": "8fa35df3-f544-4c47-bdd1-e4d6fc6662be" }], "member_of_research_project": "TCGA-OV", "primary_diagnosis_condition": "Cystic, Mucinous and Serous Neoplasms", "primary_diagnosis_site": "Ovary", "Diagnosis": [{ "id": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6", "identifier": [{ "system": "GDC", "value": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6" }], "primary_diagnosis": "Serous cystadenocarcinoma, NOS", "age_at_diagnosis": "28779", "morphology": "8441/3", "stage": null, "grade": "not reported", "method_of_diagnosis": null, "Treatment": [{ "id": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c", "identifier": [{ "system": "GDC", "value": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c" }], "treatment_type": "Pharmaceutical Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }, { "id": "68aece6e-2de6-506a-8190-7433a1f5b8eb", "identifier": [{ "system": "GDC", "value": "68aece6e-2de6-506a-8190-7433a1f5b8eb" }], "treatment_type": "Radiation Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }] }], "Specimen": [{ "id": "a76ac995-782d-4ba3-a029-40f8d7d9642b", "identifier": [{ "system": "GDC", "value": "a76ac995-782d-4ba3-a029-40f8d7d9642b" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Blood Derived Normal", "specimen_type": "sample", "derived_from_specimen": "initial specimen", "derived_from_subject": "TCGA-29-2435" }, { "id": "c34bf82c-7b38-482a-bfe3-f2750f1a24bc", "identifier": [{ "system": "GDC", "value": "c34bf82c-7b38-482a-bfe3-f2750f1a24bc" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Blood Derived Normal", "specimen_type": "portion", "derived_from_specimen": "a76ac995-782d-4ba3-a029-40f8d7d9642b", "derived_from_subject": "TCGA-29-2435" }, { "id": "69a797dd-1083-4a83-a184-ec19f704d770", "identifier": [{ "system": "GDC", "value": "69a797dd-1083-4a83-a184-ec19f704d770" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "sample", "derived_from_specimen": "initial specimen", "derived_from_subject": "TCGA-29-2435" }, { "id": "84e1540d-c756-414e-92c9-3e0d5f45cd48", "identifier": [{ "system": "GDC", "value": "84e1540d-c756-414e-92c9-3e0d5f45cd48" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "49cf0c2e-45b3-4a61-97ad-8cae610313d0", "identifier": [{ "system": "GDC", "value": "49cf0c2e-45b3-4a61-97ad-8cae610313d0" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "169f0540-bdac-416d-b239-74b4804b140b", "identifier": [{ "system": "GDC", "value": "169f0540-bdac-416d-b239-74b4804b140b" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "portion", "derived_from_specimen": "69a797dd-1083-4a83-a184-ec19f704d770", "derived_from_subject": "TCGA-29-2435" }, { "id": "3302664d-2406-4641-b54f-daf7400522b8", "identifier": [{ "system": "GDC", "value": "3302664d-2406-4641-b54f-daf7400522b8" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "slide", "derived_from_specimen": "169f0540-bdac-416d-b239-74b4804b140b", "derived_from_subject": "TCGA-29-2435" }, { "id": "b317672c-b196-428f-9c3f-077fdd24e96e", "identifier": [{ "system": "GDC", "value": "b317672c-b196-428f-9c3f-077fdd24e96e" }], "associated_project": "TCGA-OV", "age_at_collection": "-28779", "primary_disease_type": "Cystic, Mucinous and Serous Neoplasms", "anatomical_site": null, "source_material_type": "Primary Tumor", "specimen_type": "slide", "derived_from_specimen": "169f0540-bdac-416d-b239-74b4804b140b", "derived_from_subject": "TCGA-29-2435" }], "id_2": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6", "identifier_2": [{ "system": "GDC", "value": "dc8af98b-03cb-5817-84fa-d86a7f2df8c6" }], "primary_diagnosis": "Serous cystadenocarcinoma, NOS", "age_at_diagnosis": "28779", "morphology": "8441/3", "stage": null, "grade": "not reported", "method_of_diagnosis": null, "Treatment": [{ "id": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c", "identifier": [{ "system": "GDC", "value": "ecd1e57a-8a3c-5591-9cc4-fd490f66f24c" }], "treatment_type": "Pharmaceutical Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }, { "id": "68aece6e-2de6-506a-8190-7433a1f5b8eb", "identifier": [{ "system": "GDC", "value": "68aece6e-2de6-506a-8190-7433a1f5b8eb" }], "treatment_type": "Radiation Therapy, NOS", "treatment_outcome": null, "days_to_treatment_start": null, "days_to_treatment_end": null, "therapeutic_agent": null, "treatment_anatomic_site": null, "treatment_effect": null, "treatment_end_reason": null, "number_of_cycles": null }]}