3 similar SNIPPETS stopped working over the past few weeks - on their own!


#1

I have been away for a month or so and 3 snippets stopped working for unknown reason.
Below are the 3 snippets. Can you fix them and determine what happened. They used to work perfectly well.

I suspect it has something to do with the new Improved {if} Command?

{ formtoggle: name=Anti_Platelet_Treatment;formatter=(value) -> "Anti-platelet medication(s) taken - " if value else "No anti-platelet medication, such as a regular low-dose aspirin, is prescribed" } { if: Anti_Platelet_Treatment } { note } Type { endnote } { formmenu: name=anti_platelet_drug; Low-dose aspirin; Clopidogrel (Plavix or Iscover); Low-dose aspirin + Clopidogrel (Co-Plavix); Dipyridamole (Persantin or Asasantin) } { note } Duration { endnote } { formmenu: default=;- for 1;- for 2;- for 3;- for 4;- for 5;- for 6;- for 7;- for 8;- for 9;- for 10;- for 11;- for 12;- for 15;- for 20;- for 24;- for 30;- for 36 } { formmenu: default=;-day;-days;-week;-weeks;-month;-months;-year;-years }

{ formtoggle: name=Reasons_Anti_Platelet_Taken; formatter=(value) -> "Anti-platelet medication(s) taken because of - " if value else "" } { if: Reasons_Anti_Platelet_Taken } { formmenu: name=reason; default=IHD with coronary artery stents inserted within 12 months;IHD with coronary artery stents inserted over 12 months ago;IHD without coronary artery stents;Cerebrovascular disease;Peripheral vascular disease;There is NO recognised clinical indication for taking this treatment;- Other } { if: reason==="- Other" } { formtext: name=Other reason;default= } { thrombotic_risk="HIGH thrombotic risk - thus must continue anti-platelet agents." if (reason=="IHD with coronary artery stents inserted within 12 months") else "LOW thrombotic risk - thus can stop anti-platelet agents." } { low_risk_label="LOW thrombotic risk - thus can stop anti-platelet agents." } { high_risk_label="HIGH thrombotic risk - thus must continue anti-platelet agents." } { endif } { endif }

{ formtoggle: name=Procedure_Bleeding_Risk; formatter=(value) -> "Procedure Bleeding Risk - " if value else "" } { if: Procedure_Bleeding_Risk } { formmenu: name=proc_bleed_risk; default= Low; High } { endif }

Patient's thrombotic risk profile for stopping anti-platelet treatment should be considered as - { =thrombotic_risk }

Guidelines for stopping anti-platelet treatment - { = treatments[anti_platelet_drug][proc_bleed_risk][thrombotic_risk] }

{ note } { treatments=["Low-dose aspirin" = ["Low" = [ low_risk_label = "stop low-dose aspirin for 2-5-days prior procedure", high_risk_label = "continue low-dose aspirin (omit on day of procedure only)" ],"High" = [ low_risk_label = "should stop low-dose aspirin for at least 5-days prior procedure", high_risk_label = "continue low-dose aspirin except for ESD and large colonic EMR (omit on day of procedure only)" ]],"Clopidogrel (Plavix or Iscover)" = ["Low" = [ low_risk_label = "discontinue Clopidogrel therapy 5-7 days before the procedure & replace with low-dose aspirin (omit on day of procedure only). Restart Clopidogrel 5-7 days after the procedure if specimens taken. Otherwise restart the following day", high_risk_label = "discontinue Clopidogrel therapy 5-7 days before the procedure & replace with low-dose aspirin (omit on day of procedure only). Restart Clopidogrel 5-7 days after the procedure if specimens taken. Otherwise restart the following day" ],"High" = [ low_risk_label = "discontinue Clopidogrel therapy 5-7 days before the procedure. Restart Clopidogrel 5-7 days after the procedure if specimens taken. Otherwise restart the following day", high_risk_label = "discontinue Clopidogrel therapy 5-7 days before the procedure & replace with low-dose aspirin (omit on day of procedure only). Restart Clopidogrel 5-7 days after the procedure if specimens taken. Otherwise restart the following day" ]],"Low-dose aspirin + Clopidogrel (Co-Plavix)" = ["Low" = [ low_risk_label = "discontinue dual anti-platelet therapy 5-7 days prior to the procedure & continue with low-dose aspirin alone (omit on day of procedure only). Restart dual anti-platelet therapy 5-7 days after the procedure if specimens taken. Otherwise restart the following day", high_risk_label = "continue dual anti-platelet therapy unchanged" ],"High" = [ low_risk_label = "discontinue dual anti-platelet therapy 5-7 days prior to the procedure & continue with low-dose aspirin alone (omit on day of procedure only). Restart dual anti-platelet therapy 5-7 days after the procedure if specimens taken. Otherwise restart the following day", high_risk_label = "liaise with cardiologist about the risk/benefit of discontinuation of one of the anti-platelet agents (discontinue Clopidogrel for 5-7 days prior to the procedure & continue with low-dose aspirin alone.) Restart dual anti-platelet therapy 5-7 days after the procedure if specimens taken. Otherwise restart the following day" ]],"Dipyridamole (Persantin or Asasantin)" = ["Low" = [ low_risk_label = "continue treatment unchanged", high_risk_label = "continue treatment unchanged" ],"High" = [ low_risk_label = "discontinue treatment 5-7 days before the procedure & replace with low-dose aspirin (omit on day of procedure only). Restart treatment 5-7 days after the procedure if specimens taken. Otherwise restart the following day", high_risk_label = "discontinue treatment 5-7 days before the procedure & replace with low-dose aspirin (omit on day of procedure only). Restart treatment 5-7 days after the procedure if specimens taken. Otherwise restart the following day" ]]] } { endnote: trim=yes } { endif }

{ formtoggle: name=Anti_Coagulant_Medication;formatter=(value) -> "Anti-coagulant medication taken - " if value else "No anti-coagulant medication is prescribed" } { if: Anti_Coagulant_Medication } { note } Type { endnote } { formmenu: name=anti_coagulant_drug; Warfarin; Apixaban (Eliquis); Rivaroxaban (Xarelto); Dabigatran (Pradaxa) } { note } Duration { endnote } { formmenu: default=;- for 1;- for 2;- for 3;- for 4;- for 5;- for 6;- for 7;- for 8;- for 9;- for 10;- for 11;- for 12;- for 15;- for 20;- for 24;- for 30;- for 36 } { formmenu: default=;-day;-days;-week;-weeks;-month;-months;-year;-years }

{ formtoggle: name=Reasons_Anti_Coagulant_Taken; formatter=(value) -> "Anti-coagulant medication taken because of - " if value else "" } { if: Reasons_Anti_Coagulant_Taken } { formmenu: name=coag_reason; default=AF without valvular disease;AF and mitral stenosis;Prosthetic metal heart valve and AF;Prosthetic metal heart valve in mitral position;Prosthetic metal heart valve in aortic position;Xenograft heart valve;greater than 3 months after VTE;less than 3 months after VTE;Thrombophilia syndromes;- Other } { if: coag_reason==="- Other" } { formtext: name=Other reasons;default= } { thromboembolic_ptrisk="HIGH thromboembolic risk - thus must continue anti-coagulant medication." if (coag_reason=="AF and mitral stenosis") or (coag_reason=="Prosthetic metal heart valve in mitral position") or (coag_reason=="Prosthetic metal heart valve and AF") or (coag_reason=="less than 3 months after VTE") else "LOW thromboembolic risk - thus can stop anti-coagulant medication." } { low_risk_labels="LOW thromboembolic risk - thus can stop anti-coagulant medication." } { high_risk_labels="HIGH thromboembolic risk - thus must continue anti-coagulant medication." } { endif } { endif }

