From 50b8f85376c4c5bf98a351aa8fc870bfd1711d79 Mon Sep 17 00:00:00 2001 From: Ryan Amari Date: Wed, 20 Nov 2024 12:31:39 -0500 Subject: [PATCH] Changes from code review --- .../hms/dbmi/avillach/hpds/processing/io/PfbWriter.java | 1 - .../avillach/hpds/processing/upload/SignUrlService.java | 9 +++------ .../avillach/hpds/processing/dictionary/ConceptTest.java | 2 -- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java index 20868cbb..55e8e3c7 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/io/PfbWriter.java @@ -138,7 +138,6 @@ private void writeDataDictionary() { .collect(Collectors.toMap(Concept::conceptPath, Function.identity())); } catch (RuntimeException e) { log.error("Error fetching concepts from dictionary service", e); - return; } for (int i = 0; i < formattedFields.size(); i++) { diff --git a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java index 6c1c66c4..d6d950f3 100644 --- a/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java +++ b/processing/src/main/java/edu/harvard/hms/dbmi/avillach/hpds/processing/upload/SignUrlService.java @@ -26,8 +26,6 @@ public class SignUrlService { private final int signedUrlExpiryMinutes; private final Region region; - private final S3Client s3; - private static Logger log = LoggerFactory.getLogger(SignUrlService.class); @Autowired @@ -39,13 +37,12 @@ public SignUrlService( this.bucketName = bucketName; this.signedUrlExpiryMinutes = signedUrlExpiryMinutes; this.region = Region.of(region); - - s3 = S3Client.builder() - .region(this.region) - .build(); } public void uploadFile(File file, String objectKey) { + S3Client s3 = S3Client.builder() + .region(this.region) + .build(); putS3Object(s3, bucketName, objectKey, file); s3.close(); } diff --git a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/dictionary/ConceptTest.java b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/dictionary/ConceptTest.java index e391e126..a9dd4b4e 100644 --- a/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/dictionary/ConceptTest.java +++ b/processing/src/test/java/edu/harvard/hms/dbmi/avillach/hpds/processing/dictionary/ConceptTest.java @@ -17,8 +17,6 @@ public void jsonSerialization() throws JsonProcessingException { ObjectMapper objectMapper = new ObjectMapper(); String serialized = objectMapper.writeValueAsString(concepts); - //String serialized = "[{\"type\":\"Categorical\",\"conceptPath\":\"\\\\phs003578\\\\AGE_CAT\\\\\",\"name\":\"AGE_CAT\",\"display\":\"Participant age, 4 categories\",\"dataset\":\"phs003578\",\"description\":\"Participant age, 4 categories\",\"values\":[\"16-29 years\",\"30-49 years\",\"50-64 years\",\"65+ years\"],\"allowFiltering\":true,\"studyAcronym\":\"RESPONSE\",\"children\":null,\"meta\":{\"values\":\"[\\\"16-29 years\\\",\\\"30-49 years\\\",\\\"50-64 years\\\",\\\"65+ years\\\"]\",\"description\":\"Participant age, 4 categories\",\"drs_uri\":\"[\\\"drs://dg.4503:dg.4503%2F0aa2fcab-5a40-40d9-86b5-ba42f3b71ab0\\\"]\",\"stigmatized\":\"false\"},\"table\":null,\"study\":{\"ref\":\"phs003578\",\"fullName\":\"REDS-IV-P Epidemiology, Surveillance and Preparedness of the Novel SARS-CoV-2 Epidemic\",\"abbreviation\":\"RESPONSE\",\"description\":\"Leveraging access to the blood supply and blood donors, the REDS-IV-P program began conducting the RESPONSE study (REDS-IV-P Epidemiology, Surveillance and Preparedness of the Novel SARS-CoV-2 Epidemic) in early 2020 in order to 1) evaluate if SARS-CoV-2 RNA was found in blood donations in the U.S. using an assay that could potentially be used to screen the blood supply if evidence of SARS-CoV-2 transfusion-transmission became apparent 2) conduct serosurveys using optimized assays/algorithms to monitor antibody reactivity in blood donor populations over time, 3) enroll SARS-CoV-2 positive donors and others into a longitudinal cohort study to answer fundamental questions about the evolution of viremia and immune responses, and 4) establish a sharable biorepository that includes specimens collected early on in the infection and potentially large volumes of plasma from infected/convalescent donors.Screening for SARS-CoV-2 RNAemia was completed using a SARS-CoV-2 nucleic acid test (NAT) performed on retained blood donor minipool samples from six geographic regions in the US. The study also included serosurveillance (i.e. testing for antibody directed against the SARS-CoV2 spike protein) of donations from the same six regions to document accruing seroincidence in blood donor populations and to project these rates in the general population. To enrich for donors with acute SARS-CoV-2 infection, another part of the study focused on donors reporting post-donation information (PDI) consistent with COVID-19 by testing plasma from all available PDI donations for SARS-CoV-2 RNA by NAT. Subjects who were diagnosed with COVID-19 based on PDI reports or who tested positive by SARS-CoV-2 NAT on index donation plasma were enrolled into a longitudinal follow-up study which collected multiple samples for up to one-year post-infection. The longitudinal follow-up study also enrolled community members who reported a new positive SARS-CoV-2 NAT test in the prior 7-14 days.The specific aims of the RESPONSE study were to:1. Establish the incidence of SARS-CoV-2 RNAemia in blood donations from the American Red Cross (ARC) regions in Los Angeles, Boston, and Minneapolis metropolitan areas, Bloodworks Northwest (BWNW), New York Blood Center (NYBC), and Vitalant San Francisco Bay Area, monthly between March and September of 20202. Conduct serosurveys to study antibody reactivity in same six areas as above monthly for March to August 20203. Document rates of Post Donation Information (PDI) reports to determine PDI rates relevant to SARS-CoV-2 clinical disease and test index donation plasma from PDI donors for SARS-CoV-2 RNA4. Enroll SARS-CoV-2 infected subjects into a longitudinal cohort study to answer fundamental questions on the evolution of viremia, early immune responses and waning of immunity over 3-12 months of follow-up5. Establish a sharable biorepository of samples from all of the above Aims for future researchThe data from Aims 3 and 4 above is being made available in BioData Catalyst.\",\"meta\":{\"study_link\":\"https://www.ncbi.nlm.nih.gov/projects/gap/cgi-bin/study.cgi?study_id=phs003578.v1.p1\",\"phase\":\"p1\",\"sponsor\":\"National Heart, Lung, and Blood Institute\",\"study_accession\":\"phs003578.v1.p1\",\"study_design\":\"Prospective Longitudinal Cohort\",\"data_type\":\"P\",\"study_focus\":\"SARS-CoV-2\",\"version\":\"v1\"}},\"type\":\"Categorical\"}]"; - Concept[] deserialized = objectMapper.readValue(serialized, Concept[].class); assertEquals(List.of(concepts), List.of(deserialized));