Daisy chaining templates

Discussion in 'General Discussion' started by Graham, Jan 24, 2008.

  1. Graham

    Graham Developer Staff Member

    Here's an idea that has been suggested to me.

    In the current macro template scheme, you substitute one word from a list for another. The proposal is to substitute another macro instead for that word.

    So, say the original word was *throat-exam*, then the macro choices would be @normal-throat-exam, @acute-pharyngitis, @mono-throat ... and each of these would insert a new macro into the text. The new macro could again link to other macros. The words after @ refer to the name of an existing macro.


    Could get a wee bit complicated....
  2. Graham

    Graham Developer Staff Member

    A prototype is now working in Beta 12 client and R83B4 server.

    This is how it is working.

    I wish to create a macro regarding adverse drug effects. Now sure we can have some text like
    where we can substitute "no" or "severe" for the *some* as we can do now, but we are going to create three new macros that allow us to expand upon this.

    First off, in Settings/Macros let's create a new macro called "DrugAdverseEffects", and the choices will be "!NoAdverseDrugEffects" and "!AdverseDrugEffects".

    So the data looks like this:

    Word: *DrugAdverseEffects*
    Choices: !NoAdverseDrugEffects !AdverseDrugEffects

    and click on the [Add] button.

    Now the use of the ! infront of the word indicates that this refers to another macro. So, we now need to create these two new macros.

    Bring up the consult editor for any patient, click on the [Macros] tab, and select any existing Macro.

    Now we wish to add our two new macros.

    Use the drop-down list and change this to "meds", in the search field, put in "NoAdverseDrugEffects" without the quotes, and in the text area type in something like:
    and then click on the [Save As] button. We now have a new macro under the "meds" class called "NoAdverseDrugEffects".

    We now create the other one called "AdverseDrugEffects" and use the following text or similar:
    and save it as well.

    Now that we have defined these new macros, we can use them in a macro template.

    To do this just place *DrugAdverseEffects* in an existing template. When you click on the [Replace] button, the list will now show the two choices of
    • !NoAdverseDrugEffects
    • !AdverseDrugEffects

    Select the one you want, and then click again on the [Replace] button, and the defined macro will be inserted into the template area. Use the [Restart] button if you wish to do substitutions on this inserted template now as otherwise it will continue after the insertion point.
  3. Graham

    Graham Developer Staff Member

    I've just created a demo video of how this works with a patient who has rheumatoid disease, and has come for an unscheduled appointment complaining of severe left knee pain. She also has problems with her medications.


    You can view it here.
  4. Graham

    Graham Developer Staff Member

    For those of you have already watched the video, I have done it again with a newer beta so that picking left, right and both is easier.

  5. Graham

    Graham Developer Staff Member

    It now looks as though it will be quite possible to trigger a GUI template from within the macro templates.

    This leads to interesting possibilities where the macro templates can become the main way of generated the documentation for those that do not type well. You have the macro system which generates readable text, and you have the GUI templates that can provide detailed examination findings.

  6. Jason

    Jason Developer / Handyman Staff Member

    Cool. [:)] How would it be triggered ?
  7. Graham

    Graham Developer Staff Member

    Provisionally "$name of gui template" in the pick list of choices.



  8. Jason

    Jason Developer / Handyman Staff Member

    Each Consult is a popup of The Consult Tab.

    The Macro is a popup of the Consult.

    The GUI popup would be a popup of the Macro.



    I think a rich GUI popup for intuitive selections is a good idea, but we don't want to suffer popup-itis.

    I guess one thing to do would be

    (1) write a template !

    (2) you could create macros which only have 1 "GUI popup" and put all the information in there.



    I always come back to the need for inline text macroing being the fastest and most intuitive.
  9. Graham

    Graham Developer Staff Member

    All these popups is a problem .. but we need a super duper input screen with all the different types of input available!

  10. Graham

    Graham Developer Staff Member

    The first simplification is that the macro selection window will just be that .. the text replacement functions will be removed and we will use the ones in the main screen instead (Replace tab).

  11. Jerry

    Jerry Administrator Staff Member

    I'm going to make a patient temperature GUI template that pops up with in-line text using the new $temp format. This is an example where having a GUI popup in-line is actually better, I think. I've seen slider GUI's used for this, but I don't like them - too slow. I see the macro templates included with my "stock" installation of synapse use the "XXX degrees" form, intending that the user will drag and replace XXX with a temperature number. Either that method or some huge linear number pick list (which would not work with *macros* because it's numeric) are not as good as an in-line popped up GUI in this case, I don't believe. On the other hand, I agree that having GUI templates as the only pop-up method with in-line text as in is the case in some EMR's is not as flexible.
  12. Jason

    Jason Developer / Handyman Staff Member

    Good point, I agree.
  13. Jerry

    Jerry Administrator Staff Member

    This may not quite be the place to comment GUI radio buttons, but I think it would be a good idea to design GUI templates the choices of yes, no, and n/a where n/a is just a null with no associated text. This would make it possible to use, say, the anatomy regional GUI templates, check the "all normal" button, and then uncheck the one or two items you didn't examine, or the one or two items that are abnormal or yes. Much faster than individually checking every radio button. Currently it is not possible to uncheck a radio button once checked.
  14. Graham

    Graham Developer Staff Member

    I thought about this a little, and the reason I like it the way it is is that having no selection is easier to see than seeing which one of three selections has been made.

    Anyway I am in discussion with the Rebgui author about if we can deselect the radio button with the mouse.
  15. Graham

    Graham Developer Staff Member

    Jerry, the $temp gui popup is not working yet. Harder to do than I expected.

    The old templates with XXX there are pre-macro invention[;)]

    What I am doing now for temperature is use a reasonable range from which to pick the alternatives. So, for Centrigrade, I have

    *nn* . *n* where nn is 35 thru to 40 and n is 0 thru 9

    what's the reasonable range for Fahrenheit?
  16. Jerry

    Jerry Administrator Staff Member

    What I am doing now for temperature is use a reasonable range from which to pick the alternatives. So, for Centrigrade, I have

    *nn* . *n* where nn is 35 thru to 40 and n is 0 thru 9

    what's the reasonable range for Fahrenheit?



    Using text macros in that way sounds like a pretty reasonable accommodation - necessitates 2 popups, but the choices on each are fairly limited. I hope it can work to mix GUI templates and text macros, as I think it will make it possible to mix the best features of both. Fahrenheit ranges should probably go from 95 to 105 or even 106. The lower range could be all the way down to the high 80's in the case of extreme hypothermia in an ER setting. In that case, you could probably have more than one temperature range to select from, because it would be a known hypothermia case to begin with. Is anyone using synapse in an ER setting that you know of so far?
  17. Graham

    Graham Developer Staff Member

    Not that I know of.

    But I would think the nursing staff would enter the temperature via the vitals popup, and so what the template really needs to do is pull in the latest temperature etc from that data.

    So, as *age* pulls in the age, perhaps *TempF* should pull in the temperature as last recorded....
  18. Jerry

    Jerry Administrator Staff Member

    But I would think the nursing staff would enter the temperature via
    the vitals popup, and so what the template really needs to do is pull
    in the latest temperature etc from that data.

    So, as *age* pulls in the age, perhaps *TempF* should pull in the temperature as last recorded....

    Yes, that would be the best for sure. Bear with me as I become accustomed to where all the regular chart stuff is located in synapse. Can *TempF* be done right now?
  19. Graham

    Graham Developer Staff Member

    No, I was suggesting that we have more macros that pull in patient stuff like this.

    So far we have ( add the *xxx* )
    • age
    • sex
    • title
    • surname
    • fname
    • occupation

    Seems like we perhaps also need
    • TempF
    • TempC
    • BP
    • pulse
    • O2
    • Weight
    • Height
    • BMI

    Anything else?
  20. Jerry

    Jerry Administrator Staff Member

    Seems like we perhaps also need
    • TempF
    • TempC
    • BP
    • pulse
    • O2
    • Weight
    • Height
    • BMI

    Anything else?



    Yes --- respirations, P02 -> pulse oximetry, head circumference, in the ER would need PCO2 for hypercapnea monitor, and peak flow. If you use an EMR in the urgent care or ER, the ability to do reassessments is key, so repeat sets of PO2, peak flow, pulse, BP, respirations, temp are needed and particulars for each (BP-->R arm laying, Temp-->Axillary, etc.). We use pulse oximetry and peak flow routinely in urgent care. Some consider pulse oximetry to be a 5th vital sign.

Share This Page