Skip to content

Commit

Permalink
Add microsalt upload api
Browse files Browse the repository at this point in the history
  • Loading branch information
seallard committed Jan 11, 2024
1 parent cfb771c commit 851d3d9
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions cg/meta/upload/microsalt/microsalt_upload_api.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import logging

import click

from cg.cli.upload.clinical_delivery import upload_clinical_delivery
from cg.meta.upload.upload_api import UploadAPI
from cg.meta.workflow.microsalt.microsalt import MicrosaltAnalysisAPI
from cg.models.cg_config import CGConfig
from cg.store.models import Analysis, Case

LOG = logging.getLogger(__name__)


class MicrosaltUploadAPI(UploadAPI):
def __init__(self, config: CGConfig):
self.analysis_api = MicrosaltAnalysisAPI(config)
super().__init__(config=config, analysis_api=self.analysis_api)

def upload(self, ctx: click.Context, case: Case, restart: bool) -> None:
"""Uploads MIP-DNA analysis data and files."""
analysis: Analysis = case.analyses[0]
self.update_upload_started_at(analysis)

ctx.invoke(upload_clinical_delivery, case_id=case.internal_id)
self.update_uploaded_at(analysis=analysis)

0 comments on commit 851d3d9

Please sign in to comment.