Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DEVNOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Or, if not using docker:
java -jar /path/to/consent.jar server /path/to/config/file
```

Visit local swagger page: https://local.dsde-dev.broadinstitute.org:27443/swagger/
Visit local swagger page: https://local.dsde-dev.broadinstitute.org:27443

### Debugging

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public static DataAccessRequest populateProgressReportFromJsonString(
originalDataCopy.setExternalCollaborators(newData.getExternalCollaborators());
originalDataCopy.setLabCollaborators(newData.getLabCollaborators());
originalDataCopy.setProgressReportSummary(newData.getProgressReportSummary());
originalDataCopy.setIntellectualProperties(newData.getIntellectualProperties());
originalDataCopy.setIntellectualProperty(newData.getIntellectualProperty());
originalDataCopy.setPublications(newData.getPublications());
originalDataCopy.setPresentations(newData.getPresentations());
originalDataCopy.setDmi(newData.getDmi());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public class DataAccessRequestData {

// Progress Report/Closeout Fields
private String progressReportSummary;
private List<IntellectualProperty> intellectualProperties;
private List<IntellectualProperty> intellectualProperty;
private List<Publication> publications;
private List<Presentation> presentations;
private DataManagementIncident dmi;
Expand Down Expand Up @@ -709,12 +709,12 @@ public void setProgressReportSummary(String progressReportSummary) {
this.progressReportSummary = progressReportSummary;
}

public List<IntellectualProperty> getIntellectualProperties() {
return intellectualProperties;
public List<IntellectualProperty> getIntellectualProperty() {
return intellectualProperty;
}

public void setIntellectualProperties(List<IntellectualProperty> intellectualProperties) {
this.intellectualProperties = intellectualProperties;
public void setIntellectualProperty(List<IntellectualProperty> intellectualProperty) {
this.intellectualProperty = intellectualProperty;
}

public List<Publication> getPublications() {
Expand Down
9 changes: 9 additions & 0 deletions src/main/resources/assets/schemas/Author.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
description: An Author object.
properties:
name:
type: string
description: The author's name.
orcId:
type: string
description: The author's ORCID identifier.
8 changes: 5 additions & 3 deletions src/main/resources/assets/schemas/DataAccessRequest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,11 @@ properties:
progressReportSummary:
type: string
description: A Progress Report Summary.
intellectualPropertySummary:
type: string
description: An Intellectual Property Summary.
intellectualProperty:
type: array
description: An array of intellectual property.
items:
$ref: './IntellectualProperty.yaml'
publications:
type: array
description: An array of publications.
Expand Down
41 changes: 41 additions & 0 deletions src/main/resources/assets/schemas/IntellectualProperty.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
type: object
description: An Intellectual Property object.
properties:
type:
type: string
description: The type of intellectual property.
title:
type: string
description: The title of the intellectual property.
date:
type: string
description: The date associated with the intellectual property.
assignee:
type: string
description: The assignee of the intellectual property.
patentNumber:
type: string
description: The patent number.
filingDate:
type: boolean
description: The filing date indicator.
status:
type: string
description: The status of the intellectual property.
url:
type: string
description: The URL associated with the intellectual property.
contact:
type: string
description: The contact information for the intellectual property.
ipId:
type: string
description: The unique identifier for the intellectual property.
studyId:
type: string
description: The study ID associated with the intellectual property.
tags:
type: array
items:
type: string
description: Tags associated with the intellectual property.
32 changes: 29 additions & 3 deletions src/main/resources/assets/schemas/Presentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ properties:
title:
type: string
description: The title of the presentation.
link:
url:
type: string
description: The link to the presentation.
description: The URL to the presentation.
date:
type: string
format: date
description: The presentation date.
authors:
type: string
Expand All @@ -20,3 +19,30 @@ properties:
citation:
type: boolean
description: Indicates if the dataset(s) were cited in the Presentation.
presentationId:
type: string
description: The unique identifier for the presentation.
studyId:
type: string
description: The study ID associated with the presentation.
presenter:
allOf:
- $ref: './Presenter.yaml'
- description: The presenter information.
event:
type: string
description: The event name.
location:
type: string
description: The location of the presentation.
format:
type: string
description: The format of the presentation.
access:
type: string
description: The access level of the presentation.
tags:
type: array
items:
type: string
description: Tags associated with the presentation.
9 changes: 9 additions & 0 deletions src/main/resources/assets/schemas/Presenter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
type: object
description: A Presenter object.
properties:
name:
type: string
description: The presenter's name.
email:
type: string
description: The presenter's email address.
30 changes: 27 additions & 3 deletions src/main/resources/assets/schemas/Publication.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ properties:
pubmedId:
type: string
description: The PubMed ID of the publication.
date:
publishedDate:
type: string
format: date
description: The publication date.
authors:
type: string
type: array
items:
$ref: './Author.yaml'
description: The authors of the publication.
bibliographicCitation:
type: string
Expand All @@ -23,3 +24,26 @@ properties:
citation:
type: boolean
description: Indicates if the dataset(s) were cited in the Publication.
publicationId:
type: string
description: The unique identifier for the publication.
studyId:
type: string
description: The study ID associated with the publication.
journal:
type: string
description: The journal name.
doi:
type: string
description: The Digital Object Identifier.
url:
type: string
description: The URL to the publication.
access:
type: string
description: The access level of the publication.
tags:
type: array
items:
type: string
description: Tags associated with the publication.
2 changes: 2 additions & 0 deletions src/main/resources/changelog-master.xml
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,6 @@
relativeToChangelogFile="true" />
<include file="changesets/changelog-consent-2025-12-02-alter-dataset-name-column.xml"
relativeToChangelogFile="true" />
<include file="changesets/changelog-consent-2025-12-05-migrate-ip-presentations-publications.xml"
relativeToChangelogFile="true" />
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd">
<changeSet id="changelog-consent-2025-12-05-migrate-intellectual-property-summary" author="kevinmarete">
<comment>
Migrate intellectualPropertySummary to intellectualProperty array format.
Transforms the summary field into an array with a title object.
</comment>
<sql>
UPDATE data_access_request
SET data = jsonb_set(
data #- '{intellectualPropertySummary}',
'{intellectualProperty}',
jsonb_build_array(
jsonb_build_object('title', data -> 'intellectualPropertySummary')
)
)
WHERE parent_id IS NOT NULL
AND data -> 'intellectualPropertySummary' IS NOT NULL
AND data -> 'ipId' IS NULL;
</sql>
</changeSet>

<changeSet id="changelog-consent-2025-12-05-migrate-presentations-link-to-url" author="kevinmarete">
<comment>
Migrate presentations link field to url field in data_access_request table.
Removes the link field and sets the url field with the link value.
</comment>
<sql>
UPDATE data_access_request
SET data = jsonb_set(
data #- '{presentations,0,link}',
'{presentations,0,url}',
data -> 'presentations' -> 0 -> 'link'
)
WHERE parent_id IS NOT NULL
AND jsonb_typeof(data -> 'presentations') = 'array'
AND data -> 'presentations' -> 0 -> 'link' IS NOT NULL
AND data -> 'presentations' -> 0 -> 'url' IS NULL;
</sql>
</changeSet>

<changeSet id="changelog-consent-2025-12-05-migrate-publications-authors-and-dates" author="kevinmarete">
<comment>
Migrate publications authors from string to array format and rename date to publishedDate.
Splits comma-separated authors into individual author objects.
</comment>
<sql splitStatements="false">
UPDATE data_access_request
SET data = jsonb_set(
data,
'{publications}',
(
SELECT jsonb_agg(
CASE
WHEN jsonb_typeof(pub -&gt; 'authors') = 'string'
THEN (
pub
|| jsonb_build_object(
'authors',
(
SELECT jsonb_agg(jsonb_build_object('name', author_name))
FROM regexp_split_to_table(pub -&gt;&gt; 'authors', ',') AS author_name
)
)
|| (CASE WHEN pub -&gt; 'date' IS NOT NULL AND pub -&gt; 'publishedDate' IS NULL
THEN jsonb_build_object('publishedDate', pub -&gt; 'date')
ELSE '{}'::jsonb END)
#- (CASE WHEN pub -&gt; 'date' IS NOT NULL AND pub -&gt; 'publishedDate' IS NULL
THEN '{date}'::text[]
ELSE '{}'::text[] END)
)
ELSE pub
|| (CASE WHEN pub -&gt; 'date' IS NOT NULL AND pub -&gt; 'publishedDate' IS NULL
THEN jsonb_build_object('publishedDate', pub -&gt; 'date')
ELSE '{}'::jsonb END)
#- (CASE WHEN pub -&gt; 'date' IS NOT NULL AND pub -&gt; 'publishedDate' IS NULL
THEN '{date}'::text[]
ELSE '{}'::text[] END)
END
)
FROM jsonb_array_elements(data -&gt; 'publications') AS pub
)
)
WHERE parent_id IS NOT NULL
AND jsonb_typeof(data -&gt; 'publications') = 'array'
AND EXISTS (
SELECT 1 FROM jsonb_array_elements(data -&gt; 'publications') AS pub
WHERE jsonb_typeof(pub -&gt; 'authors') = 'string'
OR (pub -&gt; 'date' IS NOT NULL AND pub -&gt; 'publishedDate' IS NULL)
);
</sql>
</changeSet>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ private DataAccessRequest generateProgressReport() {
progressReport.getData().setProgressReportSummary("Progress Report Summary");
progressReport
.getData()
.setIntellectualProperties(
.setIntellectualProperty(
List.of(
new IntellectualProperty(
"Patent",
Expand Down
Loading