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

TissueList Assignees for prod #326

Merged
merged 2 commits into from
Dec 9, 2021
Merged
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
14 changes: 9 additions & 5 deletions src/main/java/org/broadinstitute/dsm/model/TissueList.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@Data
public class TissueList {
public static final Logger logger = LoggerFactory.getLogger(TissueList.class);
public static final String SQL_SELECT_ALL_ONC_HISTORY_TISSUE_FOR_REALM = "SELECT p.ddp_participant_id," +
public static final String SQL_SELECT_ALL_ONC_HISTORY_TISSUE_FOR_REALM = "SELECT p.ddp_participant_id, p.participant_id, " +
"oD.onc_history_detail_id, oD.request, oD.deleted, oD.fax_sent, oD.tissue_received, oD.medical_record_id, oD.date_px, oD.type_px, " +
"oD.location_px, oD.histology, oD.accession_number, oD.facility, oD.phone, oD.fax, oD.notes, oD.additional_values_json, " +
"oD.request, oD.fax_sent, oD.fax_sent_by, oD.fax_confirmed, oD.fax_sent_2, oD.fax_sent_2_by, oD.fax_confirmed_2, oD.fax_sent_3, " +
Expand All @@ -37,11 +37,13 @@ public class TissueList {
private OncHistoryDetail oncHistoryDetails;
private Tissue tissue;
private String ddpParticipantId;
private String participantId;

public TissueList(OncHistoryDetail OncHistoryDetails, Tissue tissue, String ddpParticipantId) {
public TissueList(OncHistoryDetail OncHistoryDetails, Tissue tissue, String ddpParticipantId, String participantId) {
this.oncHistoryDetails = OncHistoryDetails;
this.tissue = tissue;
this.ddpParticipantId = ddpParticipantId;
this.participantId = participantId;

}

Expand All @@ -57,12 +59,14 @@ public static List<TissueList> getAllTissueListsForRealm(String realm, String qu
stmt.setString(1, realm);
try (ResultSet rs = stmt.executeQuery()) {
OncHistoryDetail oncHistory = null;
String ptId = null;
String ddpParticipantId = null;
String participantId = null;
while (rs.next()) {
oncHistory = OncHistoryDetail.getOncHistoryDetail(rs);
ptId = rs.getString(DBConstants.DDP_PARTICIPANT_ALIAS + DBConstants.ALIAS_DELIMITER + DBConstants.DDP_PARTICIPANT_ID);
ddpParticipantId = rs.getString(DBConstants.DDP_PARTICIPANT_ALIAS + DBConstants.ALIAS_DELIMITER + DBConstants.DDP_PARTICIPANT_ID);
participantId = rs.getString(DBConstants.DDP_PARTICIPANT_ALIAS + DBConstants.ALIAS_DELIMITER + DBConstants.PARTICIPANT_ID);
Tissue tissue = Tissue.getTissue(rs);
TissueList tissueList = new TissueList(oncHistory, null, ptId);
TissueList tissueList = new TissueList(oncHistory, null, ddpParticipantId, participantId);

if (!tissue.isTDeleted() && StringUtils.isNotBlank(tissue.getTissueId())) {
tissueList.setTissue(tissue);
Expand Down