Skip to content

Commit

Permalink
Merge pull request #103 from c3g/mcode
Browse files Browse the repository at this point in the history
Mcode app
  • Loading branch information
zxenia committed Apr 1, 2020
2 parents 11cb03d + f836f61 commit 38b74f9
Show file tree
Hide file tree
Showing 25 changed files with 1,900 additions and 17 deletions.
Empty file.
44 changes: 44 additions & 0 deletions chord_metadata_service/mcode/admin.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from django.contrib import admin
from .models import *


@admin.register(GeneticVariantTested)
class GeneticVariantTestedAdmin(admin.ModelAdmin):
pass


@admin.register(GeneticVariantFound)
class GeneticVariantFoundAdmin(admin.ModelAdmin):
pass


@admin.register(GenomicsReport)
class GenomicsReportAdmin(admin.ModelAdmin):
pass


@admin.register(LabsVital)
class LabsVitalAdmin(admin.ModelAdmin):
pass


@admin.register(CancerCondition)
class CancerConditionAdmin(admin.ModelAdmin):
pass


@admin.register(TNMStaging)
class TNMStagingAdmin(admin.ModelAdmin):
pass


@admin.register(CancerRelatedProcedure)
class CancerRelatedProcedureAdmin(admin.ModelAdmin):
pass


@admin.register(MedicationStatement)
class MedicationStatementAdmin(admin.ModelAdmin):
pass


57 changes: 57 additions & 0 deletions chord_metadata_service/mcode/api_views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
from rest_framework import viewsets
from rest_framework.settings import api_settings
from .serializers import *
from chord_metadata_service.restapi.api_renderers import (
PhenopacketsRenderer
)
from chord_metadata_service.restapi.pagination import LargeResultsSetPagination


class McodeModelViewSet(viewsets.ModelViewSet):
pagination_class = LargeResultsSetPagination
renderer_classes = (*api_settings.DEFAULT_RENDERER_CLASSES, PhenopacketsRenderer)


class GeneticVariantTestedViewSet(McodeModelViewSet):
queryset = GeneticVariantTested.objects.all()
serializer_class = GeneticVariantTestedSerializer


class GeneticVariantFoundViewSet(McodeModelViewSet):
queryset = GeneticVariantFound.objects.all()
serializer_class = GeneticVariantFoundSerializer


class GenomicsReportViewSet(McodeModelViewSet):
queryset = GenomicsReport.objects.all()
serializer_class = GenomicsReportSerializer


class LabsVitalViewSet(McodeModelViewSet):
queryset = LabsVital.objects.all()
serializer_class = LabsVitalSerializer


class CancerConditionViewSet(McodeModelViewSet):
queryset = CancerCondition.objects.all()
serializer_class = CancerConditionSerializer


class TNMStagingViewSet(McodeModelViewSet):
queryset = TNMStaging.objects.all()
serializer_class = TNMStagingSerializer


class CancerRelatedProcedureViewSet(McodeModelViewSet):
queryset = CancerRelatedProcedure.objects.all()
serializer_class = CancerRelatedProcedureSerializer


class MedicationStatementViewSet(McodeModelViewSet):
queryset = MedicationStatement.objects.all()
serializer_class = MedicationStatementSerializer


class MCodePacketViewSet(McodeModelViewSet):
queryset = MCodePacket.objects.all()
serializer_class = MCodePacketSerializer
5 changes: 5 additions & 0 deletions chord_metadata_service/mcode/apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from django.apps import AppConfig


class McodeConfig(AppConfig):
name = 'chord_metadata_service.mcode'
156 changes: 156 additions & 0 deletions chord_metadata_service/mcode/descriptions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
# Most parts of this text are taken from the mCODE:Minimal Common Oncology Data Elements Data Dictionary.
# The mCODE is made available under the Creative Commons 0 "No Rights Reserved" license https://creativecommons.org/share-your-work/public-domain/cc0/

# Portions of this text copyright (c) 2019-2020 the Canadian Centre for Computational Genomics; licensed under the
# GNU Lesser General Public License version 3.

from chord_metadata_service.restapi.description_utils import EXTRA_PROPERTIES

GENETIC_VARIANT_TESTED = {
"description": "A description of an alteration in the most common DNA nucleotide sequence.",
"properties": {
"id": "An arbitrary identifier for the genetic variant tested.",
"gene_studied": "A gene targeted for mutation analysis, identified in HUGO Gene Nomenclature Committee "
"(HGNC) notation.",
"method": "An ontology or controlled vocabulary term to identify the method used to perform the genetic test. "
"Accepted value set: NCIT.",
"variant_tested_identifier": "The variation ID assigned by HGVS, for example, 360448 is the identifier for "
"NM_005228.4(EGFR):c.-237A>G (single nucleotide variant in EGFR).",
"variant_tested_hgvs_name": "Symbolic representation of the variant used in HGVS, for example, "
"NM_005228.4(EGFR):c.-237A>G for HVGS variation ID 360448.",
"variant_tested_description": "Description of the variant.",
"data_value": "An ontology or controlled vocabulary term to identify positive or negative value for"
"the mutation. Accepted value set: SNOMED CT.",
**EXTRA_PROPERTIES
}
}

GENETIC_VARIANT_FOUND = {
"description": "Description of single discrete variant tested.",
"properties": {
"id": "An arbitrary identifier for the genetic variant found.",
"method": "An ontology or controlled vocabulary term to identify the method used to perform the genetic test. "
"Accepted value set: NCIT.",
"variant_found_identifier": "The variation ID assigned by HGVS, for example, 360448 is the identifier for "
"NM_005228.4(EGFR):c.-237A>G (single nucleotide variant in EGFR). "
"Accepted value set: ClinVar.",
"variant_found_hgvs_name": "Symbolic representation of the variant used in HGVS, for example, "
"NM_005228.4(EGFR):c.-237A>G for HVGS variation ID 360448.",
"variant_found_description": "Description of the variant.",
"genomic_source_class": "An ontology or controlled vocabulary term to identify the genomic class of the "
"specimen being analyzed.",
**EXTRA_PROPERTIES
}
}

GENOMICS_REPORT = {
"description": "Genetic Analysis Summary.",
"properties": {
"id": "An arbitrary identifier for the genetics report.",
"test_name": "An ontology or controlled vocabulary term to identify the laboratory test. "
"Accepted value sets: LOINC, GTR.",
"performing_organization_name": "The name of the organization producing the genomics report.",
"specimen_type": "An ontology or controlled vocabulary term to identify the type of material the specimen "
"contains or consists of. Accepted value set: HL7 Version 2 and Specimen Type.",
"genetic_variant_tested": "A test for a specific mutation on a particular gene.",
"genetic_variant_found": "Records an alteration in the most common DNA nucleotide sequence.",
**EXTRA_PROPERTIES
}
}

LABS_VITAL = {
"description": "A description of tests performed on patient.",
"properties": {
"id": "An arbitrary identifier for the labs/vital tests.",
"individual": "The individual who is the subject of the tests.",
"body_height": "The patient\'s height.",
"body_weight": "The patient\'s weight.",
"cbc_with_auto_differential_panel": "Reference to a laboratory observation in the CBC with Auto Differential"
"Panel test.",
"comprehensive_metabolic_2000": "Reference to a laboratory observation in the CMP 2000 test.",
"blood_pressure_diastolic": "The blood pressure after the contraction of the heart while the chambers of "
"the heart refill with blood, when the pressure is lowest.",
"blood_pressure_systolic": "The blood pressure during the contraction of the left ventricle of the heart, "
"when blood pressure is at its highest.",
"tumor_marker_test": "An ontology or controlled vocabulary term to identify tumor marker test.",
**EXTRA_PROPERTIES
}
}

CANCER_CONDITION = {
"description": "A description of history of primary or secondary cancer conditions.",
"properties": {
"id": "An arbitrary identifier for the cancer condition.",
"condition_type": "Cancer condition type: primary or secondary.",
"body_location_code": "Code for the body location, optionally pre-coordinating laterality or direction. "
"Accepted ontologies: SNOMED CT, ICD-O-3 and others.",
"clinical_status": "A flag indicating whether the condition is active or inactive, recurring, in remission, "
"or resolved (as of the last update of the Condition). Accepted code system: "
"http://terminology.hl7.org/CodeSystem/condition-clinical",
"condition_code": "A code describing the type of primary or secondary malignant neoplastic disease.",
"date_of_diagnosis": "The date the disease was first clinically recognized with sufficient certainty, "
"regardless of whether it was fully characterized at that time.",
"histology_morphology_behavior": "A description of the morphologic and behavioral characteristics of "
"the cancer. Accepted ontologies: SNOMED CT, ICD-O-3 and others.",
**EXTRA_PROPERTIES
}
}

TNM_STAGING = {
"description": "A description of the cancer spread in a patient's body.",
"properties": {
"id": "An arbitrary identifier for the TNM staging.",
"tnm_type": "TNM type: clinical or pathological.",
"stage_group": "The extent of the cancer in the body, according to the TNM classification system."
"Accepted ontologies: SNOMED CT, AJCC and others.",
"primary_tumor_category": "Category of the primary tumor, based on its size and extent. "
"Accepted ontologies: SNOMED CT, AJCC and others.",
"regional_nodes_category": "Category of the presence or absence of metastases in regional lymph nodes. "
"Accepted ontologies: SNOMED CT, AJCC and others.",
"distant_metastases_category": "Category describing the presence or absence of metastases in remote "
"anatomical locations. Accepted ontologies: SNOMED CT, AJCC and others.",
"cancer_condition": "Cancer condition.",
**EXTRA_PROPERTIES
}
}

CANCER_RELATED_PROCEDURE = {
"description": "Description of radiological treatment or surgical action addressing a cancer condition.",
"properties": {
"id": "An arbitrary identifier for the procedure.",
"procedure_type": "Type of cancer related procedure: radion or surgical.",
"code": "Code for the procedure performed.",
"occurence_time_or_period": "The date/time that a procedure was performed.",
"target_body_site": "The body location(s) where the procedure was performed.",
"treatment_intent": "The purpose of a treatment.",
**EXTRA_PROPERTIES
}
}

MEDICATION_STATEMENT = {
"description": "Description of medication use.",
"properties": {
"id": "An arbitrary identifier for the medication statement.",
"medication_code": "A code for medication. Accepted code systems: Medication Clinical Drug (RxNorm) and other.",
"termination_reason": "A code explaining unplanned or premature termination of a course of medication. "
"Accepted ontologies: SNOMED CT.",
"treatment_intent": "The purpose of a treatment. Accepted ontologies: SNOMED CT.",
"start_date": "The start date/time of the medication.",
"end_date": "The end date/time of the medication.",
"date_time": "The date/time the medication was administered.",
**EXTRA_PROPERTIES
}
}

MCODEPACKET = {
"description": "Collection of cancer related metadata.",
"properties": {
"id": "An arbitrary identifier for the mcodepacket.",
"subject": "An individual who is a subject of mcodepacket.",
"genomics_report": "A genomics report associated with an Individual.",
"cancer_condition": "An Individual's cancer condition.",
"cancer_related_procedures": "A radiological or surgical procedures addressing a cancer condition.",
"medication_statement": "Medication treatment addressed to an Individual.",
**EXTRA_PROPERTIES
}
}

0 comments on commit 38b74f9

Please sign in to comment.