Skip to content

Commit

Permalink
remove unnecessary UDFs in microsalt sample BE (#3886)(patch)
Browse files Browse the repository at this point in the history
## Description
As requested in Clinical-Genomics/clinical-genomics-ui#545, we are removing `quantity` and `concentration_sample` from MicrobialSample model in `cg/models/orders/samples.py`

### Changed

- Microbial Sample
- Fixtures from Microsalt and SARS-Cov2
  • Loading branch information
diitaz93 authored Oct 29, 2024
1 parent cae8368 commit a8c9842
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 21 deletions.
11 changes: 0 additions & 11 deletions cg/models/orders/samples.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,9 @@ class MicrobialSample(OrderInSample):
well_position: str | None
# "Required if "Other" is chosen in column "Species""
organism_other: constr(max_length=Organism.internal_id.property.columns[0].type.length) | None
# "These fields are not required"
concentration_sample: float | None
quantity: int | None
verified_organism: bool | None # sent to LIMS
control: str | None

@validator("quantity", pre=True)
def str_to_int(cls, v: str) -> int | None:
return OptionalIntValidator.str_to_int(v=v)

@validator("concentration_sample", pre=True)
def str_to_float(cls, v: str) -> float | None:
return OptionalFloatValidator.str_to_float(v=v)


class MicrobialFastqSample(OrderInSample):
_suitable_project = OrderType.MICROBIAL_FASTQ
Expand Down
4 changes: 0 additions & 4 deletions tests/fixtures/cgweb_orders/microsalt.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
"container": "96 well plate",
"container_name": "name of plate",
"well_position": "A:1",
"quantity": "102",
"concentration_sample": "101",
"comment": "plate comment"
},
{
Expand Down Expand Up @@ -88,8 +86,6 @@
"container": "Tube",
"container_name": "optional-fields",
"well_position": "",
"quantity": "202",
"concentration_sample": "201",
"comment": "optional comment"
}
]
Expand Down
6 changes: 0 additions & 6 deletions tests/fixtures/cgweb_orders/sarscov2.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"application": "VWGDPTR001",
"collection_date": "2021-05-05",
"comment": "plate comment",
"concentration_sample": "101",
"container": "96 well plate",
"container_name": "name of plate",
"data_analysis": "mutant",
Expand All @@ -22,7 +21,6 @@
"pre_processing_method": "COVIDSeq",
"primer": "Illumina Artic V3",
"priority": "research",
"quantity": "102",
"reference_genome": "NC_111",
"region": "Stockholm",
"region_code": "01",
Expand Down Expand Up @@ -113,7 +111,6 @@
"application": "VWGDPTR001",
"collection_date": "2021-05-05",
"comment": "optional comment",
"concentration_sample": "201",
"container": "Tube",
"container_name": "optional-fields",
"data_analysis": "mutant",
Expand All @@ -128,7 +125,6 @@
"pre_processing_method": "COVIDSeq",
"primer": "Nanopore Midnight V1",
"priority": "research",
"quantity": "202",
"reference_genome": "NC_555",
"region": "Stockholm",
"region_code": "01",
Expand All @@ -141,7 +137,6 @@
"application": "VWGDPTR001",
"collection_date": "2021-05-05",
"comment": "optional comment",
"concentration_sample": "201",
"container": "Tube",
"container_name": "optional-fields",
"data_analysis": "mutant",
Expand All @@ -155,7 +150,6 @@
"pre_processing_method": "COVIDSeq",
"primer": "Nanopore Midnight V1",
"priority": "research",
"quantity": "202",
"reference_genome": "NC_555",
"region": "Stockholm",
"require_qc_ok": false,
Expand Down

0 comments on commit a8c9842

Please sign in to comment.