Universal History of Present Illness Template

Hello,
I made a generic History of Present Illness (HPI) template. It asks the typical questions but the nice thing is that most questions are optional and it will still format correctly (ex. if the person has a sore throat, you don't have to put the location). I also added a little variability so that the templates are not the exact same each time (otherwise it'd be a bit odd reading the HPI in your notes that are formatted identically every time).

(I think the random number function breaks the preview. You do need the Command Pack to run the code so you get the variability.)

{x={random-number: min=1; max=3}}Patient is a {formtext: name=Age}-year-old {formmenu: default=female; male; name=gender} who presents with {formtext: name=complaint}. {if: x==1}The {=lower(complaint)} has been going on for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hour; default=day; week; month; year; name=duration2}{else}{formmenu: hours; default=days; weeks; months; years; name=duration3}{endif}{formmenu: \ and is described as mild.\ ; \ and is described as moderate.\ ; \ and is described as severe.\ ; default=.\ ; \ and is described as controlled.\ ; \ and is described as uncontrolled.\ ; name=Severity}{formmenu: Symptoms are constant.\ ; Symptoms are intermittent.\ ; default=; name=Timing}{formmenu: The symptoms improve with\ ; The symptoms do not improve with\ ; default=; name=Improve}{if: improve=="The symptoms improve with " OR improve=="The symptoms do not improve with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: The symptoms are worsened with\ ; The symptoms are not worsened with\ ; default=; name=worsen}{if: worsen=="The symptoms are worsened with " OR worsen=="The symptoms are not worsened with "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else}. {endif}{endif}{if: x==2}The {=lower(complaint)} has been going on for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hour; default=day; week; month; year; name=duration2}{else}{formmenu: hours; default=days; weeks; months; years; name=duration3}{endif}{formmenu: \ and is described as mild.\ ; \ and is described as moderate.\ ; \ and is described as severe.\ ; default=.\ ; \ and is described as controlled.\ ; \ and is described as uncontrolled.\ ; name=Severity}{formmenu: The patient states that symptoms are constant.\ ; The patient states that symptoms are intermittent.\ ; default=\ ; name=Timing}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{formmenu: Symptoms improve with\ ; Symptoms do not improve with\ ; default=; name=Improve}{if: improve=="Symptoms improve with " OR improve=="Symptoms do not improve with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: The symptoms are worsened with\ ; The symptoms are not worsened with\ ; default=; name=worsen}{if: worsen=="The symptoms are worsened with " OR worsen=="The symptoms are not worsened with "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else}. {endif}{endif}{if: x==3}The {=lower(complaint)} {formmenu: is constant and; default=is intermittent and; ; name=timing}{if: timing==""}has been{else}{endif} present for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hours\ ; default=day\ ; weeks\ ; months\ ; years\ ; name=duration2}{else}{formmenu: hours\ ; default=days\ ; weeks\ ; months\ ; years\ ; name=duration3}{endif}{formmenu: \ The symptoms are described as "mild".\ ; \ The symptoms are described as "moderate".\ ; \ The symptoms are described as "severe".\ ; default=.\ ; The symptoms are described as "controlled".\ ; The symptoms are described as "uncontrolled".\ ; name=Severity}{formmenu: The patient states there is improvement with\ ; The symptoms have not improved with\ ; default=; name=Improve}{if: improve=="The patient states there is improvement with " OR improve=="The symptoms have not improved with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: Symptoms have worsened with:\ ; Symptoms have not worsened with:\ ; default=; name=worsen}{if: worsen=="Symptoms have worsened with: " OR worsen=="Symptoms have not worsened with: "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else} {endif}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{endif}

2 Likes

How to remove the error in Snippet Preview

You can't preview the random command pack. Copy the snippet to your dashboard and it will work fine there

It worked after enabling the random command pack. Thanks

1 Like

Here is an updated version without a few typos I found.

{x={random-number: min=1; max=3}}Patient is a {formtext: name=Age}-year-old {formmenu: default=female; male; name=gender} who presents with {formtext: name=complaint}. {if: x==1}The {=lower(complaint)} has been going on for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hour; default=day; week; month; year; name=duration2}{else}{formmenu: hours; default=days; weeks; months; years; name=duration3}{endif}{formmenu: \ and is described as mild.\ ; \ and is described as moderate.\ ; \ and is described as severe.\ ; default=.\ ; \ and is described as controlled.\ ; \ and is described as uncontrolled.\ ; name=Severity}{formmenu: Symptoms are constant.\ ; Symptoms are intermittent.\ ; default=; name=Timing}{formmenu: The symptoms improve with\ ; The symptoms do not improve with\ ; default=; name=Improve}{if: improve=="The symptoms improve with " OR improve=="The symptoms do not improve with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: The symptoms are worsened with\ ; The symptoms are not worsened with\ ; default=; name=worsen}{if: worsen=="The symptoms are worsened with " OR worsen=="The symptoms are not worsened with "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else}. {endif}{endif}{if: x==2}The {=lower(complaint)} has been going on for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hour; default=day; week; month; year; name=duration2}{else}{formmenu: hours; default=days; weeks; months; years; name=duration3}{endif}{formmenu: \ and is described as mild.\ ; \ and is described as moderate.\ ; \ and is described as severe.\ ; default=.\ ; \ and is described as controlled.\ ; \ and is described as uncontrolled.\ ; name=Severity}{formmenu: The patient states that symptoms are constant.\ ; The patient states that symptoms are intermittent.\ ; default=\ ; name=Timing}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{formmenu: Symptoms improve with\ ; Symptoms do not improve with\ ; default=; name=Improve}{if: improve=="Symptoms improve with " OR improve=="Symptoms do not improve with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: The symptoms are worsened with\ ; The symptoms are not worsened with\ ; default=; name=worsen}{if: worsen=="The symptoms are worsened with " OR worsen=="The symptoms are not worsened with "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else}. {endif}{endif}{if: x==3}The {=lower(complaint)} {formmenu: is constant and; default=is intermittent and; ; name=timing}{if: timing==""}has been{else}{endif} present for {formmenu: a few\ ; several\ ; many\ ; default=; one\ ; two\ ; trim=no; name=duration1}{if: duration1=="one "}{formmenu: hours\ ; default=day\ ; weeks\ ; months\ ; years\ ; name=duration2}{else}{formmenu: hours\ ; default=days\ ; weeks\ ; months\ ; years\ ; name=duration3}{endif}{formmenu: . The symptoms are described as "mild".\ ; . The symptoms are described as "moderate".\ ; \ The symptoms are described as "severe".\ ; default=.\ ; . The symptoms are described as "controlled".\ ; . The symptoms are described as "uncontrolled".\ ; name=Severity}{formmenu: The patient states there is improvement with\ ; The symptoms have not improved with\ ; default=; name=Improve}{if: improve=="The patient states there is improvement with " OR improve=="The symptoms have not improved with "}{formtext: name=improve_sp}{endif}{if: improve==""}{else}. {endif}{formmenu: Symptoms have worsened with:\ ; Symptoms have not worsened with:\ ; default=; name=worsen}{if: worsen=="Symptoms have worsened with: " OR worsen=="Symptoms have not worsened with: "}{formtext: name=worsen_sp}{endif}{if: worsen==""}{else}. {endif}{formmenu: The patient also describes the following associated symptoms:\ ; default=The patient denies any associated symptoms; ; name=Assoc_pre}{if: assoc_pre=="The patient also describes the following associated symptoms: "}{formtext: name=Assoc}{endif}{if: assoc_pre==""}{else} {endif}{formmenu: The issue is primarily located at the\ ; default=; name=pre_location}{if: pre_location==""}{else}{formtext: name=location}{endif}{if: pre_location==""}{else}. {endif}{endif}