Skip to content

Form.js builds invalid Task resource when submitting form #442

@jaboehri

Description

@jaboehri

Description

document.querySelectorAll(`div.row[for^="${CSS.escape(id)}"]`) in Form.js returns multiple div elements if there are input parameter types which have codes that share a prefix (e.g. my-code and my-code-2) causing an additional input to be generated which might not be allowed according to the Task's StructureDefinition. Replacing for^= with for= solves this problem in my case.

Effected DSF Version

  • 1.5.0 and above

To Reproduce

Prerequisites:

  • Process plugin including Draft Tasks with input parameter types that have codes which share prefixes
  • StructureDefinition of the Draft Tasks must specify that only one of these input parameters is allowed each

Steps to reproduce the behavior:

  1. Try to start a process with such a Draft Task via the FHIR server's ui
  2. FHIR server returns 403 because two inputs for the same input parameter were generated

Expected Behavior

200 response

Logs

FHIR:
The task here has two input parameters with type codes timer-interval and timer-interval-between-pings

Create of Task unauthorized, resource not valid: [Task 1:1296 - ERROR: Task.input:timer-interval: max allowed = 1, but found 2 (from http://dsf.dev/fhir/StructureDefinition/dsf-task-start-monitor-ping-autostart|1.1)]

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