-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |