Skip to content

Commit

Permalink
Merge commit '6a59ec325f82c207fbb69020b342b02a2ae7839d' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
acoffman committed Mar 23, 2023
2 parents 52f635a + 6a59ec3 commit c11d476
Show file tree
Hide file tree
Showing 31 changed files with 1,325 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<ng-container *ngIf="diseaseInfo">
<nz-card nzTitle="MyDiseaseInfo">
<nz-card-tab>
<nz-tabset nzSize="small" [nzAnimated]="true">
<nz-tab (nzClick)="tabIndex.next(0)" nzTitle="Disease Ontology"> </nz-tab>
<nz-tab (nzClick)="tabIndex.next(1)" nzTitle="Mondo"> </nz-tab>
</nz-tabset>
</nz-card-tab>
<ng-container [ngSwitch]="tabIndex | async">
<!-- DO tab -->
<ng-container *ngSwitchCase="0">
<div class="tab-padding">
<nz-row [nzGutter]="8">
<nz-col [nzSpan]="12">
<nz-descriptions nzSize="small" [nzBordered]="true" [nzColumn]="1">
<nz-descriptions-item nzTitle="Definition">
<ng-container *ngIf="diseaseInfo.doDef; else noValue">
{{diseaseInfo.doDef}}
</ng-container>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="Citations">
<ng-container *ngIf="diseaseInfo.doDefCitations.length > 0; else noValue">
<cvc-tag-list>
<cvc-link-tag *ngFor="let url of diseaseInfo.doDefCitations; let i = index" [href]="url">Source {{ i + 1 }}</cvc-link-tag>
</cvc-tag-list>
</ng-container>
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
<nz-col [nzSpan]="12">
<nz-descriptions nzSize="small" [nzBordered]="true" [nzColumn]="2">
<nz-descriptions-item nzTitle="Exact Synonyms" *ngIf="diseaseInfo.diseaseOntologyExactSynonyms.length > 0"
[nzSpan]="2">
<cvc-tag-list>
<nz-tag *ngFor="let a of diseaseInfo.diseaseOntologyExactSynonyms">
{{ a }}
</nz-tag>
</cvc-tag-list>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="Related Synonyms" *ngIf="diseaseInfo.diseaseOntologyRelatedSynonyms.length > 0"
[nzSpan]="2">
<cvc-tag-list>
<nz-tag *ngFor="let a of diseaseInfo.diseaseOntologyRelatedSynonyms">
{{ a }}
</nz-tag>
</cvc-tag-list>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="External Identifiers" [nzSpan]="2">
<cvc-tag-list>
<cvc-link-tag *ngIf="diseaseInfo.mesh" [href]="'https://meshb.nlm.nih.gov/record/ui?ui=' + diseaseInfo.mesh"
tooltip="View in MeSH">
MeSH:{{diseaseInfo.mesh}}
</cvc-link-tag>
<cvc-link-tag *ngFor="let ncit of diseaseInfo.ncit"
[href]="'https://ncithesaurus.nci.nih.gov/ncitbrowser/ConceptReport.jsp?dictionary=NCI_Thesaurus&ns=ncit&code=' + ncit"
tooltip="View in NCI Thesaurus">
NCIt:{{ncit}}
</cvc-link-tag>
<cvc-link-tag *ngIf="diseaseInfo.omim" [href]="'https://www.omim.org/entry/' + diseaseInfo.omim"
tooltip="View on OMIM">
OMIM:{{diseaseInfo.omim}}
</cvc-link-tag>
</cvc-tag-list>
</nz-descriptions-item>
<nz-descriptions-item *ngIf="diseaseInfo.icd10" nzTitle="ICD - 10">
{{diseaseInfo.icd10}}
</nz-descriptions-item>
<nz-descriptions-item *ngIf="diseaseInfo.icdo" nzTitle="ICD - O">
{{diseaseInfo.icdo}}
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
</nz-row>
</div>
</ng-container>
<ng-container *ngSwitchCase="1">
<div class="tab-padding">
<nz-row [nzGutter]="8">
<nz-col [nzSpan]="12">
<nz-descriptions nzSize="small" [nzBordered]="true" [nzColumn]="2">
<nz-descriptions-item nzTitle="Definition">
<ng-container *ngIf="diseaseInfo.mondoDef; else noValue">
{{diseaseInfo.mondoDef}}
</ng-container>
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
</nz-row>
</div>
</ng-container>
</ng-container>
</nz-card>
</ng-container>
<ng-template #noValue><span nz-typography nzType="secondary">Not Found</span></ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:host {
display: block;
}

nz-card {
width: 100%;
}

