It’s fluke dosing time and something I notice missing from medical logs is fields for milk/meat (and maybe eggs for poultry) withdrawal period.
I intend on using custom flags, but they should have an automatic expiry, I can probably achieve this using a combination of a custom field and Node Red but should probably explore if farmOS/Drupal can handle this as I think it could be a useful contrib module. Any thoughts?
It basically allows certain Material assets to specify a number of days that entry to the field should be restricted after application. Same basic concept, but this would be for animals. Does that sound right @Farmer-Ed@paul121 ?
Yes that seems similar to the REI concept. Eventually this module will display a “warning” message banner at the top of an asset or log page when it has an “active” restricted entry. The message would be provided by this contextual info plugin concept I’ve started here, I’d love to finally formalize that into a PR next week: Display plans associated with a log or asset [#3255507] | Drupal.org
It seems you would want to display a similar message when viewing these animal assets, correct? If so, adding a field to the medical log makes sense considering we need both a timestamp + duration for this “withdrawal period”. Regarding what to name the field… do you think there is language that could be abstracted to cover any type of animal? A quick sketch: " Specify a withdrawal interval if this medical event impacts goods this animal produces." It would be interesting if you could allow a custom message as well, but maybe the log name and other attributes are sufficient for this?
Thanks for sharing this use case though. I’m curious if we could abstract some of this into helpers provided by farmOS core so that you could generate this “interval” contextual message for any asset + log type combo that has a custom “interval” type of field. Just thinking out loud, maybe that could simply be a new field type (the REI stores a simple integer for the # of days, but we’ve thought next steps would be to store this as # of seconds, with an improved UI to select hours/days/weeks, etc)? Another thought that comes to mind is that this could perhaps be tackled thinking of this as “semantic” information about the asset. I wonder if the contextual info should support sprinkling in semantic contexts here.
It added a database table to track “plan considerations” in a general way. It came out of the original grazing module work, which had a “Considerations” tab in the grazing plan UI. The basic idea was you could add things like “Flooded from March to May” associated with certain areas, with a date range. This would then get displayed in the grazing plan’s timeline visualization as a colored area, to make it visible to planners.
I could almost see a unified system for handling these kinds of “time period considerations” provided by farmOS core. Maybe farm_rei (and farm_medical?) could then just depend on this, and add whatever specifics they need on top.
One of the ideas that floated around earlier was using standard “repeating event” calendar behavior/rules to define the time periods. That would allow, for example, adding considerations that repeat yearly - like ground water cycles, pest pressures, weather patterns, etc etc - in addition to more specific things that are triggered by farm management activities - like inputs to land and animals.
I also had a look at @paul121’s code for REI module and started modifying it to work with medical logs. I’ll definitely be watching out for the display plans/ warning message PR too.
I think I can achieve what I want with Node-Red for now, Basically check logs for the withdrawal integers and add/remove flags from the asset as necessary, probably as a batch job once a day will do. Maybe create a google calendar for this too and mark animals withdrawal periods.
More long term I’d like to make this into a proper module, but I still need to figure out some of the mechanics of Drupal, will be following the projects above with some interest as I think there will be lot of commonality.
I’m still chipping away at this module and created a repo for it, GitHub - Farmer-Eds-Shed/farm_withdrawal. It still has a long way to go but at least I’m starting to get my head around the event subscribers.
Any suggestions on this bit? Think I will be still using Node-Red for some of this logic in the short term but would be interested in exploring a proper Drupal/PHP solution.
Maybe I’m looking at it wrong…
I could just use the data I have now and use it to populate a Google Calendar, maybe even import that calendar as an Iframe somewhere.
add flags to the assets, with the data I have now and run a nightly cron job to remove flags which are no longer relevant
No concrete ideas @Farmer-Ed - just thinking out loud about possible ways to generalize. I’d have to refresh on farm_rei and review your module in more detail. Just “feels” like similar problems, so my mind always wants to generalize.