Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
1.3.0 (unreleased)
------------------

- #49 Default all antibiotics to reportable when selective reporting is enabled

1.2.0 (2025-04-04)
------------------
Expand Down
1 change: 1 addition & 0 deletions src/senaite/ast/adapters/listing/analyses.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from zope.component import adapter
from zope.interface import implementer


@implementer(IListingViewAdapter)
@adapter(IListingView)
class AnalysesViewAdapter(object):
Expand Down
16 changes: 15 additions & 1 deletion src/senaite/ast/browser/addpanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def __call__(self):

# Create/Update the selective reporting analyses
if panel.selective_reporting:
add(REPORT_KEY, microorganism, antibiotics)
self.add_reporting_analysis(microorganism, antibiotics)

# If there are extrapolated antibiotics defined, add the
# analysis for selective reporting of extrapolated
Expand Down Expand Up @@ -156,3 +156,17 @@ def add_mic_analysis(self, microorganism, antibiotics):
interim_field["result_type"] = "fraction"
mic.setInterimFields(interim_fields)
return mic

def add_reporting_analysis(self, microorganism, antibiotics):
"""Creates or updates the selective reporting flag (Y/N) analysis, that
allows users to specify whether the result for the sensitivity category
should appear in the final results report
"""
# add or update the analysis
an = self.add_ast_analysis(REPORT_KEY, microorganism, antibiotics)
# result is made of choices (0:|1:Y|2:N), set "Y" as default
interim_fields = an.getInterimFields()
for interim_field in interim_fields:
interim_field["value"] = "1"
an.setInterimFields(interim_fields)
return an