{ formtoggle: name=Procedure_Bleeding_Risk; formatter=(value) -> "Procedure Bleeding Risk - " if value else "" } { if: Procedure_Bleeding_Risk } { formmenu: name=proc_bleed_risk; default= Low; High } { endif }

Patient's thromboembolic risk profile for stopping anti-coagulant treatment should be considered as - { =thromboembolic_ptrisk }

Guidelines for stopping anti-coagulant medication - { = coagtreatments[anti_coagulant_drug][proc_bleed_risk][thromboembolic_ptrisk] }

{ note } { coagtreatments=["Warfarin" = ["Low" = [ low_risk_labels = "stop Warfarin 5 days before the procedure + check INR prior to the procedure is < 1.5 + restart Warfarin on the evening following the procedure with usual daily dose + check INR 1 week later to ensure adequate anti-coagulation", high_risk_labels = "stop warfarin 5 days before procedure + start LMWH (Clexane) 2 days after stopping warfarin + give last dose of LMWH ≥24 hours before procedure + restart Warfarin on the evening of procedure with usual daily dose continue LMWH until INR adequate" ],"High" = [ low_risk_labels = "stop Warfarin 5 days before the procedure + check INR prior to the procedure is < 1.5 + restart Warfarin on the evening following the procedure with usual daily dose + check INR 1 week later to ensure adequate anti-coagulation", high_risk_labels = "stop warfarin 5 days before procedure + start LMWH (Clexane) 2 days after stopping warfarin + give last dose of LMWH ≥24 hours before procedure + restart Warfarin on the evening of procedure with usual daily dose continue LMWH until INR adequate" ]],"Apixaban (Eliquis)" = ["Low" = [ low_risk_labels = "the last dose of Apixaban (Eliquis) be taken ≥ 48 hours before the procedure + restart Apixaban (Eliquis) on the evening following procedure with usual daily dose", high_risk_labels = "omit morning dose of Apixaban (Eliquis) on the day prior to the procedure + restart Apixaban (Eliquis) on the evening of procedure with usual daily dose" ],"High" = [ low_risk_labels = "the last dose of Apixaban (Eliquis) be taken ≥ 48 hours before the procedure + restart Apixaban (Eliquis) on the evening following the procedure with usual daily dose", high_risk_labels = "the last dose of Apixaban (Eliquis) be taken ≥ 48 hours before the procedure + start LMWH (Clexane) 24 hours after stopping Apixaban (Eliquis) + give last dose of LMWH ≥24 hours before procedure + restart Apixaban (Eliquis) on the evening of procedure with usual daily dose" ]],"Rivaroxaban (Xarelto)" = ["Low" = [ low_risk_labels = "the last dose of Rivaroxaban (Xarelto) be taken ≥ 48 hours before the procedure + restart Apixaban (Eliquis) on the evening following procedure with usual daily dose", high_risk_labels = "omit morning dose of Rivaroxaban (Xarelto) on the day prior to the procedure + restart Rivaroxaban (Xarelto) on the evening of procedure with usual daily dose" ],"High" = [ low_risk_labels = "the last dose of Rivaroxaban (Xarelto) be taken ≥ 48 hours before the procedure + restart Rivaroxaban (Xarelto) on the evening following the procedure with usual daily dose", high_risk_labels = "the last dose of Rivaroxaban (Xarelto) be taken ≥ 48 hours before the procedure + start LMWH (Clexane) 24 hours after stopping Rivaroxaban (Xarelto) + give last dose of LMWH ≥24 hours before procedure + restart Rivaroxaban (Xarelto) on the evening of procedure with usual daily dose" ]],"Dabigatran (Pradaxa)" = ["Low" = [ low_risk_labels = "the last dose of Dabigatran (Pradaxa) be taken ≥ 48 hours before the procedure + restart Dabigatran (Pradaxa) on the evening following procedure with usual daily dose (if eGFR btw 30-50, last dose of drug ≥ 72 hours before procedure + in any patient with rapidly deteriorating renal function -> consult a haematologist)", high_risk_labels = "omit morning dose of Dabigatran (Pradaxa) on the day prior to the procedure + restart Dabigatran (Pradaxa) on the evening of procedure with usual daily dose (if eGFR btw 30-50, last dose of drug ≥ 72 hours before procedure + in any patient with rapidly deteriorating renal function -> consult a haematologist)" ],"High" = [ low_risk_labels = "the last dose of Dabigatran (Pradaxa) be taken ≥ 48 hours before the procedure + restart Dabigatran (Pradaxa) on the evening following the procedure with usual daily dose (if eGFR btw 30-50, last dose of drug ≥ 72 hours before procedure + in any patient with rapidly deteriorating renal function -> consult a haematologist)", high_risk_labels = "the last dose of Dabigatran (Pradaxa) be taken ≥ 48 hours before the procedure + start LMWH (Clexane) 24 hours after stopping Dabigatran (Pradaxa) + give last dose of LMWH ≥24 hours before procedure + restart Dabigatran (Pradaxa) on the evening of procedure with usual daily dose (if eGFR btw 30-50, last dose of drug ≥ 72 hours before procedure + in any patient with rapidly deteriorating renal function -> consult a haematologist)" ]]] } { endnote: trim=yes } { endif }

