My expectation from working with forms and variables in other snippets is when I enter the form variable "firstdate" into the "at" section of the Date/Time function the system would parse the value related to "firstdate" and not the text "firstdate"
Is this the expected behavior, a bug, or am I doing something wrong?
Is there anyway to pass a date entered by a user in a form to the "at" section of a Date/Time function so it can be shifted?
You're just missing one thing that we don't make super obvious. You've already clicked the "advanced editor" which is correct (see how the icon next to "at" is yellow). But what you need to do is make your "firstdate" field inside of the "at" setting as a formula. That is, instead of just having firstdate as the value of at, make it {=firstdate}. That should work for you.
to piggyback off of this -
I'm trying to calculate a 4 week, 8 week, 12 week future appt from a specific date.
e.g., patient last filled a controlled prescription on 01/27/24 (not 01/27/2024 format) and the next follow-up appointment has to be 4/8/12 weeks from that last fill date.
Additionally is it possible to create a shortcut that uses the "import" function?
Date 4 weeks later: {time: MM/DD/YY; at={=start}; pattern=MM/DD/YY; shift=+4W}
Date 8 weeks later: {time: MM/DD/YY; at={=start}; pattern=MM/DD/YY; shift=+8W}
Date 12 weeks later: {time: MM/DD/YY; at={=start}; pattern=MM/DD/YY; shift=+12W}
Also, can you explain what you mean regarding the import command? The import command allows you to use other snippets within snippets. This allows you to make changes in one snippet and have them reflected in all other snippets in which it is imported.
you rock, thank you!
re: import command - it might be solved if we can separate the above into individual snippets?
e.g.,
snippet #1 = 4 weeks later
snippet #2 = 8 weeks later
snippet #3 = 12 weeks later
Here's a folder with a primary snippet that does the same as the above except that the dates are individual snippets imported to one primary snippet.
Please note that with the folder above, the imported snippets show an error, but work properly in the primary snippet.
You can customize each of the imported snippets and the changes will be reflected when you use the primary snippet.
You can also put the imported snippets inside of a toggle field to turn them on/off as needed. This is what that would look like:
{formtoggle: name=4 weeks; default=yes}{import: /4weeks}{endformtoggle}
This is what it looks like:
Please let me know if this works for you and if you have any additional questions. Happy to help!