Skip to content

Commit 2dd6c68

Browse files
authored
Support dbGaP IRB consent protocol (#1776)
Add irbConsentProtocol as dbGaP property Allow updates when submitted as part of a sample dbgap update message Signed-off-by: Angelica Ochoa <15623749+ao508@users.noreply.github.com>
1 parent b422ad8 commit 2dd6c68

File tree

4 files changed

+36
-6
lines changed

4 files changed

+36
-6
lines changed

model/src/main/java/org/mskcc/smile/model/DbGap.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@ public class DbGap implements Serializable {
1717
@Convert(UuidStringConverter.class)
1818
private UUID smileDbGapId;
1919
private String dbGapStudy;
20+
private String irbConsentProtocol;
2021

2122
public DbGap() {}
22-
23+
2324
public DbGap(DbGapJson dbGapJson) {
2425
this.dbGapStudy = dbGapJson.getDbGapStudy();
26+
this.irbConsentProtocol = dbGapJson.getIrbConsentProtocol();
2527
}
2628

2729
/**
@@ -35,7 +37,7 @@ public DbGap(String dbGapStudy) {
3537
public UUID getSmileDgGapId() {
3638
return smileDbGapId;
3739
}
38-
40+
3941
public void setSmileDgGapId(UUID smileDbGapId) {
4042
this.smileDbGapId = smileDbGapId;
4143
}
@@ -48,6 +50,14 @@ public void setDbGapStudy(String dbGapStudy) {
4850
this.dbGapStudy = dbGapStudy;
4951
}
5052

53+
public String getIrbConsentProtocol() {
54+
return irbConsentProtocol;
55+
}
56+
57+
public void setIrbConsentProtocol(String irbConsentProtocol) {
58+
this.irbConsentProtocol = irbConsentProtocol;
59+
}
60+
5161
@Override
5262
public String toString() {
5363
return ToStringBuilder.reflectionToString(this);

model/src/main/java/org/mskcc/smile/model/json/DbGapJson.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,21 @@ public class DbGapJson implements Serializable {
1111
private String primaryId;
1212
@JsonProperty("dbGapStudy")
1313
private String dbGapStudy;
14+
@JsonProperty("irbConsentProtocol")
15+
private String irbConsentProtocol;
1416

1517
public DbGapJson() {}
1618

17-
public DbGapJson(String primaryId, String dbGapStudy) {
19+
/**
20+
* DbGapJson constructor.
21+
* @param primaryId
22+
* @param dbGapStudy
23+
* @param irbConsentProtocol
24+
*/
25+
public DbGapJson(String primaryId, String dbGapStudy, String irbConsentProtocol) {
1826
this.primaryId = primaryId;
1927
this.dbGapStudy = dbGapStudy;
28+
this.irbConsentProtocol = irbConsentProtocol;
2029
}
2130

2231
public String getPrimaryId() {
@@ -35,6 +44,14 @@ public void setDbGapStudy(String dbGapStudy) {
3544
this.dbGapStudy = dbGapStudy;
3645
}
3746

47+
public String getIrbConsentProtocol() {
48+
return irbConsentProtocol;
49+
}
50+
51+
public void setIrbConsentProtocol(String irbConsentProtocol) {
52+
this.irbConsentProtocol = irbConsentProtocol;
53+
}
54+
3855
@Override
3956
public String toString() {
4057
return ToStringBuilder.reflectionToString(this);

persistence/src/main/java/org/mskcc/smile/persistence/neo4j/DbGapRepository.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ public interface DbGapRepository extends Neo4jRepository<DbGap, UUID> {
2626
@Query("""
2727
MATCH (s: Sample)-[:HAS_METADATA]->(sm: SampleMetadata {primaryId: $dbGap.primaryId})
2828
MERGE (s)-[:HAS_DBGAP]->(d: DbGap)
29-
SET d.dbGapStudy = $dbGap.dbGapStudy, d.smileDbGapId = $smileDbGapId
29+
SET d.dbGapStudy = $dbGap.dbGapStudy, d.smileDbGapId = $smileDbGapId,
30+
d.irbConsentProtocol = $dbGap.irbConsentProtocol
3031
RETURN DISTINCT d
3132
""")
3233
DbGap updateDbGap(@Param("smileDbGapId") UUID smileDbGapId, @Param("dbGap") DbGapJson dbGap);

service/src/test/java/org/mskcc/smile/service/DbGapServiceTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,16 +122,18 @@ public void testDbGapMerge() throws Exception {
122122
Assertions.assertTrue(sampleService.sampleExistsByInputId(samplePrimaryId));
123123

124124
// now test save and fetch of dbgap node
125-
DbGapJson dbGapJson = new DbGapJson(samplePrimaryId, "mockDbgapStudyId.v1");
125+
DbGapJson dbGapJson = new DbGapJson(samplePrimaryId, "mockDbgapStudyId.v1", "IRB-123456");
126126
dbGapService.updateDbGap(dbGapJson);
127127
DbGap dbGapNode = dbGapService.getDbGapBySamplePrimaryId(samplePrimaryId);
128128
Assertions.assertEquals("mockDbgapStudyId.v1", dbGapNode.getDbGapStudy());
129+
Assertions.assertEquals("IRB-123456", dbGapNode.getIrbConsentProtocol());
129130

130131
//pretend that the dbgap study is updated to v2
131-
DbGapJson dbGapJson2 = new DbGapJson(samplePrimaryId, "mockDbgapStudyId.v2");
132+
DbGapJson dbGapJson2 = new DbGapJson(samplePrimaryId, "mockDbgapStudyId.v2", "IRB-123456");
132133
dbGapService.updateDbGap(dbGapJson2);
133134
DbGap dbGapNode2 = dbGapService.getDbGapBySamplePrimaryId(samplePrimaryId);
134135
Assertions.assertEquals("mockDbgapStudyId.v2", dbGapNode2.getDbGapStudy());
136+
Assertions.assertEquals("IRB-123456", dbGapNode.getIrbConsentProtocol());
135137
Assertions.assertEquals(dbGapNode.getSmileDgGapId(), dbGapNode2.getSmileDgGapId());
136138
}
137139
}

0 commit comments

Comments
 (0)