Jump to content

Blueprint:InlineValueSet: Difference between revisions

From Sahana Eden Wiki
Dominic (talk | contribs)
Dominic (talk | contribs)
Line 17: Line 17:
While the current <code>InlineComponent</code> concept can facilitate the inline data entry for components, it cannot be configured to use specifications from a third table to build the sub-form rows. Validation is done against the component table model alone, without taking constraints from a third table into account.
While the current <code>InlineComponent</code> concept can facilitate the inline data entry for components, it cannot be configured to use specifications from a third table to build the sub-form rows. Validation is done against the component table model alone, without taking constraints from a third table into account.


Additionally, <code>InlineComponent</code> does not limit the sub-form to a fixed set of specifications - any number of records, including multiple of the same type, can be added.
Additionally, <code>InlineComponent</code> does not limit the sub-form to a fixed set of specifications - any number of records, including multiple of the same type, can be added. Selection of sub-form rows from a set of specifications is not supported.


=== Analysis / Requirements ===
=== Analysis / Requirements ===

Revision as of 08:30, 23 October 2026

Inline Components with Specifications from a third Table

Background

Certain data models define semi-abstract components, with concrete specifications and constraints for the component data determined by records in a third table (spec table).

One example are medical analyses (e.g. blood tests), where the concrete analysis results that can be recorded are specified in a third table, including data types and plausible/permitted ranges:

  • Master: med_analysis
  • Component: med_analysis_result
  • Specification: med_parameter

Problems

While the current InlineComponent concept can facilitate the inline data entry for components, it cannot be configured to use specifications from a third table to build the sub-form rows. Validation is done against the component table model alone, without taking constraints from a third table into account.

Additionally, InlineComponent does not limit the sub-form to a fixed set of specifications - any number of records, including multiple of the same type, can be added. Selection of sub-form rows from a set of specifications is not supported.

Analysis / Requirements

We want a SubForm implementation that

  • generates a list of specifications (parameters) that can be selected by the user for data entry (and de-selected), permitting only one sub-record per spec
  • reads these specification from a third table, including validation constraints for each individual parameter, using them to provide a suitable input field (varying SELECT or text-INPUT) and validate the input
  • creates or updates the sub-records upon form submission, de-duplicating them by specification (parameter), so that only one record per spec can exist (or zero)
  • supports at least one value-field, as well as additional fields for status or references (which could be boolean or choice)
  • can be embedded and configured in CustomCRUDForm declarations, like InlineComponent

Solution Ideas / Proposals

Implementation

Feedback