.key-col {
text-align: right;
font-weight: bold;
}
.button-col {
text-align: right;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Component, Input, OnDestroy } from "@angular/core";
import { Maybe } from "@app/generated/civic.apollo";
import { MyDiseaseInfoFieldsFragment } from "@app/generated/civic.apollo";
import { BehaviorSubject } from "rxjs";

@Component({
selector: 'cvc-my-disease-info',
templateUrl: './my-disease-info.component.html',
styleUrls: ['./my-disease-info.component.less']
})
export class CvcMyDiseaseInfoComponent implements OnDestroy {
@Input() diseaseInfo: Maybe<MyDiseaseInfoFieldsFragment>;

tabIndex = new BehaviorSubject<number>(0);

constructor() { }

tabChange(index: number): void {
this.tabIndex.next(index);
}

ngOnDestroy(): void {
this.tabIndex.unsubscribe();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CvcMyDiseaseInfoComponent } from './my-disease-info.component';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzTableModule } from 'ng-zorro-antd/table';
import { CvcPipesModule } from '@app/core/pipes/pipes.module';
import { CvcLinkTagModule } from '@app/components/shared/link-tag/link-tag.module';
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions';
import { CvcTagListModule } from '@app/components/shared/tag-list/tag-list.module';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzTypographyModule } from 'ng-zorro-antd/typography';

@NgModule({
declarations: [CvcMyDiseaseInfoComponent],
imports: [
CommonModule,
NzTabsModule,
NzTableModule,
NzCardModule,
NzDescriptionsModule,
NzGridModule,
NzTagModule,
NzTypographyModule,
CvcPipesModule,
CvcLinkTagModule,
CvcTagListModule
],
exports: [CvcMyDiseaseInfoComponent],
})
export class CvcMyDiseaseInfoModule { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<ng-container *ngIf="chemInfo">
<nz-card nzTitle="MyChemInfo">
<div class="tab-padding">
<nz-row [nzGutter]="8">
<nz-col [nzSpan]="12">
<nz-descriptions nzSize="small" [nzBordered]="true" [nzColumn]="2">
<nz-descriptions-item nzTitle="ChEBI Definition" [nzSpan]="2">
<ng-container *ngIf="chemInfo.chebiDefinition; else noValue">
{{chemInfo.chebiDefinition}}
</ng-container>
</nz-descriptions-item>
<nz-descriptions-item nzTitle="Inidications" [nzSpan]="2">
<ng-container *ngIf="chemInfo.indications.length > 0; else noValue">
<cvc-tag-list>
<nz-tag *ngFor="let i of chemInfo.indications">{{i}}</nz-tag>
</cvc-tag-list>
</ng-container>
</nz-descriptions-item>
<nz-descriptions-item *ngIf="chemInfo.inchikey" nzTitle="InChIKey" [nzSpan]="2">
{{chemInfo.inchikey}}
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
<nz-col [nzSpan]="12">
<nz-descriptions nzSize="small" [nzBordered]="true" [nzColumn]="2">
<nz-descriptions-item *ngIf="chemInfo.firstApproval" nzTitle="First Approval">
{{chemInfo.firstApproval}}
</nz-descriptions-item>
<nz-descriptions-item *ngIf="chemInfo.chemblMoleculeType" nzTitle="Molecule Type">
{{chemInfo.chemblMoleculeType}}
</nz-descriptions-item>
<ng-container *ngFor="let epc of chemInfo.fdaEpcCodes">
<nz-descriptions-item nzTitle="FDA EPC Code">
{{epc.code}}
</nz-descriptions-item>
<nz-descriptions-item nzTitle="FDA EPC Description">
{{epc.description}}
</nz-descriptions-item>
</ng-container>
<ng-container *ngFor="let moa of chemInfo.fdaMoaCodes">
<nz-descriptions-item nzTitle="FDA MOA Code">
{{moa.code}}
</nz-descriptions-item>
<nz-descriptions-item nzTitle="FDA MOA Description">
{{moa.description}}
</nz-descriptions-item>
</ng-container>
<nz-descriptions-item nzTitle="External Identifiers" [nzSpan]="2">
<cvc-tag-list>
<cvc-link-tag *ngIf="chemInfo.chebiId" [href]="'https://www.ebi.ac.uk/chebi/searchId.do?chebiId=' + chemInfo.chebiId"
tooltip="View in ChEBI">
{{chemInfo.chebiId}}
</cvc-link-tag>
<cvc-link-tag *ngIf="chemInfo.chemblId" [href]="'https://www.ebi.ac.uk/chembl/compound_report_card/' + chemInfo.chemblId"
tooltip="View in ChEMBL">
{{chemInfo.chemblId}}
</cvc-link-tag>
<cvc-link-tag *ngIf="chemInfo.pubchemCid" [href]="'https://pubchem.ncbi.nlm.nih.gov/compound/' + chemInfo.pubchemCid"
tooltip="View in PubChem">
PubChem {{chemInfo.pubchemCid}}
</cvc-link-tag>
<cvc-link-tag *ngIf="chemInfo.pharmgkbId" [href]="'https://www.pharmgkb.org/chemical/' + chemInfo.pharmgkbId"
tooltip="View in PHARMGKB">
PHARMGKB {{chemInfo.pharmgkbId}}
</cvc-link-tag>
<cvc-link-tag *ngIf="chemInfo.rxnorm" [href]="'https://mor.nlm.nih.gov/RxNav/search?searchBy=RXCUI&searchTerm=' + chemInfo.rxnorm"
tooltip="View in RxNav">
RxNav {{chemInfo.rxnorm}}
</cvc-link-tag>
<cvc-link-tag *ngIf="chemInfo.drugbankId" [href]="'https://go.drugbank.com/drugs/' + chemInfo.drugbankId"
tooltip="View in DrugBank">
DrugBank {{chemInfo.drugbankId}}
</cvc-link-tag>
</cvc-tag-list>
</nz-descriptions-item>
</nz-descriptions>
</nz-col>
</nz-row>
</div>
</nz-card>
</ng-container>
<ng-template #noValue><span nz-typography nzType="secondary">Not Found</span></ng-template>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
:host {
display: block;
}

nz-card {
width: 100%;
}

.key-col {
text-align: right;
font-weight: bold;
}
.button-col {
text-align: right;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Component, Input, OnDestroy } from "@angular/core";
import { Maybe, MyChemInfoFieldsFragment } from "@app/generated/civic.apollo";
import { BehaviorSubject } from "rxjs";

@Component({
selector: 'cvc-my-chem-info',
templateUrl: './my-chem-info.component.html',
styleUrls: ['./my-chem-info.component.less']
})
export class CvcMyChemInfoComponent implements OnDestroy {
@Input() chemInfo: Maybe<MyChemInfoFieldsFragment>;

tabIndex = new BehaviorSubject<number>(0);

constructor() { }

tabChange(index: number): void {
this.tabIndex.next(index);
}

ngOnDestroy(): void {
this.tabIndex.unsubscribe();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { CvcMyChemInfoComponent } from './my-chem-info.component';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzGridModule } from 'ng-zorro-antd/grid';
import { NzTableModule } from 'ng-zorro-antd/table';
import { CvcPipesModule } from '@app/core/pipes/pipes.module';
import { CvcLinkTagModule } from '@app/components/shared/link-tag/link-tag.module';
import { NzDescriptionsModule } from 'ng-zorro-antd/descriptions';
import { CvcTagListModule } from '@app/components/shared/tag-list/tag-list.module';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzTypographyModule } from 'ng-zorro-antd/typography';

@NgModule({
declarations: [CvcMyChemInfoComponent],
imports: [
CommonModule,
NzTabsModule,
NzTableModule,
NzCardModule,
NzDescriptionsModule,
NzGridModule,
NzTagModule,
NzTypographyModule,
CvcPipesModule,
CvcLinkTagModule,
CvcTagListModule
],
exports: [CvcMyChemInfoComponent],
})
export class CvcMyChemInfoModule { }
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,13 @@
<!-- representative transcript -->
<nz-descriptions-item nzTitle="Transcript"
nzColumn="5">
<cvc-link-tag tooltip="View on Ensembl"
<cvc-link-tag *ngIf="coords.representativeTranscript" tooltip="View on Ensembl"
[href]="'http://www.ensembl.org/Homo_sapiens/transview?transcript=' + coords.representativeTranscript">
{{ coords.representativeTranscript }}
</cvc-link-tag>
<ng-container *ngIf="!coords.representativeTranscript">
--
</ng-container>
</nz-descriptions-item>

</nz-descriptions>
Expand Down Expand Up @@ -110,10 +113,13 @@
<!-- representative transcript -->
<nz-descriptions-item nzTitle="Transcript"
nzColumn="5">
<cvc-link-tag tooltip="View on Ensembl"
<cvc-link-tag *ngIf="coords.representativeTranscript" tooltip="View on Ensembl"
[href]="'http://www.ensembl.org/Homo_sapiens/transview?transcript=' + coords.representativeTranscript">
{{ coords.representativeTranscript }}
</cvc-link-tag>
<ng-container *ngIf="!coords.representativeTranscript">
--
</ng-container>
</nz-descriptions-item>

</nz-descriptions>
Expand Down
Loading

0 comments on commit c11d476

Please sign in to comment.