Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Improve order flow) Override microbial dump #4127

Merged
merged 2 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cg/services/orders/lims_service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from cg.constants import DataDelivery, Workflow
from cg.models.lims.sample import LimsSample
from cg.services.orders.validation.models.sample import Sample
from cg.services.orders.validation.workflows.microsalt.models.sample import MicrosaltSample
from cg.services.orders.validation.workflows.mutant.models.sample import MutantSample

LOG = logging.getLogger(__name__)

Expand All @@ -28,8 +26,6 @@ def _build_lims_sample(
dict_sample["data_analysis"] = workflow
dict_sample["data_delivery"] = delivery_type
dict_sample["family_name"] = sample._case_name
if isinstance(sample, MutantSample | MicrosaltSample):
dict_sample["verified_organism"] = sample._verified_organism
lims_sample: LimsSample = LimsSample.parse_obj(dict_sample)
samples_lims.append(lims_sample)
return samples_lims
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _fill_in_sample_verified_organism(self, samples: list[MicrobialSample]):
organism_id = sample.organism
reference_genome = sample.reference_genome
organism: Organism = self.status.get_organism_by_internal_id(internal_id=organism_id)
is_verified = (
is_verified: bool = (
organism and organism.reference_genome == reference_genome and organism.verified
)
sample._verified_organism = is_verified
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,8 @@ class MicrosaltSample(Sample):
priority: PriorityEnum
reference_genome: str = Field(max_length=255)
_verified_organism: str | None = PrivateAttr(default=None)
islean marked this conversation as resolved.
Show resolved Hide resolved

def model_dump(self, **kwargs) -> dict:
data = super().model_dump(**kwargs)
data["verified_organism"] = self._verified_organism
return data
islean marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class MutantSample(Sample):
region: Region
region_code: str
selection_criteria: SelectionCriteria
_verified_organism: str | None = PrivateAttr(default=None)
_verified_organism: bool | None = PrivateAttr(default=None)
islean marked this conversation as resolved.
Show resolved Hide resolved

@model_validator(mode="before")
@classmethod
Expand All @@ -62,4 +62,5 @@ def serialize_collection_date(self, value: date) -> str:
def model_dump(self, **kwargs) -> dict:
data = super().model_dump(**kwargs)
data["lab_code"] = self._lab_code
data["verified_organism"] = self._verified_organism
islean marked this conversation as resolved.
Show resolved Hide resolved
return data
Loading