Skip to content

Commit

Permalink
Merge pull request #524 from ncats/arch_frontend_invitro
Browse files Browse the repository at this point in the history
updated invitro
  • Loading branch information
ChemMitch authored Jul 11, 2024
2 parents 1250261 + 4d7dcf5 commit 67b8eea
Show file tree
Hide file tree
Showing 11 changed files with 333 additions and 153 deletions.
27 changes: 7 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
<tr *ngFor="let clinical of application.clinicalTrialList; let i = index">
<td>{{(i+1)}}</td>
<td>
<a target="_blank" title="see clinicaltrials.gov" [href]="'https://clinicaltrials.gov/ct2/show/' + clinical.trialNumber">{{clinical.trialNumber}}</a>
<a target="_blank" title="see clinicaltrials.gov" [href]="'https://clinicaltrials.gov/ct2/show/' + clinical.nctNumber">{{clinical.nctNumber}}</a>
<!--
<a [routerLink]="['/clinical-trial', clinical.nctNumber]"
target="_blank">{{clinical.nctNumber}}</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1031,26 +1031,12 @@
<mat-icon svgIcon="edit"></mat-icon>
</div>
<div>
<a [routerLink]="['/invitro-pharm/summary', testAgt.testAgentId, 'edit']" target="_blank"
<a [routerLink]="['/invitro-pharm/summary', testAgt.testAgent, 'edit']" target="_blank"
*ngIf="isAdmin" matTooltip='Edit Assay Summary Record'>
<span class="font12px">Edit Summary Record</span>
</a>
</div>


<!-- Edit SUMMARY Record -->
<!--
<div class="marginleft40px">
<mat-icon svgIcon="edit"></mat-icon>
</div>
<div>
<a [routerLink]="['/invitro-pharm/summary', testAgt.testAgentId, 'edit']" target="_blank"
*ngIf="isAdmin" matTooltip='Edit Assay Summary Record'>
<span class="font13px">Edit Summary Record</span>
</a>
</div>
-->

</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
<mat-icon svgIcon="edit"></mat-icon>
</div>
<div>
<a [routerLink]="['/invitro-pharm/summary', screen.testAgentId, 'edit']" target="_blank" *ngIf="isAdmin"
<a [routerLink]="['/invitro-pharm/summary', screen.testAgent, 'edit']" target="_blank" *ngIf="isAdmin"
matTooltip='Edit Assay Summary Record'>
<span class="font12px">Edit Summary Record</span>
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ export class InvitroPharmacologyDetailsTestagentComponent implements OnInit {

if (screening.invitroSummary) {

assaySummary.summaryId = screening.invitroSummary.id;
assaySummary.summaryTargetName = screening.invitroSummary.targetName;
assaySummary.summaryTargetNameSubstanceKey = screening.invitroSummary.targetNameSubstanceKey;

Expand Down Expand Up @@ -331,32 +332,38 @@ export class InvitroPharmacologyDetailsTestagentComponent implements OnInit {
/* Invitro Test Agent Object exists */
if (screening.invitroAssayResultInformation.invitroTestAgent) {

let testAgent = '';
let testAgentSubstanceKey = '';

let testAgentId = screening.invitroAssayResultInformation.invitroTestAgent.id;
testAgent = screening.invitroAssayResultInformation.invitroTestAgent.testAgent;
testAgentSubstanceKey = screening.invitroAssayResultInformation.invitroTestAgent.testAgentSubstanceKey;

assaySummary.testAgent = testAgent;
assaySummary.testAgentSubstanceKey = testAgentSubstanceKey;

// Get the index if the value exists in the key 'testAgent'
const indexTestAgent = this.allScreeningTestAgents.findIndex(record => record.testAgent === testAgent);

if (indexTestAgent > -1) {
// Add in the exsting card record
this.allScreeningTestAgents[indexTestAgent].testAgentSummaryList.push(assaySummary);
} else {
// Create new card record
let assayList = [];
assayList.push(assaySummary);
const appScreening = {
'testAgent': testAgent, 'testAgentSubstanceKey': testAgentSubstanceKey, 'testAgentId': testAgentId,
'testAgentSummaryList': assayList, 'testAgentScreeningList': assayList
};
this.allScreeningTestAgents.push(appScreening);
} // else
if (screening.invitroAssayResultInformation.invitroTestAgent.testAgent) {

if (assaySummary.summaryId) {

let testAgent = '';
let testAgentSubstanceKey = '';

let testAgentId = screening.invitroAssayResultInformation.invitroTestAgent.id;
testAgent = screening.invitroAssayResultInformation.invitroTestAgent.testAgent;
testAgentSubstanceKey = screening.invitroAssayResultInformation.invitroTestAgent.testAgentSubstanceKey;

assaySummary.testAgent = testAgent;
assaySummary.testAgentSubstanceKey = testAgentSubstanceKey;

// Get the index if the value exists in the key 'testAgent'
const indexTestAgent = this.allScreeningTestAgents.findIndex(record => record.testAgent === testAgent);

if (indexTestAgent > -1) {
// Add in the exsting card record
this.allScreeningTestAgents[indexTestAgent].testAgentSummaryList.push(assaySummary);
} else {
// Create new card record
let assayList = [];
assayList.push(assaySummary);
const appScreening = {
'testAgent': testAgent, 'testAgentSubstanceKey': testAgentSubstanceKey, 'testAgentId': testAgentId,
'testAgentSummaryList': assayList, 'testAgentScreeningList': assayList
};
this.allScreeningTestAgents.push(appScreening);
} // else
} // if SummaryId exists
} // if testAgent exists
} // if invitroTestAgent exists

} // if invitroAssayResultInformation exists
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ export class InvitroPharmacologyFormComponent implements OnInit, OnDestroy {
}

assay.invitroAssayScreenings[lastScreeningIndex].invitroSummary.targetName = assay.targetName;

// Assign Summary Target Name from Assay Target Name
// if Assay Target Name Substance Key Type is UUID, assign it to Summary Target Name Substance UUID, otherwise
// get the Substance Uuid
Expand Down Expand Up @@ -1165,6 +1165,7 @@ export class InvitroPharmacologyFormComponent implements OnInit, OnDestroy {

// Assign Ingredient Name to Test Agent
this.assayResultInfo.invitroTestAgent.testAgent = substance._name;
this.assayResultInfo.invitroTestAgent.testAgentSubstanceUuid = substance.uuid;

/**************************************************** */
/* SUBSTANCE KEY RESOLVER BEGIN */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
<app-substance-selector (selectionUpdated)="testAgentUpdated($event)"
eventCategory="substanceRelationshipRelatedSub"
placeholder="Test Agent - Search by Name/CAS RN/UNII/BDNUM" header="Test Agent"
[subuuid]="testAgentSubstanceKey" [showMorelinks]="true">
[subuuid]="testAgentSubstanceUuid" [showMorelinks]="true">
</app-substance-selector>
</div>

Expand All @@ -173,6 +173,10 @@
<div class="divradius divshadow margintop20px"
*ngFor="let screening of screeningList; let indexScreening = index">

<!--
<div class="divradius divshadow margintop20px"
*ngFor="let screening of assay.invitroAssayScreenings; let indexScreening = index">
-->
<div class="divflex" style="vertical-align:top;">

<div class="margintop10px width30px">
Expand Down Expand Up @@ -242,10 +246,18 @@

<!-- Selected Assay -->
<div class="margintop10px" *ngIf="screening._selectedAssay">
Assay Target Name: <b>{{screening._selectedAssay.targetName}}</b>&nbsp;
<br>
External Source: <b>{{screening._selectedAssay.externalAssaySource}}&nbsp;
{{screening._selectedAssay.externalAssayId}}</b>
Assay Target Name: <b>{{screening._selectedAssay.targetName}}</b>&nbsp;
<br>
External Source: <b>{{screening._selectedAssay.externalAssaySource}}&nbsp;
{{screening._selectedAssay.externalAssayId}}</b>
</div>

<div *ngIf="screening.invitroSummary.isFromResult">
<span
*ngIf="screening.invitroSummary.isFromResult && screening.invitroSummary.isFromResult == true">
<mat-icon matTooltip="This Summary data is from Result data">check_circle_outline
</mat-icon>
</span>
</div>

</div> <!-- form-row -->
Expand All @@ -259,20 +271,23 @@
<th>External Assay ID</th>
<th>Assay Target Name</th>
<th>Assay Title</th>
<th>Total Screening</th>
</tr>
<tr class="font11px" *ngFor="let assayResult of screening._assayResults; let indexResult = index">
<tr class="font11px"
*ngFor="let assayResult of screening._assayResults; let indexResult = index">
<td>{{(indexResult+1)}}</td>
<td class="font11px">
<mat-radio-group name="radioAssayResult">
<mat-radio-button class="font11px" value="indexResult" [checked]='false'
(change)="changeSelectionRadioAssay($event, indexResult, indexScreening)">
(change)="changeSelectionRadioAssay($event, indexResult, indexScreening)">
</mat-radio-button>
</mat-radio-group>
</td>
<td class="font11px">{{assayResult.externalAssaySource}}</td>
<td class="font11px">{{assayResult.externalAssayId}}</td>
<td class="font11px">{{assayResult.targetName}}</td>
<td class="font11px">{{assayResult.assayTitle}}</td>
<td class="font11px">{{assayResult.invitroAssayScreenings.length}}</td>
</tr> <!-- FOR LOOP: assay result -->
</table>
</div>
Expand Down Expand Up @@ -358,14 +373,21 @@
<!-- form-row -->

</div> <!-- class=marginleft20px -->
</div> <!-- class=divflex -->

</div> <!-- Loop Summaries -->

</div>
<!-- class=divflex -->

<!--
</div> -->
<!-- Loop Summaries -->

</div> <!-- Loop Assay List -->

<!-- Add More Summary Button -->
<div class="font18px margintop20px" *ngIf="screeningList.length > 1">
<button mat-flat-button color="primary" class="marginright30px bordergreen" color="primary"
(click)="addNewSummary(); $event.stopPropagation()" matTooltip="Add New Summary">
(click)="addNewSummary(indexScreening); $event.stopPropagation()" matTooltip="Add New Summary">
<mat-icon>add_circle_outline</mat-icon><span class="colorgreen">Add More Summary</span>
</button>&nbsp;&nbsp;
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.form-content-container {
width: 1140px;
width: 1160px;
margin: 0 auto;
overflow: hidden;
padding-top: 110px;
Expand Down
Loading

0 comments on commit 67b8eea

Please sign in to comment.