Risk Score Calculater, how to make?

I am an internist in Japan and I use Text Blaze to fill out electronic medical records.

I would like to use Text Blaze to calculate a patient's risk score. For example, for a CHADS2 score, the score is determined by 5 questions and the indication for oral medication is determined.

With Text Blaze, I would like to set up a function and use an if statement to get +1 or +2 points when a question is answered.

I would like to create something like the following

Translated with DeepL Translate: The world's most accurate translator (free version)

Hey @Naritatsu_Saito, glad to see you coming up with some many cool ideas for Text Blaze. This is definitely possible. I've created the CHADS2 score calculator that you linked as a snippet:

{note: trim=yes}
CHF history? {formmenu: Yes; default=No; name=CHF; cols=6}
Hypertension history? {formmenu: Yes; default=No; name=hypertension; cols=6}
Age >= 75? {formmenu: Yes; default=No; name=age; cols=6}
Diabetes mellitus history? {formmenu: Yes; default=No; name=diabetes; cols=6}
Stroke or TIA symptoms previously? {formmenu: Yes; default=No; name=stroketia; trim=right; cols=6}
{if: CHF=="Yes"; trim=yes}{chfscore=1}{else}{chfscore=0}{endif}{if: hypertension=="Yes"}{hypertensionscore=1}{else}{hypertensionscore=0}{endif}{if: age=="Yes"}{agescore=1}{else}{agescore=0}{endif}{if: diabetes=="Yes"}{diabetesscore=1}{else}{diabetesscore=0}{endif}{if: stroketia=="Yes"}{stroketiascore=2}{else}{stroketiascore=0}{endif}
{chads2=chfscore+hypertensionscore+agescore+diabetesscore+stroketiascore}
{endnote: trim=yes}
CHADSâ‚‚ Score: {=chads2}

{if: chads2==0}Low risk of thromboembolic event. 1.9% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==1}Intermediate risk of thromboembolic event. 2.8% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==2}Intermediate risk of thromboembolic event. 4.0% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==3}High risk of thromboembolic event. 5.9% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==4}High risk of thromboembolic event. 8.5% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==5}Note: While history of stroke provides 2 points, most physicians would move these patients directly to the high risk group (>8.5% risk of event per year if no coumadin.)

By points directly:
High risk of thromboembolic event. 12.5% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.
{elseif: chads2==6}Note: While history of stroke provides 2 points, most physicians would move these patients directly to the high risk group (>8.5% risk of event per year if no coumadin.)

By points directly:
High risk of thromboembolic event. 18.2% risk of event per year if no coumadin.

The adjusted stroke rate was the expected stroke rate per 100 person-years derived from the multivariable model assuming that aspirin was not taken.{endif}

I wasn't sure if you wanted each contributing factor to be included in what's inserted when you use the snippet, but if you do you can just remove the {note} and {endnote} commands around them.

To give you a breakdown of what is happening in this snippet:

  • Each factor has a yes/no selector
  • Using the if/else command, each factor is given a score (0, 1 or 2)
  • The CHADS2 score is the total of each one of those factor's scores
  • Using an if and elseif command looking at the CHADS2 score, advice is placed at the bottom appropriate to the score
4 Likes

Thanks, that's what I want!!!