Skip to content

Commit

Permalink
Compatibility with core#2537
Browse files Browse the repository at this point in the history
  • Loading branch information
xispa committed Nov 28, 2024
1 parent 11c4d85 commit 66444a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
18 changes: 8 additions & 10 deletions src/senaite/ast/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
u"(Susceptible, increased exposure) and R (Resistant)"),
"choices": "0:|1:S|2:I|3:R",
"sort_key": 530,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -129,7 +129,7 @@
# XXX This is a choices field, but choices are populated on creation
"choices": "",
"sort_key": 505,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -144,7 +144,7 @@
u"disk charge."),
"size": "3",
"sort_key": 510,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -160,7 +160,7 @@
u"susceptible to an antibiotic."),
"size": "3",
"sort_key": 520,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -176,7 +176,7 @@
u"susceptible to an antibiotic."),
"size": "5",
"sort_key": 520,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -187,7 +187,7 @@
# XXX senaite.app.listing has no support for boolean types (interim)
"type": "boolean",
"sort_key": 540,
"string_result": True,
"result_type": "string",
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -200,9 +200,8 @@
u"representatives"),
# XXX This is a choices field, but choices are populated on creation
"choices": "",
"type": "multichoice",
"result_type": "multichoice",
"sort_key": 550,
"string_result": True,
"point_of_capture": AST_POINT_OF_CAPTURE,
"calculation": AST_CALCULATION_TITLE,
},
Expand All @@ -212,8 +211,7 @@
"sort_key": 500,
# The options are the list of microorganisms and are automatically
# added when the corresponding analysis is initialized
"options_type": "multiselect",
"string_result": False,
"result_type": "multiselect",
"point_of_capture": "lab",
"calculation": None,
}
Expand Down
6 changes: 2 additions & 4 deletions src/senaite/ast/setuphandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,17 +227,15 @@ def setup_ast_services(portal, update_existing=True):

description = settings.get("description", AUTOGENERATED)
sort_key = settings.get("sort_key", 1000)
options_type = settings.get("options_type", "select")
string_result = settings.get("string_result", False)
result_type = settings.get("result_type", "numeric")
poc = settings.get("point_of_capture", AST_POINT_OF_CAPTURE)
calc_name = settings.get("calculation", AST_CALCULATION_TITLE)

service.setKeyword(key)
service.setTitle(title)
service.setDescription(description)
service.setSortKey(sort_key)
service.setResultOptionsType(options_type)
service.setStringResult(string_result)
service.setResultType(result_type)
service.setPointOfCapture(poc)

# Get the calculation
Expand Down

0 comments on commit 66444a5

Please sign in to comment.