Skip to content

Fix Cardinality Handling on Draft Tasks (Templates) with Missing Optional Inputs #306

Closed
@schwzr

Description

@schwzr

Description

A Task Resource in status draft (a "template") doesn't need to include all input parameters, only the required ones. During the load of the form in JavaScript, the StructionDefinition resource is loaded and several steps are performed to display the form correctly. If the script iterates over the input parameters, the following happens, if the input-parameter is not part of the template.

Image

After that, the form generation is aborted and the later input parameters are not adopted accordingly (e.g., they don't have cardinalities displayed at all, optional fields are now required and ..* fields must exactly have one entry).

form.js:725 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'querySelector')
    at modifyTaskInputRow (form.js:725:19)
    at Array.forEach (<anonymous>)
    at parseStructureDefinition (form.js:650:16)

Effected DSF Version

  • <= 1.7.1 (at least with the new FHIR UI Framework in DSF 1.5.0)

To Reproduce

1 .Create a StructureDefinition of a Task with at least 2 input parameters. The first one is optional, the second has max="*" or similar.
2. Create a draft Task with only the second parameter.
3. Try to create an instance based on the draft Task in the DSF FHIR UI.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingready for releaseIssue is fixed and merged into develop, ready for next release

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions