Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KPMP-5566_add-more-participant-info-to-endpoint #153

Merged
merged 3 commits into from
Oct 31, 2024
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
42 changes: 42 additions & 0 deletions src/main/java/org/kpmp/participant/ParticipantClinicalDataset.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ public class ParticipantClinicalDataset implements Serializable{
private String race;
@Column(name = "age_binned")
private String ageBinned;
@Column(name = "tissue_source")
private String tissueSource;
@Column(name = "protocol")
private String protocol;
@Column(name = "sample_type")
private String sampleType;
@Column(name = "sex")
private String sex;


public int getParticipantClinicalId() {
Expand Down Expand Up @@ -153,5 +161,39 @@ public void setAgeBinned(String ageBinned) {
this.ageBinned = ageBinned;
}


public String getTissueSource() {
return this.tissueSource;
}

public void setTissueSource(String tissueSource) {
this.tissueSource = tissueSource;
}

public String getProtocol() {
return this.protocol;
}

public void setProtocol(String protocol) {
this.protocol = protocol;
}

public String getSampleType() {
return this.sampleType;
}

public void setSampleType(String sampleType) {
this.sampleType = sampleType;
}

public String getSex() {
return this.sex;
}

public void setSex(String sex) {
this.sex = sex;
}


}

Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ public interface ParticipantClinicalDatasetRepository extends CrudRepository<Par
"pc.hypertension_duration, " +
"pc.on_raas_blockade," +
"pc.race, " +
"p.age_binned " +
"p.age_binned, " +
"p.sex," +
"p.tissue_source, " +
"p.protocol, " +
"p.sample_type " +
"from participant_clinical pc join participant p on pc.participant_id = p.participant_id where pc.participant_id = :participantId ", nativeQuery = true)
ParticipantClinicalDataset findByParticipantId(@Param("participantId") Integer participantId);

Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/graphql/knowledge_environment.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -238,4 +238,8 @@ type ParticipantClinicalDataset {
onRaasBlockade: String
race: String
ageBinned: String
sex: String
sampleType: String
tissueSource: String
protocol: String
}
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,27 @@ void testSetAgeBinned() {
assertEquals("age-age2", participantClinicalDataset.getAgeBinned());
}

@Test
void testSetTissueSource() {
participantClinicalDataset.setTissueSource("tissue");
assertEquals("tissue", participantClinicalDataset.getTissueSource());
}

@Test
void testSetProtocol() {
participantClinicalDataset.setProtocol("protocol");
assertEquals("protocol", participantClinicalDataset.getProtocol());
}

@Test
void testSetSampleType() {
participantClinicalDataset.setSampleType("Sample");
assertEquals("Sample", participantClinicalDataset.getSampleType());
}

@Test
void testSetSex() {
participantClinicalDataset.setSex("male");
assertEquals("male", participantClinicalDataset.getSex());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ public void testGetParticipantClincialDataset() throws Exception {
expectedResult.setProteinuria("proteinuria");
expectedResult.setRace("alien from outer space");
expectedResult.setAgeBinned("age");
expectedResult.setTissueSource("tissueSource");
expectedResult.setProtocol("protocol");
expectedResult.setSampleType("sample");
expectedResult.setSex("sex");



when(participantSummaryDatasetRepository.findIdByRedcapId(newPart.getRedcapId())).thenReturn(newPart.getParticipantId());
Expand All @@ -94,6 +99,10 @@ public void testGetParticipantClincialDataset() throws Exception {
assertEquals("proteinuria", result.getProteinuria());
assertEquals("alien from outer space", result.getRace());
assertEquals("age", result.getAgeBinned());
assertEquals("tissueSource", result.getTissueSource());
assertEquals("protocol", result.getProtocol());
assertEquals("sex", result.getSex());
assertEquals("sample", result.getSampleType());
}

@Test
Expand Down
Loading