Commit 4c4030ac authored by javi's avatar javi
Browse files

add more data to json

parent 3dd333b9
Pipeline #16398 passed with stage
in 2 minutes and 20 seconds
......@@ -8,8 +8,11 @@ import java.nio.file.DirectoryStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
......@@ -206,8 +209,8 @@ public class App {
JsonObject section = new JsonObject();
section.addProperty("name", "document");
Set<String> types = Stream.of("FINDING","SEX","SPECIMEN","GROUP","DOSE","MANIFESTATION_FINDING","RISK_LEVEL","NO_TREATMENT_RELATED_TRIGGER",
"TREATMENT_RELATED_TRIGGER","STUDY_DOMAIN","STUDY_DAY_FINDING","STUDY_TESTCD", "ROUTE_OF_ADMINISTRATION","MODE_OF_ACTION","STATISTICAL_SIGNIFICANCE","CYPS").collect(Collectors.toCollection(HashSet::new));
Set<String> types = Stream.of("PRETOX_REL","FINDING","SEX","SPECIMEN","GROUP","DOSE","MANIFESTATION_FINDING","RISK_LEVEL","NO_TREATMENT_RELATED_TRIGGER",
"TREATMENT_RELATED_TRIGGER","STUDY_DOMAIN","STUDY_DAY_FINDING","STUDY_TESTCD", "STATISTICAL_SIGNIFICANCE").collect(Collectors.toCollection(HashSet::new));
JsonObject entities = new JsonObject();
AnnotationSet as = doc.getAnnotations(annotationSet).get(types);
for (String type : as.getAllTypes()) {
......@@ -289,9 +292,13 @@ public class App {
annotated_document=null;
//document text
DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
Date date = new Date();
JsonObject text_document = new JsonObject();
text_document.addProperty("id", id_document);
text_document.addProperty("name", name);
text_document.addProperty("fileName", name);
text_document.addProperty("processDate", dateFormat.format(date));
text_document.addProperty("text", plainText);
//write to file document text
java.io.Writer writer2 = new java.io.BufferedWriter(new java.io.OutputStreamWriter(new FileOutputStream(outputTextFile, false)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment