Question re {import: }

Just a quick question but I wanted to make sure I am doing this correctly. I'm currently working on making a template snippet for the different sections of my clinic notes (history, physical, assessment/plan). My current history snippet uses datablaze with a placeholder variable (see below):

{note: trim=yes; preview=no}
Variables/Lists:
Placeholder complaint / dx: {run: dx= ""}
Initialize database + selected parts of hx:
{run: db_lists={dbselect: SELECT symptoms, red flags, treatments tried, associated sx, hx components FROM history WHERE dx / complaint = @dx; space=57Y9Lcf1LFEnYOwzkFVofq; menu=no}
hx_selected= db_lists["hx components"]}
Symptoms: {symptoms_list=db_lists["symptoms"]}
Associated sx: {associated_list=db_lists["associated sx"]}
Red flags: {red_flags_list=db_lists["red flags"]}
Tx tried: {treatment_list=db_lists["treatments tried"]}
{endnote: trim=yes}

... rest of snippet

the way I've been using this is by making a single snippet for each condition that just replaces the dx variable. I have in datablaze entries for each dx that changes the above variables (ex: sinus pain)

{note: trim=yes; preview=no}
dx / complaint: {dx="sinus pain"}
{endnote: trim=yes}
{import: /template-hx}

It seems to work but I just want to make sure I'm doing this correctly. The initial dx variable is just a placeholder so that the template doesnt throw errors. Also not sure if its better to initiate the other variables in the run command or outside of it.

The hx_selected variable needs to be able to change as it is used to set the initial selections in a formmenu so I think thats where it needs to go

Thanks for the help

Hey @Doc_Krieger,
Your approach looks good. You are right to put the hx_selected inside the run command because if it can change.

Best
Samay

Thanks for the help. Just wondering but what is the best way in the forum's to post the import function if I want to demonstrate how my snippets should work. I know you cant actually have it import in the forum but you probably have a good way to demonstrate it

@Doc_Krieger since the {import} command is not supported, the best way to reproduce it in the community would be to copy all the content of your snippet and paste it in the place where your normal "import" would be.

It can be a bit tedious but the community snippet showcases aren't connected in any way to your account snippets, so we can't auto-import them for you.

1 Like

thanks!