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

Build reference and quantity components #639

Open
fongsean opened this issue Feb 20, 2024 · 14 comments · Fixed by #649 or #950
Open

Build reference and quantity components #639

fongsean opened this issue Feb 20, 2024 · 14 comments · Fixed by #649 or #950

Comments

@fongsean
Copy link
Collaborator

The renderer is still yet unable to render items of type = "reference" and "quantity".

The "Bit of everything" questionnaire provides a simple example of how these items look like.

@fongsean fongsean mentioned this issue Mar 7, 2024
fongsean added a commit that referenced this issue Mar 7, 2024
Add attachment, reference and quantity component. For issue #639 and #640
@fongsean fongsean reopened this Mar 7, 2024
@robeastwood-agency
Copy link

Hi @fongsean - in the Agency we are looking to build a set of Questionnaire instances using item.type = "quantity", and making use of the CSIRO renderer.

Therefore, just wondering what the plans are for implementing quantity? Thank you!

(note- we have no plans for type = "reference")

@fongsean
Copy link
Collaborator Author

fongsean commented Aug 6, 2024

It was previously placed in the backlog (stale issues) as a to-do without a high priority since none of our Questionnaires use it.

Given your interest in having it, I think its high time I get this implemented :)

https://github.com/konsulin-id/smart-forms actually implemented it in their fork a couple days ago: konsulin-care@af8b8f8. I'll work with them to get this into the main repo.

Will keep you updated.

fongsean referenced this issue in konsulin-care/smart-forms Aug 6, 2024
* Add Quantity Item Form Component

* Update package version

* Update packages version
@robeastwood-agency
Copy link

Thanks very much @fongsean !

@ryuuzake ryuuzake mentioned this issue Aug 6, 2024
@ryuuzake
Copy link
Contributor

I created a PR for this @fongsean

@fongsean
Copy link
Collaborator Author

Thanks @ryuuzake! I'll look into it today and add my changes re: pre-population

@fongsean
Copy link
Collaborator Author

Hi all,

Unfortunately I have to work on something else with higher priority (needs to be demoed next week at Brisbane), I'll come back to this if I have capacity this week, otherwise it seems like I can only deliver it next week.

I'm pretty close, is just more about making sure it works properly with calculations and other SDC stuff.

@robeastwood-agency
Copy link

All good @fongsean - thank you again for progressing this

@fongsean
Copy link
Collaborator Author

Hi @robeastwood-agency, just got this implemented.

See the docs here: https://smartforms.csiro.au/docs/components/quantity
See examples here: https://smartforms.csiro.au/storybook/?path=/story/component-itemtype-quantity--quantity-basic

We got unitOption implemented (big thanks to Riza!) but not unitValueSet. Not sure if that is something your team is interested in having.

@fongsean fongsean reopened this Aug 22, 2024
@robeastwood-agency
Copy link

Thank you very much @fongsean (sorry have just returned from leave).

This looks great, having used the smartforms playground to do some experimentation with (close to) our real examples of vital sign measures.

Comments:

  • At this point we don't anticipate a need for unitValueSet, as a single unitOption looks to suffice.
  • We don't know yet from the business whether range restrictions should be applied to various values (eg pulse rate as a quantity only between 40 - 300 say). But if so, the extensions Min Quantity and Max Quantity would be desirable to use to control data entry. And having played with these in the Playground, I'm guessing they are not implemented. So, this might be a feature request, if and when requirements come our way. Your thoughts?

Cheers, thanks again; looks awesome!

@fongsean
Copy link
Collaborator Author

Sounds great Rob! Feel free to open a feature request if you have a need for minQuantity and maxQuantity.

We currently have minValue and maxValue implemented https://smartforms.csiro.au/docs/sdc/advanced/constraint#minvalue, so hopefully it can be leveraged during our future implementation.

I'll keep this issue open given we haven't built out type reference yet.

@samturneradha
Copy link

Hi, just weighing in on the discussion surrounding the implementation of quantity.
My query relates to using the unitOption extension the smartforms playground (http://hl7.org/fhir/StructureDefinition/questionnaire-unitOption). The use of this extension in certain sections of the questionnaire would be desirable for us if we were to extract values out at later stages due to it being implemented with other fhir profiles where the extracted information might wind up. This raises two issues that if at all possible could you please take a look at?
a) the quantity entry field has an associated field which allows entry of <, >, <= etc symbols as optional.

image

Wondering if this can be suppressed as it is not deemed useful for the specific questions. However of course the optional symbol may be required for other situations - so removing the option is not desired, but rather optionally suppressing. Is it ok to post this request here or open a new feature request?

b) the other associated field is for the configured unit(s) of the quantity (cm, kg, etc). Our CHAP usecase questions have a single unit and therefore the drop down seems redundant, but of course there would be other use cases where multiple units need to be configured and the drop down is necessary. Therefore wondering if there was a way (also sounds like a new feature) to not render a drop down when one unit is configured.

image

Thank you

@fongsean
Copy link
Collaborator Author

fongsean commented Nov 19, 2024

@samturneradha Thanks for raising this.

a) I wholeheartedly agree with you on this. Most of the questionnaires I've seen with Quantity items do not require the comparator symbol, but it's wrong to leave it out given it's there in the spec.
I'm working on a set of library APIs to tweak rendering behaviours that SDC doesn't provide extensions for. I will include a hideQuantityComparator boolean flag to suppress it.

These new library APIs are currently in the alpha release of the library, but I imagine there could be breaking changes between different alpha versions (not yet so far), so proceed with caution. There are also no documentation on how to use these APIs yet.

b) Valid point. I think it makes sense to have the unit baked into the input field (example) when there's only a single unitOption.

Can you create two new issues on both of these? Thanks a bunch.

@samturneradha
Copy link

Thanks so much will do.

@robeastwood-agency
Copy link

@fongsean - a new feature request has been added for quantity item re minQuanity and maxQuantity extensions
#1069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants