Skip to content

Commit

Permalink
Merge pull request #2 from ncats/archUpdate
Browse files Browse the repository at this point in the history
fixed export andd added new fields
  • Loading branch information
blueSwordfish authored Mar 14, 2024
2 parents 1051578 + 33c54d0 commit 515b68b
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public ResponseEntity<String> findAllAssays() throws Exception {

@GetGsrsRestApiMapping("/allTestAgents")
public ResponseEntity<String> findAllTestAgents() throws Exception {
List<InvitroAssayInformation> list = invitroPharmacologyEntityService.findAllTestAgents();
List<InvitroTestAgent> list = invitroPharmacologyEntityService.findAllTestAgents();

return new ResponseEntity(list, HttpStatus.OK);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ public void export(InvitroAssayInformation a) throws IOException {

// If there is no screening data, only export the Assay details
if (a.invitroAssayScreenings.size() == 0) {
publicCreateRows(a, 0);
createRows(a, 0);
// Else if there are screening data, export screening data along with Assay details
} else if (a.invitroAssayScreenings.size() > 0) {
for (int i = 0; i < a.invitroAssayScreenings.size(); i++) {
publicCreateRows(a, i);
createRows(a, i);
} // for InvitroAssayScreenings
} // invitroAssayScreenings size > 0

Expand All @@ -98,7 +98,7 @@ public void export(InvitroAssayInformation a) throws IOException {
}
}

public void publicCreateRows(InvitroAssayInformation a, int i) {
public void createRows(InvitroAssayInformation a, int i) {
Spreadsheet.SpreadsheetRow row = spreadsheet.getRow(this.row++);
int col = 0;
this.screeningNumber = i;
Expand All @@ -120,7 +120,11 @@ public void close() throws IOException {
DEFAULT_RECIPE_MAP = new LinkedHashMap<>();

DEFAULT_RECIPE_MAP.put(InvitroPharmDefaultColumns.SCREENING_NUMBER, SingleColumnValueRecipe.create(InvitroPharmDefaultColumns.SCREENING_NUMBER, (a, cell) -> {
int screeningNum = screeningNumber + 1;
int screeningNum = screeningNumber;
// If there is any screening data, increment the number by 1
if (a.invitroAssayScreenings.size() > 0) {
screeningNum = screeningNumber + 1;
}
cell.writeInteger((screeningNum));
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public class InvitroAssayInformation extends InvitroPharmacologyCommanData {
@Column(name="TARGET_NAME_APPROVAL_ID")
public String targetNameApprovalId;

@Column(name="TARGET_NAME_SUBSTANCE_UUID")
public String targetNameSubstanceUuid;

@Indexable(suggest = true, facet=true, name= "Target Species", sortable = true)
@Column(name="TARGET_SPECIES")
public String targetSpecies;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ public class InvitroAssayResult extends InvitroPharmacologyCommanData {
@Column(name = "ASSAY_MEASUREMENT", length=4000)
public String assayMeasurement;

@Column(name = "LIGAND_SUBSTRATE_CONCENT")
public Double ligandSubstrateConcentration;

@Column(name = "LIGAND_SUBSTRATE_CONCENT_UNITS")
public String ligandSubstrateConcentrationUnits;

@Column(name = "NUMBER_OF_TESTS")
public String numberOfTests;

@Column(name = "DATA_TYPE")
public String dataType;

@Column(name = "PLASMA_PROTEIN_ADDED")
public String plasmaProteinAdded;

public InvitroAssayResult() {
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class InvitroReference extends InvitroPharmacologyCommanData {
@Column(name="REFERENCE_SOURCE_TYPE")
public String referenceSourceType;

@Indexable(suggest = true, facet=true, name= "Reference Source Number", sortable = true)
@Indexable(suggest = true, facet=true, name= "Reference Source", sortable = true)
@Column(name="REFERENCE_SOURCE_NUMBER")
public String referenceSourceNumber;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ public interface InvitroPharmacologyRepository extends GsrsVersionedRepository<I
@Query("select a from InvitroReference a")
List<InvitroReference> findAllReferences();

@Query("select a from InvitroTestAgent a")
List<InvitroTestAgent> findAllTestAgents();

@Query("select a from InvitroAssayInformation a JOIN a.invitroAssayScreenings s JOIN s.invitroTestAgent ta where ta.testAgent IS NOT NULL")
List<InvitroAssayInformation> findAllScreeningTestAgents();
}
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ public List<InvitroAssayInformation> findAllAssays() {
return list;
}

public List<InvitroAssayInformation> findAllTestAgents() {
List<InvitroAssayInformation> list = repository.findAllScreeningTestAgents();
public List<InvitroTestAgent> findAllTestAgents() {
List<InvitroTestAgent> list = repository.findAllTestAgents();
return list;
}

Expand Down

0 comments on commit 515b68b

Please sign in to comment.