From 3f48d9dce1d4eda34454f57a46b55545200571b4 Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 6 Dec 2023 14:23:59 +0100 Subject: [PATCH 1/5] Parse new concentration field --- cg/models/orders/constants.py | 1 + cg/models/orders/excel_sample.py | 1 + 2 files changed, 2 insertions(+) diff --git a/cg/models/orders/constants.py b/cg/models/orders/constants.py index 42ab938df4..aacec8e9e5 100644 --- a/cg/models/orders/constants.py +++ b/cg/models/orders/constants.py @@ -26,6 +26,7 @@ class ExcelSampleAliases(StrEnum): COLLECTION_DATE = "UDF/Collection Date" COMMENT = "UDF/Comment" CONCENTRATION = "UDF/Concentration (nM)" + CONCENTRATION_NG_UL = "UDF/Concentration (ng/ul)" CONCENTRATION_SAMPLE = "UDF/Sample Conc." CONTAINER = "Container/Type" CONTAINER_NAME = "Container/Name" diff --git a/cg/models/orders/excel_sample.py b/cg/models/orders/excel_sample.py index bdc293f4e2..7e6a2dac7c 100644 --- a/cg/models/orders/excel_sample.py +++ b/cg/models/orders/excel_sample.py @@ -29,6 +29,7 @@ class ExcelSample(OrderSample): concentration: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION ) + concentration_ng_ul: Field(alias=ExcelSampleAliases.CONCENTRATION_NG_UL) concentration_sample: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION_SAMPLE ) From b9e2e5675da4f1ffcf917674888919faf652a18f Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 6 Dec 2023 14:53:40 +0100 Subject: [PATCH 2/5] Add default --- cg/models/orders/excel_sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/models/orders/excel_sample.py b/cg/models/orders/excel_sample.py index 7e6a2dac7c..1db9a052ff 100644 --- a/cg/models/orders/excel_sample.py +++ b/cg/models/orders/excel_sample.py @@ -29,7 +29,7 @@ class ExcelSample(OrderSample): concentration: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION ) - concentration_ng_ul: Field(alias=ExcelSampleAliases.CONCENTRATION_NG_UL) + concentration_ng_ul: Field(None, alias=ExcelSampleAliases.CONCENTRATION_NG_UL) concentration_sample: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION_SAMPLE ) From 181b497cb8a8fc097d23301e02f3eadb923fcddf Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 6 Dec 2023 14:54:37 +0100 Subject: [PATCH 3/5] Add default --- cg/models/orders/sample_base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cg/models/orders/sample_base.py b/cg/models/orders/sample_base.py index 54cd1c57c4..d4a964f4b2 100644 --- a/cg/models/orders/sample_base.py +++ b/cg/models/orders/sample_base.py @@ -53,6 +53,7 @@ class OrderSample(BaseModel): collection_date: str | None = None comment: constr(max_length=Sample.comment.property.columns[0].type.length) | None = None concentration: float | None = None + concentration_ng_ul: float | None = None concentration_sample: float | None = None container: ContainerEnum | None = None container_name: str | None = None From 6bcb7c872572c84ebd1149a7b31746b3947b231a Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 6 Dec 2023 15:02:37 +0100 Subject: [PATCH 4/5] Add default --- cg/models/orders/excel_sample.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cg/models/orders/excel_sample.py b/cg/models/orders/excel_sample.py index 1db9a052ff..4c5871ed91 100644 --- a/cg/models/orders/excel_sample.py +++ b/cg/models/orders/excel_sample.py @@ -29,7 +29,7 @@ class ExcelSample(OrderSample): concentration: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION ) - concentration_ng_ul: Field(None, alias=ExcelSampleAliases.CONCENTRATION_NG_UL) + concentration_ng_ul: str = Field(None, alias=ExcelSampleAliases.CONCENTRATION_NG_UL) concentration_sample: Annotated[str, AfterValidator(numeric_value)] = Field( None, alias=ExcelSampleAliases.CONCENTRATION_SAMPLE ) From 29699bd1b087aadeabf5840d86074238a1786e71 Mon Sep 17 00:00:00 2001 From: islean Date: Wed, 6 Dec 2023 15:13:20 +0100 Subject: [PATCH 5/5] Add support for json --- cg/models/orders/json_sample.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cg/models/orders/json_sample.py b/cg/models/orders/json_sample.py index db775ed3f2..2d4440a38b 100644 --- a/cg/models/orders/json_sample.py +++ b/cg/models/orders/json_sample.py @@ -9,6 +9,7 @@ class JsonSample(OrderSample): cohorts: list[str] | None = None concentration: str | None = None + concentration_ng_ul: str | None = None concentration_sample: str | None = None control: str | None = None data_analysis: Pipeline = Pipeline.MIP_DNA