GCS Score Calculator

Can someone help me make a GCS calculator snippet? I currently type the following by hand each time.

GCS 15 (E4, V5, M6)

I want it to be calculated for me based on the following article descriptions: Glasgow Coma Scale (GCS): What It Is, Interpretation & Chart

So I would select each part of the score, and it would output the calculated elements. If an item is not full points, I want it to output why they were docked, such as E3/4 (patient only opened eyes when instructed to do so)

Hi, welcome to the community :waving_hand:

Please try out the snippet below and let me know if it works for you.

{note}Glasgow Coma Scale Calculator

{endnote}Eye Response: {formmenu: 4 - Opens eyes spontaneously; 3 - Opens eyes to verbal command; 2 - Opens eyes to pressure; 1 - Does not open eyes; name=eye; default=4 - Opens eyes spontaneously}

Verbal Response: {formmenu: 5 - Oriented (answers correctly); 4 - Confused (answers but disoriented); 3 - Inappropriate words; 2 - Incomprehensible sounds; 1 - No verbal response; name=verbal; default=5 - Oriented (answers correctly)}

Motor Response: {formmenu: 6 - Obeys commands; 5 - Localizes to pressure; 4 - Withdraws from pressure; 3 - Flexion to pressure; 2 - Extension to pressure; 1 - No motor response; name=motor; default=6 - Obeys commands}

{note: preview=no}{eye_score=extractregex(eye, "^\d+")}
{verbal_score=extractregex(verbal, "^\d+")}
{motor_score=extractregex(motor, "^\d+")}

{endnote}GCS {=eye_score+verbal_score+motor_score} (E{=eye_score}, V{=verbal_score}, M{=motor_score})

{if: eye_score < 4}E{=eye_score}/4 (Reason: {if: eye_score = 3}Patient only opened eyes when instructed to do so{elseif: eye_score = 2}Patient opened eyes only to pressure{elseif: eye_score = 1}Patient did not open eyes{endif}){else}E4/4 (No deductions){endif}

{if: verbal_score < 5}V{=verbal_score}/5 (Reason: {if: verbal_score = 4}Patient is confused and disoriented{elseif: verbal_score = 3}Patient used inappropriate words{elseif: verbal_score = 2}Patient made incomprehensible sounds{elseif: verbal_score = 1}No verbal response{endif}){else}V5/5 (No deductions){endif}

{if: motor_score < 6}M{=motor_score}/6 (Reason: {if: motor_score = 5}Patient localizes to pressure{elseif: motor_score = 4}Patient withdraws from pressure{elseif: motor_score = 3}Patient shows flexion to pressure{elseif: motor_score = 2}Patient shows extension to pressure{elseif: motor_score = 1}No motor response{endif}){else}M6/6 (No deductions){endif}

Here are a few of the commands it uses (with links to documentation for each)

This is exactly what I was looking for. With a few formatting changes, it will fit perfectly in my bigger script. Thank you for your help!

1 Like