Skip to content

Commit

Permalink
Export skip rc
Browse files Browse the repository at this point in the history
  • Loading branch information
islean committed Jan 23, 2025
1 parent 9bf6592 commit 76bdcf3
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 2 deletions.
15 changes: 13 additions & 2 deletions cg/services/orders/lims_service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ def __init__(self, lims_api: LimsAPI):

@staticmethod
def _build_lims_sample(
customer: str, samples: list[Sample], workflow: Workflow, delivery_type: DataDelivery
customer: str,
samples: list[Sample],
workflow: Workflow,
delivery_type: DataDelivery,
skip_reception_control: bool,
) -> list[LimsSample]:
"""Convert order input to LIMS interface input."""
samples_lims = []
Expand All @@ -26,6 +30,8 @@ def _build_lims_sample(
dict_sample["data_analysis"] = workflow
dict_sample["data_delivery"] = delivery_type
dict_sample["family_name"] = sample._case_name
if skip_reception_control:
dict_sample["skip_reception_control"] = True
lims_sample: LimsSample = LimsSample.parse_obj(dict_sample)
samples_lims.append(lims_sample)
return samples_lims
Expand All @@ -38,10 +44,15 @@ def process_lims(
order_name: str,
workflow: Workflow,
delivery_type: DataDelivery,
skip_reception_control: bool,
) -> tuple[any, dict]:
"""Process samples to add them to LIMS."""
samples_lims: list[LimsSample] = self._build_lims_sample(
customer=customer, samples=samples, workflow=workflow, delivery_type=delivery_type
customer=customer,
samples=samples,
workflow=workflow,
delivery_type=delivery_type,
skip_reception_control=skip_reception_control,
)
project_name: str = str(ticket) or order_name
# Create new lims project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def store_order(self, order: OrderWithCases) -> dict:
order_name=order.name,
workflow=ORDER_TYPE_WORKFLOW_MAP[order.order_type],
delivery_type=order.delivery_type,
skip_reception_control=order.skip_reception_control,
)
if lims_map:
self._fill_in_sample_ids(samples=new_samples, lims_map=lims_map)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def store_order(self, order: FastqOrder) -> dict:
workflow=Workflow.RAW_DATA,
customer=order.customer,
delivery_type=DataDelivery(order.delivery_type),
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)
new_samples: list[Sample] = self.store_order_data_in_status_db(order=order)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def store_order(self, order: OrderMetagenome) -> dict:
order_name=order.name,
workflow=ORDER_TYPE_WORKFLOW_MAP[order.order_type],
delivery_type=DataDelivery(order.delivery_type),
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)
new_samples = self.store_order_data_in_status_db(order)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ def store_order(self, order: MicrobialFastqOrder) -> dict:
workflow=Workflow.RAW_DATA,
customer=order.customer,
delivery_type=DataDelivery(order.delivery_type),
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)
new_samples: list[Sample] = self.store_order_data_in_status_db(order=order)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def store_order(self, order: MicrobialOrder) -> dict:
order_name=order.name,
workflow=ORDER_TYPE_WORKFLOW_MAP[order.order_type],
delivery_type=DataDelivery(order.delivery_type),
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def store_order(self, order: PacbioOrder) -> dict:
workflow=Workflow.RAW_DATA,
customer=order.customer,
delivery_type=DataDelivery(order.delivery_type),
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)
new_samples = self.store_order_data_in_status_db(order=order)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def store_order(self, order: OrderWithIndexedSamples) -> dict:
order_name=order.name,
workflow=ORDER_TYPE_WORKFLOW_MAP[order.order_type],
delivery_type=order.delivery_type,
skip_reception_control=order.skip_reception_control,
)
self._fill_in_sample_ids(samples=order.samples, lims_map=lims_map)
new_records: list[Pool] = self.store_order_data_in_status_db(order=order)
Expand Down

0 comments on commit 76bdcf3

Please sign in to comment.