Using a base record to populate a new record

72 views
Skip to first unread message

Russell Minnich

unread,
Sep 7, 2018, 1:31:17 AM9/7/18
to mementodatabase
Is there a way to use a record in another library as the base values an entry in a different library?

For example, I have a library called doses and another called drugsDrugs contains information about generic doses such as drug name, strength, quantity, etc...
Doses has all of the same information as well as a time/date field and a calculated title.  I am considering creating a link entry from doses to drugs and I would like to copy the data in the entry in drugs to the new record in doses.  But, I want to copy it and have the chance to modify it before saving it as a record in doses.  This way I can change the information in drugs without impacting existing information in doses.  

Would I use a JavaScript field to accomplish this?

Bill Crews

unread,
Sep 7, 2018, 2:19:44 AM9/7/18
to Russell Minnich, mementodatabase
This is my most highly-developed database in my use of Memento. In fact, it's a little bit over-engineered, and then, when I had performance problems, I undid some of that over-engineering to get it to work somewhat faster.

I have Doses linking to Meds and to Prescription Fills. Meds links to Drugs, and Prescription Fills links to Prescriptions. Prescriptions links to People and to Meds.

I use a lot of JavaScript fields, mostly to reference info in the linked libraries and/or calculate something like Planned Hours Between Doses or Planned Next Dose, which is a DateTime kind of thing formatted for an Entry Status field. (You could use Calculation fields for this, if you really prefer.) Not many triggers, and no actions. So the JavaScript is minimal.

The main problem with my database right now is that -- because I use a lot of link-to-entry fields or JavaScript fields referencing linked libraries, and I use those fields as entry name, entry description, or entry status -- the time it takes to display the entries list can be quite long, as Memento is VERY slow with this construct. But, to NOT use them this way makes the entries list almost unusable, so I just struggle.

After initial setup -- getting all the drugs, meds, doctors, and prescriptions entered -- my main activity is to enter doses as I take them and prescriptions & prescription fills as I receive them. I wouldn't change much; it works really well. I take so many drugs that I create a new Doses library every 6 months, so my current one is Bill's Doses 2018Q34, for my doses taken in quarters 3 & 4 of 2018. Instead of Doctors being it's own library, I just keep them in my global People library.

I HIGHLY recommend you don't really copy field values from library to library. If you do that, and you ever make errors entering or updating something, you'll have mismatching data and a nightmare. Just reference them, like in Doses, I get Prescribing Physician like this...

if (field("Medication")[0].field("Prescription required?"))
    field("Prescription fill")[0].field("Prescription")[0].field("Physician")[0].field("Person")[0].field("Full name");
else
    "OTC";

I doubt anyone else on the planet would develop and use all this, but I do, and as I get older, I really depend on it more & more; I forget stuff; I forget when or even whether I took stuff, when a fill or a prescription will run out, and so on. Using this, all I have to remember is to always record what I receive and what I take immediately, before I get distracted. If I do that, the database saves me just fine.

Russell Minnich

unread,
Sep 7, 2018, 3:22:52 AM9/7/18
to mementodatabase
My use case for this database is a log of what I happened to take, primarily for medications where the dosage will vary or are infrequent.  For example, I have 3 NSAIDs: Indocin, Aleve, and Mucinex.  None of them should be taken close together, none of them are taken frequently, and the dosage will vary depending on the ailment.  That's why I was using the drugs library as default values for the doses entries.  There's other metadata on each dose that I didn't list, but isn't part of the default drug data.

Ultimately, it will become a report that I can share with my doctor when it's time to adjust medications.  It also shows compliance, as long my doctor trusts my record keeping.

I might eventually use this for my regular maintenance meds in the future, but a 7 day pill box is usually enough for now for me to realize if I took them or not.

Russell Minnich

unread,
Sep 7, 2018, 4:24:00 AM9/7/18
to mementodatabase
It turns out it was much simpler than I thought.  There's an autofill for libraries/entities that can populate it as needed and even has a search by field built in.  Of course I couldn't find how to use this in the Wiki.

Bill Crews

unread,
Sep 7, 2018, 9:28:33 AM9/7/18
to Russell Minnich, mementodatabase

On Fri, Sep 7, 2018, 04:24 Russell Minnich <russell...@gmail.com> wrote:
It turns out it was much simpler than I thought.  There's an autofill for libraries/entities that can populate it as needed and even has a search by field built in.  Of course I couldn't find how to use this in the Wiki.

--
You received this message because you are subscribed to the Google Groups "mementodatabase" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mementodataba...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages