db/python/tables/participant.py
async def create_participant(
        self,
        external_id: str,
        reported_sex: int = None,
        reported_gender: str = None,
        karyotype: str = None,
        meta: Dict = None,
        author: str = None,
        project: ProjectId = None,
    ) -> int:
        """
        Create a new sample, and add it to database
        """
        _query = f"""
INSERT INTO participant (external_id, reported_sex, reported_gender, karyotype, meta, author, project)
VALUES (:external_id, :reported_sex, :reported_gender, :karyotype, :meta, :author, :project)
RETURNING id
        """

        return await self.connection.fetch_val(
            _query,
            {
                'external_id': external_id,
                'reported_sex': reported_sex,
                'reported_gender': reported_gender,
                'karyotype': karyotype,
                'meta': to_db_json(meta or {}),
                'author': author or self.author,
                'project': project or self.project,
            },
        )

        Create a new sample, and add it to database
        
Create a new sample, and add it to database
Create a new sample and add it to database
async def create_participant(
        self,
        external_id: str,
        reported_sex: int = None,
        reported_gender: str = None,
        karyotype: str = None,
        meta: Dict = None,
        author: str = None,
        project: ProjectId = None,
    ) -> int:
        _query = f"""
INSERT INTO participant (external_id, reported_sex, reported_gender, karyotype, meta, author, project)
VALUES (:external_id, :reported_sex, :reported_gender, :karyotype, :meta, :author, :project)
RETURNING id
        """
        return await self.connection.fetch_val(
            _query,
            {
                'external_id': external_id,
                'reported_sex': reported_sex,
                'reported_gender': reported_gender,
                'karyotype': karyotype,
                'meta': to_db_json(meta or {}),
                'author': author or self.author,
                'project': project or self.project,
            },
        )
async def create_participant ( self , external_id : str , reported_sex : int = None , reported_gender : str = None , karyotype : str = None , meta : Dict = None , author : str = None , project : ProjectId = None , ) -> int : _query = f"""
INSERT INTO participant (external_id, reported_sex, reported_gender, karyotype, meta, author, project)
VALUES (:external_id, :reported_sex, :reported_gender, :karyotype, :meta, :author, :project)
RETURNING id
        """ return await self . connection . fetch_val ( _query , { 'external_id' : external_id , 'reported_sex' : reported_sex , 'reported_gender' : reported_gender , 'karyotype' : karyotype , 'meta' : to_db_json ( meta or { } ) , 'author' : author or self . author , 'project' : project or self . project , } , )
Create a new sample, and add it to database
Create a new sample and add it to database
"""
        Create a new sample, and add it to database
        """
self
external_id
str
reported_sex
int
reported_gender
str
karyotype
str
meta
Dict
author
str
project
ProjectId