Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support minValue maxValue in the sdc library #164

Closed
jingtang10 opened this issue Jan 22, 2021 · 3 comments · Fixed by #224
Closed

Support minValue maxValue in the sdc library #164

jingtang10 opened this issue Jan 22, 2021 · 3 comments · Fixed by #224
Assignees
Labels
good first issue Good for newcomers type:enhancement New feature or request

Comments

@jingtang10
Copy link
Collaborator

See http://build.fhir.org/ig/HL7/sdc/behavior.html

minValue question (where type='date', 'dateTime', 'time', 'decimal', 'integer')
This extension is used for questions with simple quantitative types. The extension allows establishing the lower bound for an answer. For example, ensuring that birth dates are >= 1990-01-01 or an integer is greater than or equal to 0. (Note that the integer and decimal types both allow negative numbers if not constrained.) This extension can be used together with the cqf-calculatedValue extension to establish a dynamic limit. For example, ensuring that a date of birth will result in a maximum age by setting minValue with an expression of 'today() - 18 years'.

The minValue SHALL be less than or equal to the maxValue, if both are specified. If min and/or max are calculated values, care should be taken to ensure that they cannot ever conflict. I.e. It should never be possible for calculated max to be less than calculated min. If this does occur, systems SHALL prohibit a value from being specified for the element for so long as the conflict exists. If the question is required, this may mean that it is not possible to mark the QuestionnaireResponse as "completed".

maxValuebquestion (where type='date', 'dateTime', 'time', 'decimal', 'integer')
This extension is used for questions with simple quantitative types. The extension allows establishing the upper bound for an answer. For example, ensuring that birth dates are >= 1990-01-01 or an integer is greater than or equal to 0. (Note that the integer and decimal types both allow negative numbers if not constrained.) This extension can be used together with the cqf-calculatedValue extension to establish a dynamic limit. For example, ensuring that a date of birth will result in a minimum age by setting maxValue with an expression of 'today() - 18 years'.

The minValue SHALL be less than or equal to the maxValue, if both are specified. If min and/or max are calculated values, care should be taken to ensure that they cannot ever conflict. I.e. It should never be possible for calculated max to be less than calculated min. If this does occur, systems SHALL prohibit a value from being specified for the element for so long as the conflict exists. If the question is required, this may mean that it is not possible to mark the QuestionnaireResponse as "completed".

cqf-calculatedValue support is out of scope

@jingtang10 jingtang10 added type:enhancement New feature or request good first issue Good for newcomers labels Jan 22, 2021
@jingtang10 jingtang10 added this to Needs triage in Data capture library via automation Jan 22, 2021
@jingtang10 jingtang10 moved this from Needs triage to Medium priority in Data capture library Jan 22, 2021
@jingtang10 jingtang10 moved this from Medium priority to To do in Data capture library Jan 26, 2021
@jingtang10
Copy link
Collaborator Author

@kunjan8794 are you interested in taking this?

@kunjan8794
Copy link
Collaborator

kunjan8794 commented Jan 28, 2021

@jingtang10 Surely, I'll take this up. Thanks 👍🏻

@kunjan8794 kunjan8794 self-assigned this Jan 28, 2021
@jingtang10
Copy link
Collaborator Author

Awesome :) There are a few different data types to support (see comment above) but you can certainly start with one type (e.g. integer) and send a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers type:enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants