Skip to content

Commit

Permalink
Merge pull request #251 from opencb/TASK-5198
Browse files Browse the repository at this point in the history
TASK-5198 - Catalog changes to improve Clinical reports
  • Loading branch information
pfurio authored Dec 1, 2023
2 parents f9db370 + 06e8bc5 commit 914c9fc
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import org.opencb.biodata.models.constants.FieldConstants;
import org.opencb.commons.annotations.DataField;

import java.util.Map;

public class ClinicalAnalyst {

@DataField(id = "id", indexed = true,
Expand All @@ -17,23 +19,23 @@ public class ClinicalAnalyst {
description = FieldConstants.CLINICAL_ANALYST_EMAIL_DESCRIPTION)
private String email;

@DataField(id = "assignedBy", indexed = true,
description = FieldConstants.CLINICAL_ANALYST_ASSIGNED_BY_DESCRIPTION)
private String assignedBy;
@DataField(id = "role", indexed = true,
description = FieldConstants.CLINICAL_ANALYST_ROLE_DESCRIPTION)
private String role;

@DataField(id = "date", indexed = true,
description = FieldConstants.CLINICAL_ANALYST_DATE_DESCRIPTION)
private String date;
@DataField(id = "attributes", indexed = true,
description = FieldConstants.CLINICAL_ANALYST_ATTRIBUTES_DESCRIPTION)
private Map<String, Object> attributes;

public ClinicalAnalyst() {
}

public ClinicalAnalyst(String id, String name, String email, String assignedBy, String date) {
public ClinicalAnalyst(String id, String name, String email, String role, Map<String, Object> attributes) {
this.id = id;
this.name = name;
this.email = email;
this.assignedBy = assignedBy;
this.date = date;
this.role = role;
this.attributes = attributes;
}

@Override
Expand All @@ -42,8 +44,8 @@ public String toString() {
sb.append("id='").append(id).append('\'');
sb.append(", name='").append(name).append('\'');
sb.append(", email='").append(email).append('\'');
sb.append(", assignedBy='").append(assignedBy).append('\'');
sb.append(", date='").append(date).append('\'');
sb.append(", role='").append(role).append('\'');
sb.append(", attributes=").append(attributes);
sb.append('}');
return sb.toString();
}
Expand Down Expand Up @@ -75,21 +77,21 @@ public ClinicalAnalyst setEmail(String email) {
return this;
}

public String getAssignedBy() {
return assignedBy;
public String getRole() {
return role;
}

public ClinicalAnalyst setAssignedBy(String assignedBy) {
this.assignedBy = assignedBy;
public ClinicalAnalyst setRole(String role) {
this.role = role;
return this;
}

public String getDate() {
return date;
public Map<String, Object> getAttributes() {
return attributes;
}

public ClinicalAnalyst setDate(String date) {
this.date = date;
public ClinicalAnalyst setAttributes(Map<String, Object> attributes) {
this.attributes = attributes;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class ClinicalVariant extends Variant {
private List<ClinicalVariantEvidence> evidences;
private List<ClinicalComment> comments;
private Map<String, Object> filters;
private String recommendation;
private List<MiniPubmed> references;
private ClinicalDiscussion discussion;
private ClinicalVariantConfidence confidence;
private List<String> tags;
Expand Down Expand Up @@ -76,6 +78,7 @@ public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences
this.attributes = attributes;
}

@Deprecated
public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences, List<ClinicalComment> comments,
Map<String, Object> filters, ClinicalDiscussion discussion,
ClinicalVariantConfidence confidence, Status status, List<String> tags,
Expand All @@ -92,12 +95,32 @@ public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences
this.attributes = attributes;
}

public ClinicalVariant(VariantAvro avro, List<ClinicalVariantEvidence> evidences, List<ClinicalComment> comments,
Map<String, Object> filters, String recommendation, List<MiniPubmed> references,
ClinicalDiscussion discussion, ClinicalVariantConfidence confidence, Status status,
List<String> tags, Map<String, Object> attributes) {
super(avro);

this.evidences = evidences;
this.comments = comments;
this.filters = filters;
this.recommendation = recommendation;
this.references = references;
this.discussion = discussion;
this.status = status;
this.tags = tags;
this.confidence = confidence;
this.attributes = attributes;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("ClinicalVariant{");
sb.append("evidences=").append(evidences);
sb.append(", comments=").append(comments);
sb.append(", filters=").append(filters);
sb.append(", recommendation='").append(recommendation).append('\'');
sb.append(", references=").append(references);
sb.append(", discussion=").append(discussion);
sb.append(", confidence=").append(confidence);
sb.append(", tags=").append(tags);
Expand Down Expand Up @@ -134,6 +157,24 @@ public ClinicalVariant setFilters(Map<String, Object> filters) {
return this;
}

public String getRecommendation() {
return recommendation;
}

public ClinicalVariant setRecommendation(String recommendation) {
this.recommendation = recommendation;
return this;
}

public List<MiniPubmed> getReferences() {
return references;
}

public ClinicalVariant setReferences(List<MiniPubmed> references) {
this.references = references;
return this;
}

public ClinicalDiscussion getDiscussion() {
return discussion;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
package org.opencb.biodata.models.clinical.interpretation;

public class MiniPubmed {

private String id;
private String name;
private String journal;
private String summary;
private String date;
private String url;

public MiniPubmed() {
}

public MiniPubmed(String id, String name, String summary, String date, String url, String journal) {
this.id = id;
this.name = name;
this.summary = summary;
this.date = date;
this.url = url;
this.journal = journal;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("MiniPubmed{");
sb.append("id='").append(id).append('\'');
sb.append(", name='").append(name).append('\'');
sb.append(", summary='").append(summary).append('\'');
sb.append(", date=").append(date);
sb.append(", url='").append(url).append('\'');
sb.append(", journal='").append(journal).append('\'');
sb.append('}');
return sb.toString();
}

public String getId() {
return id;
}

public MiniPubmed setId(String id) {
this.id = id;
return this;
}

public String getName() {
return name;
}

public MiniPubmed setName(String name) {
this.name = name;
return this;
}

public String getSummary() {
return summary;
}

public MiniPubmed setSummary(String summary) {
this.summary = summary;
return this;
}

public String getDate() {
return date;
}

public MiniPubmed setDate(String date) {
this.date = date;
return this;
}

public String getUrl() {
return url;
}

public MiniPubmed setUrl(String url) {
this.url = url;
return this;
}

public String getJournal() {
return journal;
}

public MiniPubmed setJournal(String journal) {
this.journal = journal;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ public class FieldConstants {
public static final String RELATEDNESS_REPORT_SCORES_DESCRIPTION = "Relatedness scores for pair of samples";
public static final String RELATEDNESS_REPORT_FILES_DESCRIPTION = "List of files of Relatedness Report";

public static final String CLINICAL_ANALYST_DATE_DESCRIPTION = "Date of the clinical analyst";
public static final String CLINICAL_ANALYST_ASSIGNED_BY_DESCRIPTION = "Assigned by field";
public static final String CLINICAL_ANALYST_ROLE_DESCRIPTION = "Analyst role";
public static final String CLINICAL_ANALYST_ATTRIBUTES_DESCRIPTION = "Analyst attributes";

public static final String CLINICAL_ANALYST_EMAIL_DESCRIPTION = "Email of the analyst";
public static final String AUDIT_AUTHOR_DESCRIPTION = "Audit author";
Expand Down

0 comments on commit 914c9fc

Please sign in to comment.