{ pronoun="he" if (title=="Mr.") or (title=="Mister.") else "she" }

{ pronoun_cap="He" if (title=="Mr.") or (title=="Mister.") else "She" }

{ pos_pronoun="his" if (title=="Mr.") or (title=="Mister.") else "her" }

{ pos_pronoun_cap="His" if (title=="Mr.") or (title=="Mister.") else "Her" }


#2

Hi George,

Sorry to hear about that! Can you post the snippet urls or email them to me at support@blaze.today. The snippets here look like they got slightly misformatted when pasted in (all the tags now have a space between the "{" and the tag name) so I can't really tell what the issue if by looking at them.

The snippet url is the url in the dashboard when the snippet is open. It should be something like (https://dashboard.blaze.today/snippet/IDENTIFIER).


#3

Hi George,

I found your snippets and can give you an outline of what is going on.

Background

Historically, when you assigned a variable in an {if} block, that variable would be set regardless of whether the {if} condition was yes or no.

This behavior is quite problematic as it meant that you could have conflicting assignments in the different part of the {if} condition. For example you might want to do the following:

{formtoggle: name=Turbo}
{if: turbo}
We're going fast! {speed=1000}
{else}
We're going slow... {speed=2}
{endif}
Our speed is {=speed}

Traditionally, that wouldn't work the way we want it to. The speed would always be 2 no matter what turbo was set to as both assignments would always be evaluated regardless of the {if} condition and the second would be evaluated last so it would be the final value.

The Fix

The historical behavior is confusing and limiting and so we decided we needed to fix it. Now assignments will only be evaluated within {if} blocks when the relevant part of the {if} block is active.

This new logic is on the dashboard, the forums (which is why the example works correctly above) and the Early access version of the extension. Barring unseen issues, it will be deployed to the production extension within a few weeks.

We do this staged deploy (starting with the website, forums and docs; moving to the early access extension; and finally the production extension) so users can see the change prior to it moving into the main production extension and flag any issues. Access to the early access extension is available by emailing support@blaze.today

Impact on your snippets

This change unfortunately impacts your snippets, but it is straightforward to fix. Let's walk through one.

Looking at Anti-platelet Algorithm, we see that thrombotic_risk is assigned within an {if} condition that is only shown when reason is "-other". However, thrombotic_risk is used outside that {if} condition.

The fix here is to simply pull the thrombotic_risk assignment out of the {if} condition and put it at the top level of your snippet so the assignment is evaluated even when the reason isn't "-other" which is what you desire.

Summary

I hope this helps explain the issue, why we are making the change, and how to fix it.

I am happy to work through the changes to snippets with you in more detail in this thread, or we can always jump on a call to go over them together.


#4

Thanks you.
Simple and again work well.
GM