Ok. I have a strategy that I think can do this. It will require additional tiddlers to keep track of tallies and stats (e.g. 2016-08-06.stats, 2018-08-06.tallies) Here's the plan, which is the existing code plus pseudo-code:
<$button> <$list filter="[all[current]fields[]]" variable="fieldname"> <$list filter="[all[current]get<fieldname>prefix[1]suffix[1]]" variable="dummy" > <$list filter="[title<fieldname>getindex[origin]]" variable="origin"> CONVERT ORIGIN INTO TITLE LIST <$LIST STEP THROUGH ALL POSSIBLE ORIGIN TYPES> WHEN FIELD POSSIBLE ORIGIN MATCHES CURRENT ORIGIN, ADD TO ORIGIN FIELD OF TALLIES (e.g. 2018-08-06.tallies!!cbm = l.stork.right chest.fall ) </$LIST> </$list> </$list> </$list> <$LIST> GO THROUGH ALL FIELDS (less created, modified, type) OF 2018-08-06.tallies AND FIND COUNTS PUT COUNTS IN stats TIDDLER (e.g. 2018-08-06.stats!!cbm = 3) </$LIST> </$button> NOW YOU CAN EXTRACT ORIGINS AND COUNTS FROM 2018-08-06.stats AND SORT DIRECTLY Other possible steps that might eventually be needed include clearing the tallies and stats for the visit date before doing new numbers. There also needs to be a list of all possible origins. The easiest way to do that is to create tiddlers for each origin and tag it as "origin". Fleshing this out would take a bit of time, but I think this creates a plausible framework. I had no idea storks were still used in medicine. -- Mark On Monday, August 6, 2018 at 12:00:23 PM UTC-7, Dave wrote: > > Learn something new every day :) > > I think I tagged all the relevant tiddlers - hope it works. I only tagged > (included) the test tiddlers that are checked off in the example tiddler > "2018-08-06" and represented in the fields of "2018-08-06.tests". > > Here's the general rundown of what I'm trying to acheive: > > I want to be able to run various sets of tests for patients (I'm a > chiropractor) as needed. I have computers in each treatment room and > currently just record the visit SOAP notes (Subjective Objective Assessment > & Plan) in a daily visit column of a spreadsheet. Knowing what TW can do > I've always yearned to be able to make something that can make use of the > vast potential that TW provides to a lowly non-programmer type like me. > > Anyway, the basic unit for most visits is the "Visit", i.e. a tiddler > named by today's date. Thanks to the recent MuuriTouch plugins I can now > easily produce a layout the way I'd like with a "control panel" of crucial > info tiddlers with various reports of previous visit summaries, pertinent > medical history etc. This set of tiddlers here is my first serious attempt > to get something to a working version I could actually use in the clinic. > Its basically a 2-3 minute set of neurologic type tests (with more of a > chiropractic slant than a "brain pathology" slant) > > So the Visit tiddler "2018-08-06" contains a link to the neurology tests > tiddler "NeuroScan", and the individual tests from that tiddler place > results from the tests into a "data" tiddler named the same as the visit > tiddler plus ".tests". That way there's no stuttering as you click a > checkbox and the tiddler "reloads" if the results were assigned to the same > tiddler. The individual tests are constructed by passing the test names to > the test macros to go get the info from data tiddlers named after the tests > themselves. Right now I have the tiddler "NeuroScan" kind of "hard > written" as is, but eventually I would like to have the possible tests > dynamically generated as more information slowly gets added to that day's > visit and correlates with whatever the relevant recent and distant medical > history has already been recorded. > > So my current task is to get the ability to see the suggested origins > (origin of the area of the central nervous system that may be the source of > the patients problems) and indications (things that you can do to treat the > patient to address the problems you're finding). > > What you've helped me with is get a weighted list of all the most likely > origins of the problem, in this case "pmrf" (ponto-medullary reticular > formation). That example is in the "2018-08-06.tests" tiddler. My next > thing I'll try to figure out is how to translate "cbm cbm.midline pmrf pmrf > opp > motor cortex pmrf cn8" into "pmrf (3) cmb (2)... etc". > > Actually, just writing this I realized that button you helped make seems > to only print out single instances, not the repeated findings I was hoping > to somehow sort out to suggest the relatively more heavily weighted > suggestions for origin... back to google, ha ha. > > Anyway, thank you both for being patient with me as I muddle through this > :) > -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/tiddlywiki. To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/933ad70a-90b0-48de-8d84-f3d8f57f11ea%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.

